| View previous topic :: View next topic |
| Author |
Message |
paull Voice
Joined: 01 Dec 2008 Posts: 6
|
Posted: Fri Dec 05, 2008 10:56 am Post subject: botnet !restart <bot> |
|
|
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 |
|
| Back to top |
|
 |
paull Voice
Joined: 01 Dec 2008 Posts: 6
|
Posted: Sun Dec 07, 2008 7:00 am Post subject: |
|
|
Ok, I got it to work, maybe not the right way but it works. I am a noob at coding so if someone else have a better idea, let me know
(HUB bot is in a private channel, so no one else can use this trigger)
In channel with HUB bot: !restart <botnick>
Loaded in HUB bot:
| Code: |
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..."
}
}
}
|
Loaded in LEAF bots:
| Code: |
bind bot -|- !restartbot restartbot
proc restartbot { from command text } {
if { $text == "LEAF1" || $text == "ALL" } {
restart
}
}
|
Btw I dont know when to use:
| Code: |
{ $text == "LEAF1" }
or
{ $text eq "LEAF1" }
|
Maybe someone can tell me the difference?
thanks |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
|
| Back to top |
|
 |
|