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.

Timer 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

Timer script

Post by Leon-- »

Hi,

i have a script below:

Code: Select all

proc pub:power {nick host hand chan arg} {
  global botnick opchan
  set onoff [lindex $arg 0]
  if {$onoff == "on"} {
     chattr $hand +P
     putserv "PRIVMSG $opchan :\002POWER:\002 on"
     putserv "NOTICE $nick :\002POWER:\002 on"
     timer 1 poweroff
     return 0
  }
  if {$onoff == "off"} {
     chattr $hand -P
     putserv "PRIVMSG $opchan :\002POWER:\002 off"
     putserv "NOTICE $nick :\002POWER:\002 off"
     return 0
  } 
}
Now my question. I can't figure out how i set a timer, can some one help me with it ?
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Re: Timer script

Post by simo »

it helps to post entire script instead of a part of it, also its not clear what you mean by "how to set timer" as the code already contains a timer
L
Leon--
Voice
Posts: 14
Joined: Sat Sep 02, 2023 8:35 am

Re: Timer script

Post by Leon-- »

This is the script i mean the timer must be proc poweroff {} {
and i have no idea how i can make it
s
simo
Revered One
Posts: 1108
Joined: Sun Mar 22, 2015 2:41 pm

Re: Timer script

Post by simo »

let me start with asking : What do u expect it to do ?
L
Leon--
Voice
Posts: 14
Joined: Sat Sep 02, 2023 8:35 am

Re: Timer script

Post by Leon-- »

That the bot change +P in -P automaticlly, with the timer script.
L
Leon--
Voice
Posts: 14
Joined: Sat Sep 02, 2023 8:35 am

Re: Timer script

Post by Leon-- »

I don't need it any more, i hvae a script what works fine
Post Reply