I'm posting here beaucause I don't know how to get out of this problem, maybe some of you should help me, I think so.
What this script is supposed to do ? It's simple :
When Y or Z JOINs the channel the BOT will send him an AUTH, and when the BOT itself JOINs then channel it will send a send to Y or Z.
The problem is that the bot sends only :
when Y joins... the three other possibilities (send to X, send to Y when BOT join, send to W when BOT join) don't work... I hope you'll help me, thanks !!!CSAUTH me Zarifa pass1
Code: Select all
### What is the name of the bot to identify to on join (CSAUTH)?
set bot(csauthbot) "Me"
### What is the name of the bot you want to do the channel identify (AUTH)?
set bot(authbot) "Me"
### Set the username / password of the Eggdrop that will use for CSAUTH
set bot(csauthuserpass) "Zarifa pass1"
### Set the username / password of the Eggdrop that will use for AUTH
set bot(authuserpass) "Zarifa pass2"
### Set this to 1 if you want the script enabled by default, otherwise 0
set bot(enable) 1
# stuff
setudef flag auth
bind join - * join:csauth
#bind dcc - csauth x:csauth
bind dcc - auth x:csauth:on_off
proc join:csauth {nick uhost handle chan} {
global bot
if {![isbotnick $nick] || $bot(enable) != "1" } {return 0}
putserv "PRIVMSG $bot(csauthbot) :CSAUTH $bot(authbot) $bot(csauthuserpass)"
# foreach chan [channels] {
if {[channel get $chan auth]} {
putserv "PRIVMSG $bot(authbot) :AUTH $chan $bot(authbot) $bot(authuserpass)"
}
# }
return 0
}
proc x:csauth:on_off {hand idx arg} {
global bot
switch -- [lindex [split $arg] 0] {
"on" { set bot(enable) 1; putdcc $idx "Authing turned on" }
"off" { set bot(enable) 0; putdcc $idx "Authing turned off" }
}
}
# suite tant attendue
proc join:do_auth {nick uhost hand chan} {
global bot
switch -- [string tolower $nick] {
[string tolower $bot(csauthbot)] {
putserv "PRIVMSG $bot(csauthbot) :CSAUTH $bot(csauthuserpass)"
}
[string tolower $bot(authbot)] {
if {[channel get $chan auth]} {
putserv "PRIVMSG $bot(authbot) :AUTH $chan $bot(authuserpass)"
}
}
}
return 0
}
bind join - * join:do_auth