User Control Panel
Advertisements

HELP US, HELP YOU!

Pictionary game

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
ugly.breath
Newbie
Newbie


Joined: 09 Mar 2005
Posts: 18

Reputation: 14.5

PostPosted: Mon Mar 21, 2005 8:49 am    Post subject: Reply with quote

OK thanks for your time. Here goes:

Im trying to make a pictionary. i need a way to have a delay while not pausing the whole bot. what shoudl i do. also when the code it sover the bto crashes. This is what ive got (not finished so dont ecpect functionality)

Code:
<br />&send ($self," The game will start in 30 seconds!!! <br />When you want to guess the answer type: !1<answer> (without the < >s)  . Happy Playing!<br />Game Will Start Shortly!");<br />select(undef, undef, undef, 30);<br /><br /><br />&send ($self,"               <br />              _<br />             /  <br />              <br />            _,.<br />   /|__/|   /     <br />   |_  _/ /   <br />     | | _|   <br />      |     <br />       |    <br />     ~~~`~~~<br />");<br /> <br /><br /><br />select(undef, undef, undef, 15); <br /> <br />&send ($self, "<br />                 __   _<br />                __ | / <br />               /  | | /<br />                   ||/<br />             _,.---v-<br />   /|__/|   /        <br />   |_  _/ /          <br />     | |_|           <br />      |              <br />       |     ,__/    <br />     ~~~`~~~~~~~~~~~");<br /><br /><br />select(undef, undef, undef, 15);; <br /><br />     <br />&send ($self, "<br />                __   __<br />               __ | / __<br />              /  | | /  |<br />                  ||/<br />            _,.---v---._<br />   /|__/|  /            |<br />   |_  _/ /              | <br />     | |_|           @ __|<br />      |                |_<br />       |     ,__/       /<br />     ~~~`~~~~~~~~~~~~~~/~~~~");<br />     <br />     <br />select(undef, undef, undef, 5);<br />


it hasnt got anything else yet but i need a way to pause while not freezing the whole bot and y is the bot crashing (YE SI MEAN the bot not the command) after the command is over???? Plz help. O and by the way. if my bot hasnt been on for a while its coz it is a bit buggy coz this command aint working. its made it unstable, so it will b back on soon if i get help

Thanks,
ugly.breath
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Mar 21, 2005 12:57 pm    Post subject: Reply with quote

A good reason that the bot would crash is because of this:

Quote:
select(undef, undef, undef, 15);;


That would get you what's called a "syntax error" - if you had run your bot through command prompt--like you're SUPPOSED to--you would have seen that error. And it would even tell you what line it's on so you can go and fix it.

And as for your delaying process, you might try something like this:

Code:
# To delay for 30 seconds.<br />&doSleep(30);<br /><br />########################<br /><br /># Subroutine to make the bot pause while still being "alive"<br />sub doSleep {<br />   my $time = shift;<br /><br />   # Expiration time = current time + sleep time.<br />   my $expire = time() + $time;<br /><br />   # Loop internally until the time expires.<br />   while (time() <= $expire) {<br />      $msn->do_one_loop();<br />   }<br /><br />   return;<br />}


So that will make $msn go on a smaller internal loop (being able to continue staying online and receive messages), and when the time has expired the subroutine will finally return, allowing the caller code to continue. Long story short, it will do what you want it to.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
mattaustin
Sentinel
Sentinel


Joined: 19 Jul 2004
Posts: 556
Location: Los Angeles, CA
Reputation: 50.7
votes: 1

PostPosted: Mon Mar 21, 2005 6:43 pm    Post subject: Reply with quote

QUOTE(Cer @ Mar 21 2005, 04:57 AM)
A good reason that the bot would crash is because of this:

Quote:
select(undef, undef, undef, 15);;


That would get you what's called a "syntax error"

[right][snapback]47104[/snapback][/right]


Cer, did you even try that code or are you just trying to prove your sig right Razz

select RBITS,WBITS,EBITS,TIMEOUT

there is nothing wrong with select(undef, undef, undef, 15);;

its used alot of times to "sleep" for less than one second and if your saying the extra ; you can have as many of those as you want it makes no diffrence

This is what we call "Correct syntax" if you would test things that you think are errors like you're SUPPOSED to--....

Code:
<br />C:\>perl -c -e select(undef,undef,undef,15);;<br />-e syntax OK<br />

_________________
[ matt ]
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group