Code: Select all
set jaDu "!"
set jaDuSign "jaDuX"
bind pub o|o ${jaDu}kick pub_kick
bind msg o|o kick msg_kick
bind pub o|o ${jaDu}k pub_kick
bind msg o|o k msg_kick
#End
if {[info exist ban-time]} {
# Checking whenever the "ban-time" variable is exist on your bot conf file. (Default)
set gbantime ${ban-time}
} else {
set gbantime 15
}
#Kick Process#
proc msg_kick {nick uhost hand rest} {
global botnick jaDuSign
if {![matchattr $hand p]} {putquick "NOTICE $nick :$jaDuSign You have +o privelage but you don't have +p, you need +p flag to set your password and authenticate before phrasing commands. Ask my owner/master to set that flag for you =)" ; return 0}
set chan [lindex $rest 0] ; set knick [lrange $rest 1 end]
if {$chan == "#" || $chan == ""} {putquick "NOTICE $nick :$jaDuSign Command: /msg $botnick kick <#channel> <nickname(s)> \[!reason\]" ; return 0}
if {![string match "#*" $chan]} {set chan "#$chan"}
if {$knick == ""} {putquick "NOTICE $nick :$jaDuSign Command: /msg $botnick kick $chan <nickname(s)> \[!reason\]" ; return 0}
if {![validchan $chan]} {putquick "NOTICE $nick :$jaDuSign I am not on channel: $chan, check out my channel list." ; return 0}
if {![botisop $chan]} {putquick "NOTICE $nick :$jaDuSign I appologize, but I am not an Operator on channel: $chan. Your command cannot be perform." ; return 0}
set knicks "" ; set ownicks "" ; set nonenicks "" ; set reason ""
foreach x $knick {
if {(![onchansplit $x $chan]) && (![isbotnick $x])} {
if {[string match "!*" $x]} { set cut [string range $rest [expr [string first ! $rest] +1] end] ; set reason "$cut $jaDuSign "} else {if {[matchattr [nick2hand $x $chan] m]} {append ownicks " $x"} else {if {![onchan $x $chan]} {append nonenicks " $x"} else {append knicks "$x,"}}}
}
}
if {$nonenicks != ""} {putquick "NOTICE $nick :$jaDuSign $nonenicks is not on channel: $chan."}
if {$ownicks != ""} {putquick "NOTICE $nick :$jaDuSign $ownicks are my \[Master(s)\], and will I will not Kick them from channel: $chan."}
if {$knicks != ""} {
if {$reason == ""} {set reason "You Are Not Welcome $jaDuSign"} ; putkick $chan $knicks $reason
putcmdlog "$jaDuSign <<$nick>> !$hand! Kick: ${knicks} from channel: $chan. Reason: $reason."
} ; return 0
}
proc pub_kick {nick uhost hand chan rest} {
global jaDu botnick jaDuSign
set chans "" ; set channel [lindex $rest 0]
if {![string match "#*" $channel]} {set channel $chan ; append chans "$channel $rest "} else {append chans " $rest"}
set knicks [lindex $chans 1]
if {$knicks == ""} {putquick "NOTICE $nick :$jaDuSign Command: ${jaDu}kick $chan <nickname(s)> \[!reason\]" ; return 0}
msg_kick $nick $uhost $hand $chans
}
############EnD KicK##############
I'm stiLL stuck in this Script ...
Default trigger for kick is ... !kick Nick !Reason
nd
!Kick Nick1 Nick2 Nick3 !Reason
I need help with this code. It works well with the default kick reason, but when given a reason, the word with ! sign is chosen as reason and rest words are considers as nick instead of picking the whole sentence as reason after ! sign.
Code: Select all
if {[string match "!*" $x]} { set cut [string range $rest [expr [string first ! $rest] +1] end] ; set reason "$cut $jaDuSign "} else {if {[matchattr [nick2hand $x $chan] m]} {append ownicks " $x"} else {if {![onchan $x $chan]} {append nonenicks " $x"} else {append knicks "$x,"}}}
problem is in these above lines