I don't know how could I make a system in the DCC Chat: .csauth off which will disable the TCL .csauth on which will enable it
could you help me with this please ? Thanks a lot guys
### What is the name of the bot to identify to on join?
set bot(name) "X"
### Set the user of the Eggdrop that will use for CSAUTH
set bot(user) "Robot"
### Set the password of the Eggdrop that will use for CSAUTH
set bot(pass) "absdefg"
#####################################################################
bind join * * x:xlogin
proc x:xlogin {nick uhost handle channel} {
global bot botnick
if {$nick == $bot(name) || $nick == $botnick } {
putserv "PRIVMSG $bot(name) :CSAUTH $bot(user) $bot(pass)"
}
}
### What is the name of the bot to identify to on join?
set bot(name) "X"
### Set the user of the Eggdrop that will use for CSAUTH
set bot(user) "Robot"
### Set the password of the Eggdrop that will use for CSAUTH
set bot(pass) "absdefg"
### Set this to 1 if you want the script enabled by default, otherwise 0
set bot(enable) 1
#####################################################################
bind join * * x:xlogin
proc x:xlogin {nick uhost handle channel} {
global bot botnick
if {(($nick == $bot(name)) || ($nick == $botnick)) && $bot(enable) == "1" } {
putserv "PRIVMSG $bot(name) :CSAUTH $bot(user) $bot(pass)"
}
}
bind dcc - csauth c:csauth
proc x:csauth {hand idx arg} {
global bot
switch -exact -- [string tolower $arg] {
{on} {
set bot(enable) 1
putdcc $idx "Enabled CSAUTH"
}
{off} {
set bot(enable) 0
putdcc $idx "Diabled CSAUTH"
}
deault {
switch -- $bot(enabled) {
{1} {
putdcc $idx "CSAUTH is currently enabled"
}
default {
putdcc $idx "CSAUTH is currently disabled"
}
}
}
}
}
### What is the name of the bot to identify to on join?
set bot(name) "X"
### Set the user of the Eggdrop that will use for CSAUTH
set bot(user) "Robot"
### Set the password of the Eggdrop that will use for CSAUTH
set bot(pass) "absdefg"
### Set this to 1 if you want the script enabled by default, otherwise 0
set bot(enable) 1
#####################################################################
bind join * * x:xlogin
proc x:xlogin {nick uhost handle channel} {
global bot botnick
if {(($nick == $bot(name)) || ($nick == $botnick)) && $bot(enable) == "1" } {
putserv "PRIVMSG $bot(name) :CSAUTH $bot(user) $bot(pass)"
}
}
bind dcc - csauth c:csauth
proc c:csauth {hand idx arg} {
global bot
switch -exact -- [string tolower $arg] {
{on} {
set bot(enable) 1
putdcc $idx "Enabled CSAUTH"
}
{off} {
set bot(enable) 0
putdcc $idx "Diabled CSAUTH"
}
deault {
switch -- $bot(enabled) {
{1} {
putdcc $idx "CSAUTH is currently enabled"
}
default {
putdcc $idx "CSAUTH is currently disabled"
}
}
}
}
}
This TCL sends /msg X CSAUTH FreeBSD absdefg and it works very well thanks to ppslim and caesar.
I have another bot which name is Y and I would like that Robot sends an CSAUTH to Y this TCL would be named csauth2.tcl
I tried to copy and past but I think the variables are the same so I don't know what can I change, if anybody could help me.
### What is the name of the bot to identify to on join?
set bot(name) "X Y"
### Set the user of the Eggdrop that will use for CSAUTH
set bot(user) "Robot"
### Set the password of the Eggdrop that will use for CSAUTH
set bot(pass) "absdefg"
### Set this to 1 if you want the script enabled by default, otherwise 0
set bot(enable) 1
bind join * * x:xlogin
proc x:xlogin {nick uhost handle channel} {
global bot botnick
if {[lsearch -exact $bot(name) $nick] != -1 || ($nick == $botnick) && $bot(enable) == "1" } {
foreach luser $bot(name) {
putserv "PRIVMSG $luser :CSAUTH $bot(user) $bot(pass)"
}
}
}
Once the game is over, the king and the pawn go back in the same box.
### What is the name of the bot to identify to on join?
set bot(name) "X"
### What is the name of the bot you want to do the channel login?
set bot(chan) "Y"
### Set the user of the Eggdrop that will use for CSAUTH
set bot(user) "Robot"
### Set the password of the Eggdrop that will use for CSAUTH
set bot(pass) "absdefg"
### Set this to 1 if you want the script enabled by default, otherwise 0
set bot(enable) 1
# stuff
setudef flag auth
bind join * * x:csauth
bind dcc - csauth dcc:csauth
# stuff
setudef flag auth
bind join * * x:csauth
bind dcc - csauth dcc:csauth
proc x:csauth {nick uhost handle channel} {
global bot botnick
if {$nick == $botnick && $bot(enable) == "1" } {
foreach luser $bot(name) {
putserv "PRIVMSG $luser :CSAUTH $bot(user) $bot(pass)"
}
foreach chan [channels] {
if {[channel get $chan auth]} {
putserv "PRIVMSG $bot(chan) :AUTH $chan $bot(user) $bot(pass)"
}
}
}
}
For the channels you want it to login to Y do an .chanset #channel +auth. By default it is disabled foreach channels, you must enable it in order to work.
Once the game is over, the king and the pawn go back in the same box.
### What is the name of the bot to identify to on join?
set bot(name) "X"
### What is the name of the bot you want to do the channel login?
set bot(chan) "Y"
### Set the user of the Eggdrop that will use for CSAUTH
set bot(user) "Robot"
### Set the password of the Eggdrop that will use for CSAUTH
set bot(pass) "absdefg"
### Set this to 1 if you want the script enabled by default, otherwise 0
set bot(enable) 1
# stuff
setudef flag auth
bind join * * x:csauth
bind dcc - csauth dcc:csauth
# stuff
setudef flag auth
bind join * * x:csauth
bind dcc - csauth dcc:csauth
proc dcc:csauth {hand idx arg} {
global bot botnick
if {$nick == $botnick && $bot(enable) == "1" } {
foreach luser $bot(name) {
putserv "PRIVMSG $luser :CSAUTH $bot(user) $bot(pass)"
}
foreach chan [channels] {
if {[channel get $chan auth]} {
putserv "PRIVMSG $bot(chan) :AUTH $chan $bot(user) $bot(pass)"
}
}
}
}
.csauth onTcl error [dcc:csauth]: can't read "nick": no such variable .csauth offTcl error [dcc:csauth]: can't read "nick": no such variable