Jump to content
Eternal Lands Official Forums
Sign in to follow this  
McLane

i had a little talk with a bot developer

Recommended Posts

hi all,

 

it says on forum subtitle to post ALL bot issues in this forum, so here is the story:

 

i've been sitting next to campfire on IP on the test server the last two weeks to develop and test a bot called whois.

2 days ago when i logged onto test server i saw another bot named kollin owned by jaxbot_test, i guess former jaxbot.

when i came home yesterday evening i was running through my logs to see if everything is ok with my bot and if it crashed for some reasen (my guildies test him from time to time). i got annyoed by a lot of messages looking like

#Message from God: Kollin was eaten by a Grue (lagged out)!

so i contacted the game guild on real server to have a little talk to whoever is in charge of kollin. here is the chat_log:

[23:46:42] Jaxbot_tester: Yes Mclane?

[23:46:42] [PM to Jaxbot_tester: Error 404: Away From Keyboard Message not found...]

[23:46:47] Not AFK any more

[23:46:48] McLane: hi

[23:46:56] Jaxbot_tester: What's up

[23:46:57] McLane: kollin is lagging a lot

[23:47:06] Jaxbot_tester: Oh, yeah...

[23:47:09] McLane: 136 times last 12 hours... did you miss the heartbeat?

[23:47:41] Jaxbot_tester: No... but EL has been lagging a lot too... I think I need to reboot my whole network

[23:48:00] Jaxbot_tester: and my computer is acting slow...

[23:48:10] Jaxbot_tester: I'm not sure what's wrong.

[23:48:40] McLane: did you put a sleep(30) or similar into the loop of your bot so he doesn't use 100% cpu all the time?

[23:49:16] Jaxbot_tester: I'm not sure... I got my bot from open source, and I've edited it quite a bit, but I don't think it's in there...

[23:50:18] Kollin: i am kollin. i am a bot run and "made" by jaxbot. please contact me if a malfunction. 10011100110100111010110100011101010101101010110101

[23:50:25] Jaxbot_tester: Hmm...

[23:50:36] McLane: what language did you use?

[23:50:44] Jaxbot_tester: He posted that and the guild ad easyly...

[23:50:48] Jaxbot_tester: I used PHP

[23:51:08] McLane: a bot in php? nice...

[23:51:12] Jaxbot_tester: yep

[23:51:23] McLane: any chance to put the source somewhere so i can see if i can find something wrong?

[23:51:28] Jaxbot_tester: hold on... I'm rebooting him...

[23:51:47] Jaxbot_tester: uh... I'm not sure, I'll see.

[23:52:15] Jaxbot_tester: He worked perfectly for a day, so I think my network is mega-malfunctioning...

[23:53:41] McLane: did you close all apps that could lock that directory?

[23:54:23] Jaxbot_tester: ok...

[23:54:32] Jaxbot_tester: so how often does he lagged out?

[23:54:37] McLane: 136

[23:54:43] Jaxbot_tester: in 12 hours?

[23:54:47] McLane: moment

[23:55:24] Jaxbot_tester: thats... not possible... I woke up at 7:00 this morning, and it's 5:55 now :S

[23:55:26] McLane: first time he lagged was 13:14 gmt+2 (10 hours 30 mins ago)

[23:55:36] Jaxbot_tester: Oh.

[23:55:47] Jaxbot_tester: What time in EL time?

[23:56:12] Kollin: i hope i make it to the finals... i must fight the grues!

[23:56:17] Jaxbot_tester: LOL

[23:56:23] McLane: oh... don't know... from now on 10 hours and 30 mins ago

[23:56:46] Jaxbot_tester: hmm... you sure keep track of things..

[23:57:18] Jaxbot_tester: are you a offical bot tester?

[23:57:21] McLane: just make sure he sends a HEARTBEAT packet at least every 30 secs... i send mine every 25 secs

[23:57:28] McLane: no, i'm nothing official

[23:57:32] Jaxbot_tester: oh :)

[23:57:39] Jaxbot_tester: ok, will do.

[23:57:42] McLane: i'm just on test server a lot to test my bot

[23:57:43] Jaxbot_tester: 10 hours ago...

[23:57:47] Jaxbot_tester: ok

[23:58:29] Jaxbot_tester: He must've lagged out at 8:30...

[23:58:46] Jaxbot_tester: but I was just getting off my computer at 8:33...

[23:58:48] Jaxbot_tester: and...

[23:58:49] McLane: i don't know your timezone... i'm at gmt+2

[23:58:50] Jaxbot_tester: hmm...

[23:59:08] Jaxbot_tester: I'm... EDT... hold on

[23:59:33] Jaxbot_tester: GMT-5 here

[23:59:45] Jaxbot_tester: but 10 hours and 30 minutes..

[23:59:46] Jaxbot_tester: hmm...

[23:59:51] Jaxbot_tester: I wonder...

[00:00:24] Jaxbot_tester: Probly about the time I opened a web browser...

[00:00:26] Jaxbot_tester: oh....

[00:00:28] #Message from God: Kollin was eaten by a Grue (lagged out)!

[00:00:50] Jaxbot_tester: ok...

[00:01:05] Jaxbot_tester: well, my computers been lagging up a lot recently...

[00:01:25] McLane: there he went off again

[00:01:28] Jaxbot_tester: I probly should restart soon..

[00:01:30] Jaxbot_tester: NO!

[00:01:33] Jaxbot_tester: Kollin!

[00:01:57] Jaxbot_tester: Ok........ is it against the rules to have bots that lagg a little?

[00:02:22] Jaxbot_tester: lol

[00:02:38] Jaxbot_tester: You know... brb...

[00:02:40] McLane: no, but it's a) not good for server and server logs; B) not good for players arround as those lag messages flood the logfiles...

[00:03:22] #Message from God: Kollin was eaten by a Grue (lagged out)!

[00:03:24] McLane: if he lags out cause of reconnect every 24 hours to the internet or there's a routing problem it's totally normal and ok...

[00:03:42] McLane: but 136 times in 10 hours isn't normal, there's something wrong with the programm code

[00:04:17] Jaxbot_tester: back

[00:04:47] Jaxbot_tester: It's not the code...

[00:05:18] Jaxbot_tester: because if it were, he'd lagg up everything 15 minutes, or something accurate...

[00:05:30] Jaxbot_tester: but... he was working fine before..

[00:05:40] Jaxbot_tester: Ugh... right when I thought I was done

[00:07:25] Jaxbot_tester: What do you suggest I do?

[00:07:38] Jaxbot_tester: I don't have money to buy a super server...

[00:07:55] McLane: gather the packets he is sending with ethereal to find out if he sends his heartbeat

[00:08:03] Jaxbot_tester: ok..

[00:08:11] Jaxbot_tester: I'll check

[00:08:27] McLane: let him put debug log to console whenever he sees or recieves data to see if he thinks he needs to send heartbeat

[00:09:16] McLane: there are many ways to find the problem... if you've got a php debugger use it

[00:09:54] McLane: and for your "computer slow" problem test if it is only slow when kollin is logged in or all the time... watch the cpu usage

[00:10:14] McLane: maybe you don't have a sleep or the sleep isn't at right position on source

[00:11:00] McLane: and for the heartbeat counter don't count the numbers of the while(data_available) loop. get timestamp when sending one and check

[00:11:01] Jaxbot_tester: Odd...

[00:11:15] Jaxbot_tester: it has a headbeat send function...

[00:11:26] McLane: with another timestamp if the 25 secs are passed and you need to send the next one... and so on

[00:11:37] Jaxbot_tester: but I can't find the counter that sends them...

[00:11:42] Jaxbot_tester: you know, calls the function

[00:11:44] Jaxbot_tester: brb

[00:12:38] #Message from God: Kollin was eaten by a Grue (lagged out)!

[00:14:24] Jaxbot_tester: Hey...

[00:14:33] Jaxbot_tester: wait a minute...

[00:14:51] Jaxbot_tester: the heartbeat timer is set to every 10 seconds...

[00:14:57] Jaxbot_tester: is that too much?

[00:15:54] Jaxbot_tester: McLane, you typing or AFK?

[00:16:13] McLane: 20 or 25 should do

[00:16:18] Jaxbot_tester: ok

[00:16:24] McLane: and of course the timer should be running

[00:16:29] Jaxbot_tester: what about 27?

[00:16:55] McLane: i assume your bot isn't multithreaded

[00:17:24] Jaxbot_tester: Muliti threaded?

[00:17:33] McLane: so if some1 pms him a command and he needs ~10 secs to react (or more ppl do at the same time) you might mis the heartbeat... 20 to 25 is ok

[00:17:45] McLane: after ~40 to 45 secs you lagg out

[00:17:56] Jaxbot_tester: ok

[00:17:58] Jaxbot_tester: good

[00:18:08] Jaxbot_tester: 22 ok?

[00:18:14] McLane: multithreaded... a programm that splits itself into autonome parts

[00:18:20] Jaxbot_tester: hehe, I like random numbers :)

[00:18:35] Jaxbot_tester: Yeah, mine is muiliti threaded then.

[00:18:41] Jaxbot_tester: Ok, Kollin.

[00:18:45] Jaxbot_tester: Let's try this!

[00:18:50] Jaxbot_tester: Wait...

[00:18:54] Jaxbot_tester: one second.

[00:19:23] Jaxbot_tester: it checks to heartbeat every time it recives a packet

[00:19:45] Jaxbot_tester: But... what if it doesn't recive one?

[00:19:53] McLane: that's the problem you're encountering

[00:19:59] McLane: you need to change that

[00:20:10] Jaxbot_tester: how?

[00:20:34] Jaxbot_tester: wait...

[00:20:49] McLane: ok, some very abstract code:

[00:20:54] Jaxbot_tester: it's EDK ad is timed to reciving packets.......

[00:20:56] Jaxbot_tester: ohj

[00:21:00] McLane: bool bRunning = true;

[00:21:06] McLane: while (bRunning) {

[00:21:26] McLane: if (Data_Available) { ParseData;}

[00:21:46] Jaxbot_tester: Oh.. I get it now

[00:22:01] Jaxbot_tester: but...

[00:22:10] McLane: if ((now-LastHeartBeat) >= 22) {sendheartbeat;}

[00:22:21] McLane: }

[00:22:37] Jaxbot_tester: yeah

[00:22:54] Jaxbot_tester: but the problem is, I'd have to redo everything if I did that...

[00:22:56] Jaxbot_tester: and..

[00:23:01] Jaxbot_tester: I'm confused

[00:23:08] Jaxbot_tester: He sent the EDK ad when...

[00:23:09] Jaxbot_tester: brb

[00:23:10] McLane: oh, forgotten something

[00:23:50] McLane: after the heartbeat handling and before the the end of the while loop put a sleep(50) to sleep 50 milliseconds so other programs can act, too

[00:23:51] Jaxbot_tester: He checks if it's time to send the EDK add when it recives a packet...

[00:24:08] Jaxbot_tester: I'm confused...

[00:24:23] Jaxbot_tester: Is there a easy way to do this?

[00:24:35] Jaxbot_tester: brb

[00:25:21] McLane: i just posted the easy way

[00:25:36] Jaxbot_tester: oh

[00:25:41] Jaxbot_tester: hold on

[00:25:43] Jaxbot_tester: testing...

[00:26:05] Kollin: please master, don't turn me off!

[00:26:09] Kollin: i'll be good!

[00:26:19] Kollin: i promise!

[00:26:24] Jaxbot_tester: too late :P

[00:27:13] Jaxbot_tester: hmm...

[00:27:18] Jaxbot_tester: not logging in

[00:27:30] Jaxbot_tester: I did what you said...

[00:27:37] Jaxbot_tester: but it's not working quite right

[00:28:25] Jaxbot_tester: now what?

[00:28:39] Jaxbot_tester: is Kollin trying to make me mad?

[00:28:48] McLane: how should i know without knowing the source...

[00:29:00] Jaxbot_tester: while (true) {$this->keepAlive();sleep(50);}

[00:29:23] McLane: what happens in keepAlive ?

[00:29:37] McLane: http://sourceforge.net/projects/elbot/ << good example for what i told you

[00:29:49] Jaxbot_tester: global $SERVER_COMMANDS; // Send a heartbeat, if needed $currentTime = time(); $nextHeartbeatTime = $this->lastHeartbeatTime + $this->heartbe

[00:30:02] Jaxbot_tester: atTimer; if (($currentTime >= $nextHeartbeatTime) || ($forceHeartbeat)) { $this->send($SERVER_COMMANDS["HEART_BEAT"]); $this->logInfo("Send hea

[00:30:15] Jaxbot_tester: rtbeat."); $this->lastHeartbeatTime = time(); }

[00:31:24] McLane: you miss all the login stuff etc... so he can not log in

[00:31:50] McLane: you've to combine your current message loop with the heartbeat loop....

[00:32:34] Jaxbot_tester: if I did that, then I would have to combine 12 other import files...

[00:32:41] Jaxbot_tester: >:|

[00:33:17] McLane: to sum it up... if server doesn't get the heartbet he will lagg out... how to send it is your choice... i prefer the global message loop as i told you

[00:33:17] Jaxbot_tester: Dude... listen, this was really good tested source, I'm sure it's my network... it's been acting up a ton...

[00:33:39] McLane: but if you don't include that right from the beginning it's a lot of work to put it in there afterwards

[00:33:55] Jaxbot_tester: I didn't make the bot...

[00:33:59] Jaxbot_tester: someone else did...

[00:34:09] Jaxbot_tester: and let me have the basic source

[00:34:19] McLane: ok ok, just wanted to tell you about that problem...

[00:34:29] Jaxbot_tester: Wait.

[00:35:26] Jaxbot_tester: Kollin checks if 5 minutes are up every time someone chats... or theres a actor ID packet or something.

[00:35:47] Jaxbot_tester: And something i don't do a thing, and yet he advertises

[00:36:11] Jaxbot_tester: maybe the server is sending the bot heartbeats or something...

[00:36:34] Jaxbot_tester: ok, well...

[00:36:47] McLane: server doesn't send heartbeats...

[00:36:47] Jaxbot_tester: Thanks for informing me about this problem.

[00:37:05] Jaxbot_tester: I'm rebooting my computer now, so by!

[00:37:07] Jaxbot_tester: :(

[00:37:13] McLane: bye

[00:37:21] Jaxbot_tester: i might have to get off after it reboots, though

[00:37:37] Jaxbot_tester: but I should be back later tonight

[00:45:32] #Message from God: Kollin was eaten by a Grue (lagged out)!

[00:46:06] Jaxbot_tester: Hello Kollin

[00:46:13] Kollin: hi

[00:46:35] Kollin: i hope i work... br

[00:46:38] Jaxbot_tester: brb*

[00:47:31] Jaxbot_tester: McLane, I don't remember rules against laggy bots ;)

[00:47:38] Jaxbot_tester: joking

[00:48:22] Jaxbot_tester: anyway, WHAT DO I DO!!!!

[00:48:46] Jaxbot_tester: If this bot laggs, it laggs, I can't really fix it... I don't think at least...

[00:50:42] McLane: ask the guy that coded it for you

[00:50:48] Jaxbot_tester: ok

[00:50:49] Jaxbot_tester: I will

[00:51:00] Jaxbot_tester: mean time...

[00:51:01] Jaxbot_tester: hmm..

[00:51:27] pesca: what??

[00:51:36] pesca: mean time?

[00:51:54] Kollin: mind your own buisness!!

[00:51:59] Jaxbot_tester: rude bots :P

[00:52:10] pesca: what?

[00:52:18] Jaxbot_tester: nothing..

[00:52:25] Jaxbot_tester: I'm talking to Kollin

[00:53:56] Jaxbot_tester: see?

[00:54:12] Jaxbot_tester: he won't lagg out as long as theres a packet every 30 seconds..

[00:54:42] McLane: so how will you make sure the server will send him a packet every 30 secs?

[00:54:59] McLane: and that's not a pretty solution

[00:55:02] Jaxbot_tester: people not stop spamming on channel :)

[00:55:09] Jaxbot_tester: No, it's not..

[00:55:23] Jaxbot_tester: but I'm guessing that it was a network problem in the first place.

[00:55:37] Jaxbot_tester: still, the packets of chat should keep him going..

[00:56:58] McLane: ok... would you mind putting him somewhere else than campfire on test server than?

[00:57:14] Jaxbot_tester: He's going to TG

[00:57:20] Jaxbot_tester: on the real one

[00:58:09] Jaxbot_tester: ok, let's see what would happen if NO one talked..

[00:58:12] Jaxbot_tester: for a odd reason

[00:59:14] McLane: and there must be no animals :)

[00:59:19] Jaxbot_tester: True

[00:59:27] Jaxbot_tester: But that's impossible :P

[00:59:43] Jaxbot_tester: so, he probly wouldn't lagg much...

[01:00:02] Jaxbot_tester: besides, I think it was my computer that was the problem...

[01:00:10] McLane: still enough for 136 times in 10 hours :P

[01:00:21] Jaxbot_tester: No.. I rebooted everything

[01:00:26] Jaxbot_tester: it's working much better now

[01:00:56] Jaxbot_tester: Wait..

[01:01:11] Jaxbot_tester: if I have to move my bot, why don't you move <i>yours<i>

[01:01:19] Jaxbot_tester: </i>*

[01:01:21] Jaxbot_tester: lol

[01:01:36] Kollin: he has a point

[01:01:44] Jaxbot_tester: :D

[01:01:53] Jaxbot_tester: my bots always agree :)

[01:02:54] Jaxbot_tester: *sigh*

[01:03:08] Jaxbot_tester: maybe I could have a bot that sends "here's a packet"

[01:03:18] Jaxbot_tester: message's to Kollin to keep him alive :)

[01:03:20] Jaxbot_tester: joking

[01:03:57] McLane: ok, i told you what i wanted to tell you... what you do with that information is your own thing... got to go... bye

[01:03:59] Jaxbot_tester: Can you make me rank 15 so I can outlaw whois

[01:04:04] Going AFK

[01:04:23] Jaxbot_tester: bye

[01:04:28] Jaxbot_tester: lol

[01:06:15] Jaxbot_tester: yep

[01:06:20] Jaxbot_tester: it was my network!

[01:06:22] Jaxbot_tester: hahahahahaa!

[01:06:28] Jaxbot_tester: g2g

[01:06:34] Jaxbot_tester: bye

guess what happens if we wait just a few minutes...

[01:27:08] #Message from God: Kollin was eaten by a Grue (lagged out)!

[01:31:57] #Message from God: Kollin was eaten by a Grue (lagged out)!

[01:33:10] Jaxbot_tester: McLane?

[01:33:10] [PM to Jaxbot_tester: Error 404: Away From Keyboard Message not found...]

[01:33:15] Jaxbot_tester: oh well

[01:43:20] #Message from God: Kollin was eaten by a Grue (lagged out)!

and if you log on to test server and sit onto campfire right now you can see the following:

in meantime there are 2 of them lagging often at same time so i guess netwizard also belongs to jaxbot

and if you really wanna watch that, don't move and don't talk :P

[19:42:18] #Message from God: Kollin was eaten by a Grue (lagged out)!

[19:42:18] #Message from God: NetWizard was eaten by a Grue (lagged out)!

[19:51:32] #Message from God: Kollin was eaten by a Grue (lagged out)!

[19:51:32] #Message from God: NetWizard was eaten by a Grue (lagged out)!

[19:59:35] #Message from God: Kollin was eaten by a Grue (lagged out)!

[20:11:53] #Message from God: Kollin was eaten by a Grue (lagged out)!

[20:11:53] #Message from God: NetWizard was eaten by a Grue (lagged out)!

[20:12:57] #Message from God: Kollin was eaten by a Grue (lagged out)!

[20:12:57] #Message from God: NetWizard was eaten by a Grue (lagged out)!

[20:13:49] #Message from God: Kollin was eaten by a Grue (lagged out)!

[20:13:49] #Message from God: NetWizard was eaten by a Grue (lagged out)!

[20:33:14] #Message from God: Kollin was eaten by a Grue (lagged out)!

[20:33:14] #Message from God: NetWizard was eaten by a Grue (lagged out)!

[20:34:09] #Message from God: Kollin was eaten by a Grue (lagged out)!

[20:34:09] #Message from God: NetWizard was eaten by a Grue (lagged out)!

i don't know if jaxbot doesn't understand what i told him or if i told him wrong. the issue i have is that i would like to keep at the campfire with my bot without those lag messages from god. i don't have anything against company even if they are bots but please have them get a stable connection before logged in all the time. thanks.

Edited by McLane

Share this post


Link to post
Share on other sites

The test server is there for testing clients and bots, there is no rule about how offen you can send messages on the test server. If there is a serious problem with a bot that keeps lagging out ask us on this forum and we can try and help you out.

 

How does the bot send messages? is there a single thread that does both the input and output? are there 2 threads? If there is one thread remember if the client is stuck reading input it cannot send a ping packet so check your input code. Most packets follow the convension type(byte) length(short) data[] except the remove_bag which is type(byte) id(short) so you need to handle this packet somehow.

Share this post


Link to post
Share on other sites

Maybe the same prob here, 12 grues every hour?

 

2006-08-08 02:04:08 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:06:18 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:13:10 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:15:14 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:20:11 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:23:21 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:24:31 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:34:42 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:36:46 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:46:51 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:52:42 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:55:52 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

2006-08-08 02:58:47 :MESSAGE:#Message from God: Elguild was eaten by a Grue (lagged out)!

 

 

He's sitting next to sms on the real server and sms counts:

fgrep "Elguild" log/sms.log | grep -v LOCATION | wc -l

449

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×