L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2008, 05:43:11 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > BeBot 0.4 support > Topic: problems with language
Pages: [1]   Go Down
« previous next »
Print
Author Topic: problems with language  (Read 313 times)
0 Members and 1 Guest are viewing this topic.
Ezhik
Freshman
*
Offline Offline

Posts: 18


problems with language
« on: December 02, 2007, 07:19:14 PM »

Hello!
i have a 0.4.3 Bebot runnig on mysql 5.1 under Ubuntu 7.10(UTF-8).
THere is a problems with guest channel and "news" base. My org using russian language and from guest channel output is "HuhHuh". With news the same, when i'm adding nes on russian, in the table news only "Huh??".
What i'm doing wrong?
Logged
Ezhik
Freshman
*
Offline Offline

Posts: 18


Re: problems with language
« Reply #1 on: December 02, 2007, 07:23:19 PM »

And also a question here...
How can i start 2 bot or more in one system?
added a symlink to rc3.d dir to start for 2 bots
first link to script like "php StartBot.php Bot1"
second link to script like "php StartBot.php Bot2".
But starting only a first bot, when first bot going shutdown then starting the second bot.
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: problems with language
« Reply #2 on: December 03, 2007, 02:41:28 AM »

For the first translation issue we will need a sample text that causes the error. Preferably the text you entered, the text that is actually stored in the database and finally a screenshot of the output in AO.

As for starting more than one bot you might need to add & after the command so to let the script know that this process should run in the background.

The code below should probably work even tho I haven't tested it.
Code: (/etc/rc3.d/S99bebot)
php StartBot.php Bot1&
php StartBot.php Bot2
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1089


Re: problems with language
« Reply #3 on: December 03, 2007, 08:03:19 AM »

bebot is using the utf8 charset, which doesn't support cyrillic letters - it's basically an ASCII I think. Without rewriting the bot to support multi-byte charsets it won't be possible to support anything else. No clue how much would have to be changed there.

About starting several bots, go look up the tool screen, it's nice for running several bots. And I'd advise to make sure you aren't running any bot as root.
Logged
Ezhik
Freshman
*
Offline Offline

Posts: 18


Re: problems with language
« Reply #4 on: December 03, 2007, 11:19:04 AM »

when i checked mysql tables of bot it's charset was latin1 with sweden encoding.
if i'll change with MySQLAdmin charsets of all tables will this affect to "Huh"? or should i add some code listed in http://bebot.shadow-realm.org/index.php/topic,1094.0.html to fix that problem?
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1089


Re: problems with language
« Reply #5 on: December 03, 2007, 11:21:53 AM »

I don't know what the functions in the post you linked do.

But changing the charset of your tables won't change anything, as bebot itself is enforcing utf8 in all incoming and outgoing messages.
Logged
Ezhik
Freshman
*
Offline Offline

Posts: 18


Re: problems with language
« Reply #6 on: December 03, 2007, 11:40:26 AM »

what .php file should i find to correct bots encoding?
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1089


Re: problems with language
« Reply #7 on: December 03, 2007, 11:43:37 AM »

It's in Bot.php, send_gc(), send_pgroup(), send_tell, inc_gmsg(), inc_pgmsg() and inc_tell(). Search for utf8_.
Logged
Ezhik
Freshman
*
Offline Offline

Posts: 18


Re: problems with language
« Reply #8 on: December 03, 2007, 11:48:19 AM »

thanks, i'll watch that. will post here the result Smiley
Logged
Ezhik
Freshman
*
Offline Offline

Posts: 18


Re: problems with language
« Reply #9 on: December 03, 2007, 06:14:44 PM »

heh.. solved the problem.
just commented strings $msg=utf8_encode($msg) and $msg=utf8_decode($msg).
it solved problemwith "Huh??" inguest channel.But the problem with News and Logon messages still was. I was used gui for MysqlAdmin ot watch the bd tables. The encoding of coloumns and tables was 'latin1' just changed it to 'cp1251' and terminated and started the bots.
btw script like:
Quote
cd /home/user/bot/
php StartBot.php bot1 &
php StartBot.php bot2 &
started both bots in background, but it starts from rc.local, and i think it's started with a system with a root priviegies...
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: problems with language
« Reply #10 on: December 04, 2007, 10:46:41 AM »

What you probably want is start-stop-daemon to start your bot.

Edit:
Your /etc/rc.local would then look something like this:
Code:
start-stop-daemon --start --chuid user --exec php /home/user/bot/StartBot.php bot1
start-stop-daemon --start --chuid user --exec php /home/user/bot/StartBot.php bot2
exit 0

I have _NOT_ tested this code, but as far as I can read the man page it should be correct. You obviously have to change both (all four since you're starting two bots) instances of "user" to the actual user name starting the bot.

I might also be on the wrong track here. :p
« Last Edit: December 04, 2007, 11:05:16 AM by Blueeagle » Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
Ezhik
Freshman
*
Offline Offline

Posts: 18


Re: problems with language
« Reply #11 on: December 04, 2007, 11:38:08 AM »

and is it so bad to run bots from root? Smiley
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1089


Re: problems with language
« Reply #12 on: December 04, 2007, 11:46:11 AM »

Yes. In general you should only run programs as root that cannot work in any other way.

If a program running as root is exploited due to any bug it will allow full root access to your server. I don't know of any exploits for PHP and BeBot right now, but that doesn't mean that you can be sure that there is no possible exploit.
Logged
Ezhik
Freshman
*
Offline Offline

Posts: 18


Re: problems with language
« Reply #13 on: December 04, 2007, 02:14:40 PM »

code of start should be a lil other Wink
just tested it.
2 scripts is b1.sh and b2.sh (has 755 permissions)
b1.sh:
Code:
php StartBot.php Bot1
b2.sh
Code:
php StartBot.php Bot2
Third script is named Bots.sh( permissions 755)
Code:
#!/bin/bash
cd /home/nbelenkov/bebot
start-stop-daemon -S -c user -g 114 -d /home/user/bebot -x /home/user/bebot/1.sh &
start-stop-daemon -S -c user -g 114 -d /home/user/bebot -x /home/user/bebot/2.sh &
hint: groups id u can see in /etc/groups
then made a symlink to rc3.d dir like "S99Botz".
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Support > BeBot 0.4 support > Topic: problems with language
« previous next »
 
Jump to:  

Recent
online not working after ...
by Temar
[Today at 05:09:48 PM]

Bot not working after tod...
by Alreadythere
[Today at 01:04:41 PM]

Tokens Calulator
by Temar
[December 03, 2008, 01:09:03 PM]

Bebot does not work with ...
by IKShadow
[December 03, 2008, 08:54:04 AM]

!items database
by Temar
[December 03, 2008, 07:27:59 AM]

massive_pvp_time_table 1
by Sudoka
[December 03, 2008, 06:49:07 AM]

Log playtime from buddys ...
by IKShadow
[December 02, 2008, 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]
Stats
Members
Total Members: 1246
Latest: Vingus
Stats
Total Posts: 11193
Total Topics: 1508
Online Today: 21
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 6
Guests: 13
Total: 19
Kentarii
Raysett
Temar
vikor
upstart
daltarak

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.463 seconds with 28 queries. (Pretty URLs adds 0.031s, 4q)
Loading...