TCL scripts doesn't support only "notice".detonated wrote:notice $nick "I'm not on that channel."
Code: Select all
puthelp "NOTICE $nick :MESSAGE"
Code: Select all
bind pub o|o !act pub:act
proc pub:act {nick host hand chan arg} {
global botnick
if {![auth:check $hand]} {
return 0
}
if {[llength $arg] < 2} {
notice $nick "Usage: !act <chan> <what>"
return 0
}
set thechan "[lindex $arg 0]"
set what "[lrange $arg 1 end]"
if {![onchan $botnick $thechan]} {
puthelp "NOTICE $nick :I'm not on that channel."
return 0
}
puthelp "PRIVMSG $thechan :\001ACTION\001 $what"
puthelp "NOTICE $nick :Act to $thechan: $what"
putcmdlog "<<$nick>> !$hand! ($thechan) !act $what"
}
Code: Select all
bind pub o|o !act pub:act
proc pub:act {nick host hand chan arg} {
global botnick
if {![auth:check $hand]} {
puthelp "NOTICE $nick :You aren't authorized."
return 0
}
if {[llength $arg] < 2} {
notice $nick "Usage: !act <chan> <what>"
return 0
}
set thechan "[lindex $arg 0]"
set what "[lrange $arg 1 end]"
if {![onchan $botnick $thechan]} {
puthelp "NOTICE $nick :I'm not on that channel."
return 0
}
puthelp "PRIVMSG $thechan :\001ACTION\001 $what"
puthelp "NOTICE $nick :Act to $thechan: $what"
putcmdlog "<<$nick>> !$hand! ($thechan) !act $what"
}
Code: Select all
bind pub n !disable pub:disable
bind pub n !enable pub:enable
bind msg - auth auth:auth
bind sign - * auth:signcheck
bind msg - deauth auth:deauth
bind pub o|o !act pub:act
proc pub:act {nick host hand chan arg} {
global botnick
if {![auth:check $nick]} {
return 0
}
if {[llength $arg] < 2} {
notice $nick "Usage: !act <chan> <what>"
return 0
}
set thechan "[lindex $arg 1]"
set what "[lrange $arg 2 end]"
if {![botonchan $thechan]} {
puthelp "NOTICE $nick :I'm not on that channel."
return 0
}
puthelp "PRIVMSG $thechan :\001ACTION\001 $what"
puthelp "NOTICE $nick :Act to $thechan: $what"
putcmdlog "<<$nick>> !$hand! ($thechan) !act $what"
}
# Usage: /msg $botnick auth <password>
proc auth:auth {nick uhost hand arg} {
global botnick
set found 0
foreach n [channels] {
if {[onchan $nick $n]} {
set found 1
}
}
if {$found == 0} {
return 0
}
if {[llength $arg] < 1} {
putserv "notice $nick :Usage: /msg $botnick auth <pass>"
return 0
}
set pass "[lindex $arg 1]"
if {$hand == "*"} {
putserv "privmsg $nick :You are not permitted to use my commands."
return 0
}
if {[getuser $nick XTRA AUTH] == "DEAD"} {
putserv "privmsg $nick :Sorry, but you have been disabled from using my commands."
return 0
}
if {[passwdok $nick $pass]} {
setuser $nick XTRA "AUTH" "1"
putcmdlog "<<$nick>> ($uhost) !$hand! AUTH ..."
putserv "notice $nick :Password accepted."
return 0
} else {
putserv "notice $nick :Password denied."
}
}
proc auth:signcheck {nick uhost hand chan reason} {
if {$hand == "*"} {
return 0
}
set auth "[getuser $nick XTRA "AUTH"]"
if {($auth == "") || ($auth == "0") || ($auth == "DEAD")} {
return 0
}
setuser $hand XTRA "AUTH" "0"
putlog "Auth for $nick has been expired."
}
proc auth:check {nick} {
set auth "[getuser $nick XTRA "AUTH"]"
if {($auth == "") || ($auth == "0") || ($auth == "DEAD")} {
return 0
} else {
return 1
}
}
proc auth:deauth {nick uhost hand arg} {
if {[getuser $nick XTRA AUTH] == "DEAD"} {
putserv "privmsg $nick :Sorry, but you have been disabled from using my commands."
return 0
}
if {$hand != "*"} {
setuser $nick XTRA "AUTH" "0"
putlog "<<$nick>> ($uhost) !$hand! DEAUTH"
putserv "notice $nick :Authentication has been removed."
}
}
Code: Select all
if {[passwdok $nick $pass]} {
Code: Select all
if {[passwdok $hand $pass]} {
Code: Select all
if {[passwdok $nick $pass]} {
setuser $nick XTRA "AUTH" "1"
Code: Select all
if {$hand != "*"} {
setuser $nick XTRA "AUTH" "0"
putlog "<<$nick>> ($uhost) !$hand! DEAUTH"