collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18365
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: problems with language  (Read 4942 times)

0 Members and 1 Guest are viewing this topic.

Offline Ezhik

  • BeBot Rookie
  • *
  • Posts: 18
  • Karma: +0/-0
problems with language
« on: December 03, 2007, 01:19:14 am »
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 "??????". With news the same, when i'm adding nes on russian, in the table news only "?????".
What i'm doing wrong?

Offline Ezhik

  • BeBot Rookie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: problems with language
« Reply #1 on: December 03, 2007, 01:23:19 am »
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.

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: problems with language
« Reply #2 on: December 03, 2007, 08: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) [Select]
php StartBot.php Bot1&
php StartBot.php Bot2
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: problems with language
« Reply #3 on: December 03, 2007, 02:03:19 pm »
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.

Offline Ezhik

  • BeBot Rookie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: problems with language
« Reply #4 on: December 03, 2007, 05:19:04 pm »
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 "???"? or should i add some code listed in http://bebot.link/index.php/topic,1094.0.html to fix that problem?

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: problems with language
« Reply #5 on: December 03, 2007, 05:21:53 pm »
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.

Offline Ezhik

  • BeBot Rookie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: problems with language
« Reply #6 on: December 03, 2007, 05:40:26 pm »
what .php file should i find to correct bots encoding?

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: problems with language
« Reply #7 on: December 03, 2007, 05:43:37 pm »
It's in Bot.php, send_gc(), send_pgroup(), send_tell, inc_gmsg(), inc_pgmsg() and inc_tell(). Search for utf8_.

Offline Ezhik

  • BeBot Rookie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: problems with language
« Reply #8 on: December 03, 2007, 05:48:19 pm »
thanks, i'll watch that. will post here the result :)

Offline Ezhik

  • BeBot Rookie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: problems with language
« Reply #9 on: December 04, 2007, 12:14:44 am »
heh.. solved the problem.
just commented strings $msg=utf8_encode($msg) and $msg=utf8_decode($msg).
it solved problemwith "?????" 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...

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: problems with language
« Reply #10 on: December 04, 2007, 04:46:41 pm »
What you probably want is start-stop-daemon to start your bot.

Edit:
Your /etc/rc.local would then look something like this:
Code: [Select]
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, 05:05:16 pm by Blueeagle »
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline Ezhik

  • BeBot Rookie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: problems with language
« Reply #11 on: December 04, 2007, 05:38:08 pm »
and is it so bad to run bots from root? :)

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: problems with language
« Reply #12 on: December 04, 2007, 05:46:11 pm »
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.

Offline Ezhik

  • BeBot Rookie
  • *
  • Posts: 18
  • Karma: +0/-0
Re: problems with language
« Reply #13 on: December 04, 2007, 08:14:40 pm »
code of start should be a lil other ;)
just tested it.
2 scripts is b1.sh and b2.sh (has 755 permissions)
b1.sh:
Code: [Select]
php StartBot.php Bot1b2.sh
Code: [Select]
php StartBot.php Bot2Third script is named Bots.sh( permissions 755)
Code: [Select]
#!/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".

 

* Recent Posts
0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm ]

* Who's Online
  • Dot Guests: 143
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal