I've a litle script that logs the bot in with the KreyNet chanserv, but I'd like a script that, when the bot looses its ops there it asks /msg chanserv op $channelname ,
Bind to "mode". Then check if [string equal $mode "-o"] and [string equal -nocase $target $botnick] and ![string equal -nocase $nick $botnick] and ![isop $botnick $chan]. If all match then go ahead and putserv "PRIVMSG ChanServ :OP $chan". That should be about it.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Bind to "mode". Then check if [string equal $mode "-o"] and [string equal -nocase $target $botnick] and ![string equal -nocase $nick $botnick] and ![isop $botnick $chan]. If all match then go ahead and putserv "PRIVMSG ChanServ :OP $chan". That should be about it.
that's exactly Papillon's version, with unnecessary additional checks
well I used the first one , but what happens is that my bot is deopped on one channel befor i rehashed, then I've deopped it myself on a channel i'm operator on and it seems to work if it actually detects a mode change..
anyway when it would script, the first part of the K script would log it in and op it automaticly because chanserv does that on login and on join,
the problem now is, it doesn't seem to be aware that it's deopped.... its just aware when you deop it ....
how can I solve that ? (thanks for the help already)
set regnick "chanservnickofbot"
set password "chanservpassforbot"
set init-server {putserv "PRIVMSG K :LOGIN $regnick $password"}
#---- keep ops section received from egghelp.org forum ------
bind mode - "* -o" check:mode
proc check:mode {n ho ha ch mc who} {
if {[string equal -nocase $::botnick $who]} { putserv "PRIVMSG K :op $ch" }
}
so the situation:
lets say the bot has an @ on #a and not on #b. when I get to channel #a , and test this script, the bot will automaticly regain ops set by the script. but the bot was on channel #b and already deopped when I put the code in the sepparate chanserv tcl file that I have set for it to load.
Now, the bot doesn't seem to know that it is deopped on channel #b.... thus, the script doesn't make it awware that it is "deopped" only when you actively deop it when it has ops.. Hope i make myself clearer now
#Set channels to check ops on
set opchans "#chan1 #chan2 #chan3"
#Set the time in minutes to check if the bot is opped on each channel
set opchecktime "5"
timer $opchecktime check:ops
proc check:ops { } {
global opchecktime opchans
foreach c $opchans {
if {![botisop $c]} {
putquick "PRIVMSG K :OP $c" -next
}
}
timer $opchecktime check:ops
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================
hmm, do you mean that need ops "always" continues to send requests to services ? also if it has ops ? (normally I would see that because whenever you ask ops you actually see the serice op the bot even if it is having an op)...