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.

Putting a halt!

Help for those learning Tcl or writing their own scripts.
Post Reply
k
krouser
Voice
Posts: 4
Joined: Wed May 08, 2013 6:46 am

Putting a halt!

Post by krouser »

Code: Select all


set chan1 "#foo"
set chan2 "#zoo"
 
bind pub -|- !op op
bind pubm - *!op* repeat_pubm

 
proc op {nick host hand chan text} {
        set ochan [lindex $text 0]
        set cause [lrange $text 1 end]
        set first_char [string index $rchan 0]
        set key [join [lrange [split $text] 1 end]]
if { $chan == #foo } {
if { $first_char != "#"} {
		putserv "privmsg $chan1 : Sorry this is not valid. You can ONLY be opped in (#)channels."
        } elseif { $key == ""} { putserv "privmsg $::chan1 : You must give the key for op." } else {
          putserv "privmsg $::chan2 : Result ---> $nick ($host) is requesting to be opped in $ochan"
		  putserv "privmsg $::chan2 : Cause ---> : $Cause" 
		  putserv "privmsg $::chan1 Hello $nick : You have been opped successfully.
}}}}
Is it possible to somehow not trigger the 'proc op' for 10 seconds if the command !op is used 3 times within 5 seconds? I am not really good with timers. :(
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

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

Post by caesar »

It should, but the proc is so sloppy written that I don't see how it works. :roll:

For instance, the rchan variable isn't defined anywhere. :P
Once the game is over, the king and the pawn go back in the same box.
k
krouser
Voice
Posts: 4
Joined: Wed May 08, 2013 6:46 am

Post by krouser »

oops my bad i think it should be $ochan.. hehe :D ..and willyw il see if it works!
Post Reply