rendered paste bodysetudef str topic1
setudef str topic2
bind pub m|m !nextstatus verif:topic
proc verif:topic {nick uhost hand chan arg} {
set do [lindex [split $arg] 0]
set go [lindex [split $arg] 1]
set in [lrange [split $arg] 2 end]
switch -exact -- $do {
set {
switch -exact -- $go {
on {channel set $chan topic1 $in; putserv "topic $chan :[channel get $chan topic1]; putserv "privmsg $chan :\00310$chan\0033 \037nextstatus [lindex [split $arg] 1]\037 \0032setat ca:\003 $in"}
off {channel set $chan topic2 $in; putserv "topic $chan :[channel get $chan topic2]"; putserv "privmsg $chan :\00310$chan\0034 \037nextstatus [lindex [split $arg] 1]\037 \0032setat ca:\003 $in"}
default {putserv "privmsg $chan :$nick usage: !nextstatus <set|reset|on|off> <on|off> \[\$text\]"}
}
}
reset {
switch -exact -- $go {
on {channel set $chan topic1 ""; putserv "privmsg $chan :\0032-=\00312\037\[\037\0034 $nick \00312\037\]\037\0032=- am resetat topicul \037\0033[lindex [split $arg] 1]"}
off {channel set $chan topic2 ""; putserv "privmsg $chan :\0032-=\00312\037\[\037\0034 $nick \00312\037\]\037\0032=- am resetat topicul \037\0034[lindex [split $arg] 1]"}
default {putserv "privmsg $chan :$nick usage: !nextstatus <set|reset|on|off> <on|off> \[\$text\]"}
}
}
on {
if {[llength [set topic [channel get $chan topic1]]]} {putserv "topic $chan :$topic"; putserv "privmsg $chan :\0033NEXT STATUS\003 is now \0033[lindex $arg 0]\003! \0032Setting channel topic ..."} {putserv "privmsg $chan :\00312\037$nick\037\0034 nextstatus [lindex $arg 0]\0032 nu e setat"}
}
off {
if {[llength [set topic [channel get $chan topic2]]]} {putserv "topic $chan :$topic"; putserv "privmsg $chan :\0033NEXT STATUS\003 is now \0034[lindex $arg 0]\003! \0032Setting channel topic ..."} {putserv "privmsg $chan :\00312\037$nick\037 \0034nextstatus [lindex $arg 0]\0032 nu e setat"}
}
default {putserv "privmsg $chan :$nick usage: !nextstatus <set|reset|on|off> <on|off> \[\$text\]"}
-version {putserv "privmsg $chan :facut de"}
}
}