 |
|
 |
|
MeBoy Comandant

Joined: 15 Aug 2007 Posts: 13
|
|
 |
|
 |
|
Posted: 15/08/2007 15:20 Post subject: Next.tcl |
|
|
| Code: | bind msg n .next next:status
proc next:status {nick uhost hand text} {
set chan [lindex [split $text] 0]
if {$chan == ""} {
putserv "PRIVMSG $nick :Type \".next #channel\" for it's current status on the #channel or \".next #channel on/off\" to change it enable or disable it."
return
}
if {![validchan $chan]} {
putserv "PRIVMSG $nick :Sorry, $chan isn't a valid channel. Pick a valid one."
return
}
set cmd [lindex [split $text] 1]
set status [channel get $chan next]
switch -- [string tolower $cmd] {
"on" {
if {$status} {
putserv "PRIVMSG $nick :Next script is \002ALLREADY\002 enabled on $chan. Don't do that again!"
return
}
channel set $chan +next
putserv "PRIVMSG $nick :Next script is now \002enabled\002 on $chan."
}
"off" {
if !{$status} {
putserv "PRIVMSG $nick :Next script is \002ALLREADY\002 disabled on $chan. Don't do that again!"
return
}
channel set $chan -next
putserv "PRIVMSG $nick :Next script is now \002disabled\002 on $chan."
}
default {
if {$status} {
set status "enabled"
} else {
set status "disabled"
}
putserv "PRIVMSG $nick :Current status of the .next script on $chan is: \002$status\002"
}
}
} |
|
|