hi, i'm using a script for op/invite/unban/clear in a chan but the chan name has special characters and the bot doesn't execute the commands it says invalid command name "rip"...#[rip] is the name of the channel
i read the post about the split command in tcl and i tried it but it doesn't work that way neither.. i'm paste-ing the script here... please help if you know how to solve this problem.
set regnick "Ma3oXuCTka"
set nspass "ku4ka22"
set nsserv "NS!NickServ@UniBG.services"
set csserv "CS!ChanServ@Unibg.services"
set csnick "CS"
set nsnick "NS"
proc deban {arg} {
global botnick regnick
#unbanva se ako e bannat
if {[string match "*[string toupper $botnick]*" [string toupper $regnick]]} {
set c [lindex [split $arg] 0]
putlog "Opit za mahane na ban ot kanala $c prez CS...."
putserv "PRIVMSG CS :UNBAN $c"
putserv "PRIVMSG CS :INVITE $c"
putserv "PRICMSG CS :CLEAR $c ALL"
}
}
# vzimane na op ot CS
proc getop {arg} {
global botnick regnick csnick
if {[string match "*[string toupper $botnick]*" [string toupper $regnick]]} {
set c [lindex [split $arg] 0]
putlog "Opit za vzimane na OP v kanal $c ot CS ...."
putserv "PRIVMSG $csnick :op $c $botnick"
putserv "PRIVMSG $csnick :op all"
}
}
#Ako kanal e invite only da se Invite-va prez CS
proc invite {arg} {
global botnick regnick csnick
if {[string match "*[string toupper $botnick]*" [string toupper $regnick]]} {
set c [lindex [split $arg] 0]
putlog "Opit bota da se invite-ne v kanal $c prez CS ..."
putserv "PRIVMSG $csnick :INVITE $c"
}
}
# Vku4vane i izklu4vane na postoqnni opiti vzimane na op ot CS v kanali kadeto bota e addnat
# .cssup #lame -> vklu4va
# .cssup #lame off -> izklu4va
proc cssup {hand idx arg} {
if {[lindex $arg 1]!="off"} {
channel set [lindex $arg 0] need-op "getop [lindex [split $arg] 0]"
channel set [lindex $arg 0] need-unban "deban [lindex [split $arg] 0]"
channel set [lindex $arg 0] need-invite "invite [lindex [split $arg] 0]"
putlog "Ot tozi moment natatuk se iska op [lindex [split $arg] 0] ot CS"
} {
channel set [lindex [split $arg] 0] need-op ""
channel set [lindex [split $arg] 0] need-unban ""
channel set [lindex [split $arg] 0] need-invite ""
putlog "Iziskvaneto na op v [lindex [split $arg] 0] ot CS e izklu4eno !"
}
}
# identvane kogato trqbwa
proc notice_a {from keyword arg} {
global nsnick csnick nspass nsserv csserv
set servresp [lindex [split $arg] 1]
set msg [lrange [split $arg] 0 end]
if {$from==$nsserv} {
if {[lindex [split $arg] 1]==":This"} {
putserv "PRIVMSG $nsnick :IDENTIFY $nspass"
putlog "$nsnick iska da se IDENTIFY..." }
}
return "$from $keyword $arg"
}
proc n_311 {a b c} {
putlog "$c"
return "$a $b $c"
}
# blidz
unbind dcc o|o msg *dcc:msg
bind dcc n|- msg *dcc:msg
bind dcc n cssup cssup
bind raw - 311 n_311
bind raw - notice notice_a
putlog "Services Support by bonboncho zareden !!"
thanks in advance