Code: Select all
on *:join:#CHAN1:{ mode #CHAN2 +v $nick }
Code: Select all
on *:join:#CHAN1:{ mode #CHAN2 +v $nick }
Code: Select all
bind join - "#chan1 *" voice
proc voice {nick uhost handle chan} {
pushmode "#chan2" +v $nick
}
Code: Select all
proc voice {nick uhost handle chan} {
if {$nick eq $::botnick} { return }
if {![botisop "#chan2"} { return }
if {![onchan $nick "#chan2"} { return }
pushmode "#chan2" +v $nick
}
Code: Select all
bind join - * voice
proc voice {nick uhost hand chan} {
if {[isbotnick $nick] || ![string equal -nocase $chan "#chan2"] || ![botisop $chan]} return
pushmode $chan +v $nick
}
Thanks for having given explanations.caesar wrote:isbotnick - returns 0 or 1 if the nick is the bot itselfCode: Select all
bind join - * voice proc voice {nick uhost hand chan} { if {[isbotnick $nick] || ![string equal -nocase $chan "#chan2"] || ![botisop $chan]} return pushmode $chan +v $nick }
string equal with the -nocase argument compares the channel name with #chan2
botisop - returns 0 or 1 if the bot has channel operator status
pushmode - sends out a channel mode change, it's one of the methods with a slow queue
the ! (exclamation mark) in front of the [function] negates the result, basically turns the IF statement into an IF NOT
Code: Select all
$nick = John (bot's nick is Bot)
$chan = #something
Code: Select all
if {[isbotnick $nick] || ![string equal -nocase $chan "#chan2"] || ![botisop $chan]} return
Code: Select all
if {[isbotnick $nick]} return
if {![string equal -nocase $chan "#chan2"]} return
if {![botisop $chan]} return