Code: Select all
## This channel is required for removing through private of bot if a user
## types /msg botnick unban *!*@host.com he will be unbanned from
## outside and then can join thechannel.
set chan1 "#channel"
set item "!"
bind pub m|E ${item}ban ban
bind pub m|E ${item}unban unban
bind msg m|E ${item}unban unban1
bind pub m|E ${item}voice voice
bind pub m|E ${item}devoice devoice
bind pub m|E ${item}mode mode
bind pub m|E ${item}kick ckick
bind pub m|E ${item}help help
proc ban {nick host hand chan text} {
global botnick
set target [lindex $text 0]
set reason [lrange $text 1 end]
set bhost [getchanhost $target $chan]
set banmask "*!*@[lindex [split $bhost @] 1]"
# set banmask "*!*[string trimleft [string range $bhost [string first "!" $bhost] end] ?^~-_+?]"
if {$target == $nick} {
putserv "NOTICE $nick :Are you crazy? Why do you want to be banned? lamer."
return 0
}
if {[isop $target $chan]} {
putserv "NOTICE $nick : You don`t have permission to ban the Op $target"
return 0
}
if {[isvoice $target $chan]} {
putserv "NOTICE $nick : You don`t have permission to ban the voice $target, use kick or devoice him/her first."
return 0
}
if {[matchattr $nick n|-] == "1"} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $target :$reason"
} elseif {$target != $botnick} {
if {[matchattr $target n|-] == "0"} {
if {[matchattr $nick -|o $chan] == 1} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $target :$reason"
} elseif {[matchattr $target o|o $chan] == 0} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $target :$reason"
} else {
putserv "NOTICE $nick : You don`t have permission to ban the Op $target"
}
} elseif {[matchattr $target n|-] == 1} {
putserv "NOTICE $nick : You don`t have permission to ban the Op $target"
}
} else {
putquick "NOTICE $nick : [censored] you"
}
}
proc unban {nick host hand chan text} {
set target [lindex $text 0]
putserv "MODE $chan -b $target"
killchanban $chan $target
}
proc unban1 {nick uhost hand mwho} {
global chan1
set target [lindex $mwho 0]
putserv "MODE $chan1 -b $target"
killchanban $chan1 $target
putserv "NOTICE $nick : $target has been removed, you may join $chan1 now."
}
proc voice {nick host hand chan text} {
set target [lindex $text 0]
set target1 [lindex $text 1]
set target2 [lindex $text 2]
if {$target == ""} {
putserv "MODE $chan +v $nick"
} else {
putserv "MODE $chan +vvv $target $target1 $target2"
}
}
proc devoice {nick host hand chan text} {
set target [lindex $text 0]
set target1 [lindex $text 1]
set target2 [lindex $text 2]
if {$target == ""} {
putserv "MODE $chan -v $nick"
} else {
putserv "MODE $chan -vvv $target $target1 $target2"
}
}
proc mode {nick host hand chan text} {
set mode [lrange $text 0 6]
putserv "MODE $chan :$mode"
}
proc ckick {nick host hand chan text} {
global botnick
set target [lindex $text 0]
set reason [lrange $text 1 end]
if {$target == $nick} {
putserv "NOTICE $nick :Are you crazy? Why do you want to be kicked? lamer."
return 0
}
if {[isop $target $chan]} {
putserv "NOTICE $nick : You don`t have permission to ban the Op $target"
return 0
}
if {[matchattr $nick n|-] == "1"} {
putserv "KICK $chan $target :$reason"
} elseif {$target != $botnick} {
if {[matchattr $target n|-] == "0"} {
if {[matchattr $nick -|o $chan] == "1"} {
putserv "KICK $chan $target :$reason"
} elseif {[matchattr $target -|o $chan] == "0"} {
putserv "KICK $chan $target :$reason"
} else {
putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
}
} elseif {[matchattr $target n|-] == 1} {
putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
}
} else {
putquick "NOTICE $nick : [censored] you"
}
}
proc help {nick host hand chan text} {
putserv "NOTICE $nick :Available commands are - !ban !unban !voice !devoice !mode !kick"
}
putlog "Op tcl loaded."No problem, but if you wanted !op !deop then there are 100's of public commands in TCL Section why didn'nt you try one from the list anyway, this script is different because it does'nt let users to get op and they can access the core commands while they're voiced.starpossen wrote:iamdeath, thanks alot I will test it later, btw, would it be possible to add an !op !deop !hop !dehop too?
Code: Select all
.chattr handle +E #channelCode: Select all
.chattr handle +flag #Channel