This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

bind time script

Help for those learning Tcl or writing their own scripts.
Post Reply
L
Leon--
Voice
Posts: 14
Joined: Sat Sep 02, 2023 8:35 am

bind time script

Post by Leon-- »

Hi,

I have a script but it won't work, what is the solution for this ?

bind time - "43 12 4 * *" msg:videoland1

proc msg:videoland1 {nick host hand chan arg} {
global botnick opchan videoland trigger statschan
if {$botnick == "$videoland"} {
putserv "PRIVMSG $statschan :${trigger}-videoland 1"
timer 1 videoland2
return 0
}
}
proc videoland2 {} {
global botnick statschan
putserv "PRIVMSG $statschan :.videoland"
}
User avatar
CrazyCat
Revered One
Posts: 1280
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: bind time script

Post by CrazyCat »

Well, first thing to see :
Minute, hour, day, month have a zero padding so they are exactly two characters long; year is four characters. Flags are ignored.
So, try:
bind time - "43 12 04 * *" msg:videoland1
Another thing to see, it's if your proc is called. Check it with:
proc msg:videoland1 {nick host hand chan arg} {
   global botnick opchan videoland trigger statschan
   putlog "OK, we are in msg:videoland1 and will compare $botnick against $videoland"
   if {$botnick == "$videoland"} {
      putserv "PRIVMSG $statschan :${trigger}-videoland 1"
      timer 1 videoland2
      return 0
   }
}
L
Leon--
Voice
Posts: 14
Joined: Sat Sep 02, 2023 8:35 am

Re: bind time script

Post by Leon-- »

Thanks
User avatar
caesar
Mint Rubber
Posts: 3777
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Re: bind time script

Post by caesar »

And use buit-in isbotnick instead of that prone to fail if:

Code: Select all

if {$botnick == "$videoland"} {
to:

Code: Select all

if {[isbotnick $videoland]} {
Once the game is over, the king and the pawn go back in the same box.
Post Reply