Code: Select all
# Simple OP commands ... like op, voice, kick, ban ... but, it uses his access to Undernet X to op , deop, etc ...
# Author : CBernetic
# De modificat
set access "Accesul la X"
set durataban "durata in ore"
# Nu modifica mai jos (doar daca stii tcl)
bind pub o .h pub:h
bind pub o .op pub:op
bind pub o .vo pub:voice
bind pub o .k pub:kick
bind pub o .b pub:ban
bind pub o .ub pub:unban
bind pub - .reguli pub:reguli
bind notc - * notice
proc pub:h {nick uhost hand chan text} {
puthelp "NOTICE $nick :Comenzi disponibile :"
puthelp "NOTICE $nick :-"
puthelp "NOTICE $nick :.op | Se foloseste si pentru deop :: Ex. : .op $me"
puthelp "NOTICE $nick :.vo | Se foloseste si pentru devoice :: Ex. : .vo $me"
puthelp "NOTICE $nick :.k | Ex. : .k Lamer out"
puthelp "NOTICE $nick :.b | Ex. : .b Lamer out"
puthelp "NOTICE $nick :.reguli | Comanda poate fi executata si de useri obisnuiti!
puthelp "NOTICE $nick :.ub | Ex. : .ub *!*@Lamer.users.undernet.org"
puthelp "NOTICE $nick :-"
puthelp "NOTICE $nick :OPTools (c) 2005"
}
proc pub:op {nick uhost hand chan text} {
if {[string lenght $text] > 0} {
set tnick [lindex $text 0]
if {[onchan $tnick $chan]} {
if {[isop $tnick $chan]} {
puthelp "PRIVMSG X :deop $chan $tnick"
}
else {
puthelp "PRIVMSG X:op $chan $nick"
}
}
else {
puthelp "NOTICE $nick :$tnick nu se afla pe $chan"
}
}
else {
puthelp "NOTICE $nick :Sintaxa incorecta!"
puthelp "NOTICE $nick :Folositi .op nick"
puthelp "NOTICE $nick :Ex. : .op Lamer"
}
}
}
proc pub:voice {nick uhost hand chan text} {
if {[string lenght $text] > 0} {
set tnick [lindex $text 0]
if {[onchan $tnick $chan]} {
if {[isvoice $tnick $chan]} {
puthelp "PRIVMSG X :devoice $chan $tnick"
}
else {
puthelp "PRIVMSG X :voice $chan $tnick"
}
}
else {
puthelp "NOTICE $nick :$tnick nu se afla pe $chan"
}
}
else {
puthelp "NOTICE $nick :Sintaxa incorecta!"
puthelp "NOTICE $nick :Folositi .vo nick"
puthelp "NOTICE $nick :Ex. : .vo Lamer"
}
}
}
proc pub:kick {nick uhost hand chan text} {
if ([string lenght $text] > 0 {
set tnick [lindex $text 0]
if ([string lenght [lindex $text 1]] == 0} {
puthelp "NOTICE $nick :Nu ati precizat un motiv pentru kick!"
puthelp "NOTICE $nick :Folositi .k nick motiv"
puthelp "NOTICE $nick :Ex. : .k Lamer out"
}
else {
set reason [lrange $text 1 end]
}
if {[onchan $tnick $chan]} {
puthelp "PRIVMSG X :kick $chan $tnick $reason"
}
else {
puthelp "NOTICE $nick :$tnick nu se afla pe $chan"
}
else {
puthelp "NOTICE $nick :Sintaxa incorecta!"
puthelp "NOTICE $nick :Folositi .k nick motiv"
puthelp "NOTICE $nick :Ex. : .k Lamer out"
}
}
}
proc pub:ban {nick uhost hand chan text} {
if {[string lenght $text] > 0} {
set tnick [lindex $text 0]
if {[onchan $tnick $chan]} {
if {[string lenght [lindex $text 1]] == 0} {
puthelp "NOTICE $nick :Nu ati precizat un motiv pentru kick!"
puthelp "NOTICE $nick :Folositi .b nick motiv"
puthelp "NOTICE $nick :Ex. : .b Lamer out"
}
else {
set reason [lrange $text 1 end]
}
if {[onchan $tnick $chan]} {
set maska *!*@[lindex [split [getchanhost $tnick $chan] "@"] 1]
puthelp "PRIVMSG X :ban $chan $maska $durataban $access $reason
}
else {
puthelp "NOTICE $nick :$tnick nu se afla pe $chan"
}
}
else {
puthelp "NOTICE $nick :Sintaxa incorecta!"
puthelp "NOTICE $nick :Folositi .b nick motiv"
puthelp "NOTICE $nick :Ex. : .b Lamer out"
}
}
}
proc pub:unban {nick uhost hand chan text} {
if {[string lenght $text] > 0} {
set maska [lindex $text 0]
puthelp "PRIVMSG X:unban $chan $maska"
}
else {
puthelp "NOTICE $nick :Sintaxa incorecta!"
puthelp "NOTICE $nick :Folositi .ub maska"
puthelp "NOTICE $nick :Ex. : .ub *!*@Lamer.users.undernet.org"
}
}
}
proc pub:reguli {nick chan text} {
puthelp "NOTICE $nick :O lista a regulilor canalului $chan o puteti gasi pe adresa :"
puthelp "NOTICE $nick :http://www.irc-iasi.com/inv/index.php?showtopic=14"
}
proc notice { from keyword text nick text} {
if { $from == "X!cservice@undernet.org" } {
set noticetext
puthelp "NOTICE $nick $nick $noticetext"
}
else {
return 0
}
}
putlog "OPTools loaded ... (c) 2005 CBernetic"
so i use the script:
Code: Select all
set error ""
foreach script {
OPTools.tcl
} {
catch {source scripts/$script} error
if {$error != ""} {putcmdlog "\002SCRIPT ERROR\002:$script\: $::errorInfo"}
}
Code: Select all
<(ScanSpam> [23:52] Tcl error [notice]: invalid command name "notice"
Code: Select all
<Nor7on> .set errorInfo
<(ScanSpam> Currently: invalid command name "notice"
<(ScanSpam> Currently: while executing
<(ScanSpam> Currently: "notice $_notc1 $_notc2 $_notc3 $_notc4 $_notc5"