Code: Select all
bind NICK - * offnick
proc offnick {nick uhost hand text} {
if {$botnick == botoff } {
putserv "PRIVMSG $chan I'm off"
}
}
Code: Select all
bind nick -|- "*" offnick
proc offnick {nick uhost handle channel newnick} {
global botnick
if {[$newnick == $botnick] && [$botnick == botoff]} {
set chan [string tolower $channel]
putserv "PRIVMSG $chan :I'm off"
}
return 0
}
remove the []s here.Dedan wrote:Code: Select all
if {[$newnick == $botnick] && [$botnick == botoff]} {
Code: Select all
bind nick -|- "*" offnick
proc offnick {nick uhost handle channel newnick} {
global botnick
if {![$newnick == $botnick]} {return 0}
if {[$botnick == botoff]} {
set chan [string tolower $channel]
putserv "PRIVMSG $chan :I'm off"
}
return 0
}
Code: Select all
if {[string equal $newnick $botnick] || [string equal $botnick "botoff"]} {
Code: Select all
bind nick -|- "*" BOTNEW
proc BOTNEW {nick uhost handle newnick} {
global botnick offnick
if {$botnick == $newnick && $botnick == $offnick} {
putserv "PRIVMSG &owner :ITS NOT WORKING :("
}
return 0
}
"if {[string equal $newnick $offnick]} "better if its just if {[string equal $newnick $offnick]} {
instead or even if {$newnick == $offnick} { would be fine too.
Code: Select all
bind nick -|- "*" offnick
proc offnick {nick uhost handle channel newnick} {
global botnick
if {![$newnick == $botnick]} {return 0}
if {[$botnick == botoff]} {
set chan [string tolower $channel]
putserv "PRIVMSG $chan :I'm off"
}
return 0
}
that means $offnick is set in hist script.mimic wrote:[snip]
peace
PS: $offnick is a var i intend to use in this code
Code: Select all
##set the bot's off nick
set offnick "botoff"
bind nick - * off:nick
proc off:nick {nick uhost handle channel newnick} {
global botnick offnick
if {[string match -nocase $newnick $botnick] || [string match -nocase $botnick $offnick]} {
foreach chan [channels] {
putserv "PRIVMSG $chan :I'm off"
}
}
}