Code: Select all
set services "1"
unbind dcc o|o msg *dcc:msg
bind dcc o|o msg csdostup
bind dcc n putserv putsrv
bind msg - ident identche
proc csdostup {hand idx arg} {
global services
set tonick [string tolower [lindex $arg 0]]
set mschan [string tolower [lindex $arg 2]]
set text [lrange $arg 1 end]
if {[matchattr $hand n|n $mschan]} {
putlog "PRIVMSG from $hand to $tonick :$text"
putserv "PRIVMSG $tonick :$text "
putdcc $idx "msg to $tonick: $text"
return 0
}
if {[matchattr $hand m]} {
if {($tonick == "cs") || ($tonick== "ns") } {
putdcc $idx "$hand, trqbva da bydesh moj owner za da ima dostyp"
chattr $hand -afop+dk
setuser $hand comment "Opital se da prati syobshtenie na $tonick s text: $text"
putlog "$hand se opita da prati syobshtenie kym $tonick s text: $text"
boot $hand "Opitva se da prati syobshtenie na $tonick s text: $text"
putlog "$hand e mahnat ot bota"
newban $hand!*@* $::botnick "Opitva se da prati syobshtenie na $tonick s text: $text"
putlog "Dobawen e ban na $hand poradi ne spazvane na pravilata"
dcc_flagnote $botnick 666 "$idx +n pedal"
putlog "Izprashtat se notes do owners...."
} else {
putlog "PRIVMSG from $hand to $tonick :$text"
putserv "PRIVMSG $tonick :$text "
putdcc $idx "msg to $tonick: $text"
}
return 0
}
putdcc $idx "$hand, trqbva da bydesh moj owner ili master za da imash dostyp"
chattr $hand -afop+dk
setuser $hand comment "Opital se da prati syobshtenie na $tonick s text: $text"
putlog "$hand se opita da prati syobshtenie kym $tonick s text: $text"
boot $hand "Opitva se da prati syobshtenie na $tonick s text: $text"
putlog "$hand e mahnat ot bota"
newban $hand!*@* $::botnick "Opitva se da prati syobshtenie na $tonick s text: $text"
putlog "Dobawen e ban na $hand poradi ne spazvane na pravilata"
dcc_flagnote $::botnick 666 "$idx +n pedal"
putlog "Izprashtat se notes do owners...."
}
Only master and owners can use .msg cs/ns <text>
If someone else do this they will be: there flags will be changed to +dk
they will be booted from the partyline and they will be banned and the bot have to send a note to all the owners
the only thing that don't works is the sendnote
here is the error that appears:
Code: Select all
Tcl error [csdostup]: invalid idx