I am looking for a code to load in the HUB bot in the botnet and will restart a botnick when triggered like !restart <bot> in the HUB channel?
Is this possible?
thanks
Code: Select all
bind pub o|o !restart pub:restart
set adminchan "#channel"
proc pub:restart { nick uhost hand chan text } {
global adminchan
if { $chan == $addminchan } {
if { $text == "" } {
putquick "PRIVMSG $addminchan :Use: !restart <botnick> (Option: ALL)"
return 0
} else {
putallbots "!restartbot $text"
putquick "PRIVMSG $addminchan :Restarting $text..."
}
}
}
Code: Select all
bind bot -|- !restartbot restartbot
proc restartbot { from command text } {
if { $text == "LEAF1" || $text == "ALL" } {
restart
}
}
Code: Select all
{ $text == "LEAF1" }
or
{ $text eq "LEAF1" }