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.
Help for those learning Tcl or writing their own scripts.
-
Leon--
- Voice
- Posts: 14
- Joined: Sat Sep 02, 2023 8:35 am
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 ?
-
simo
- Revered One
- Posts: 1108
- Joined: Sun Mar 22, 2015 2:41 pm
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
-
Leon--
- Voice
- Posts: 14
- Joined: Sat Sep 02, 2023 8:35 am
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
-
simo
- Revered One
- Posts: 1108
- Joined: Sun Mar 22, 2015 2:41 pm
Post
by simo »
let me start with asking : What do u expect it to do ?
-
Leon--
- Voice
- Posts: 14
- Joined: Sat Sep 02, 2023 8:35 am
Post
by Leon-- »
That the bot change +P in -P automaticlly, with the timer script.
-
Leon--
- Voice
- Posts: 14
- Joined: Sat Sep 02, 2023 8:35 am
Post
by Leon-- »
I don't need it any more, i hvae a script what works fine