Joined: 29 Dec 2004 Posts: 367 Location: Australia
Posted: Sat Feb 19, 2005 10:05 am Post subject:
My bot seems to be collecting things in the while(1) loop, to neaten this up i would like to put the contents in an external .pl file. Would access to this be to slow? If so would storing it in a hash be faster?
Joined: 03 May 2006 Posts: 2292 Location: Colorado
Posted: Sat Feb 19, 2005 5:01 pm Post subject:
QUOTE(draget @ Feb 19 2005, 02:05 AM)
My bot seems to be collecting things in the while(1) loop, to neaten this up i would like to put the contents in an external .pl file. Would access to this be to slow? If so would storing it in a hash be faster?
Doing lots of stuff in the loop will eventualy slow it down. Storing the code for the loop in a seperate file will have no effect if done right. You could put the entire loop in an external file and just require it at the same spot you wold put the loop code. Or you could do like matt said and do
Joined: 29 Dec 2004 Posts: 367 Location: Australia
Posted: Sun Feb 20, 2005 5:27 am Post subject:
Thanks guys, I know the bot will eventualy slow down, this is my first bot, not too efficient, but still seems fairly quick, next one will be better.....but thats a long way off!
Oh btw
Quote:
sub do_loop { my $msn = shift; $msn->do_one_loop(); } 1;
Can't put the 1; inside the sub anyway. _________________ Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com