Hi, i've recently got my egg up and running again, after a major hdd crash I lost everything, it's been awhile since I messed about with eggdrop, and now im looking for a script.
A script that let's me add users who will be able to voice, kick and ban
via the bot
ofcourse they shouldnt be able to kick me hehe.
I've looked at the archive, but im not sure which to choose
so if any of you could point in a good direction of a script
which would have the features I mentioned before.
## 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."
Ok this is a mixture of couple of scripts, this should do what you want.
Add your ops in DCC with E channel flag, they will only be able to kick/ban (They can not kick/ban oped or voiced users). They can also unban anyone from the channel's current list or from the bots internal banlist but they can not unban any sticky ban. They can voice/devoice, they can also change channel mode. I will recommend this option because, if there is flood going on, they should be able to handle things, 2nd. Add your ops +v so that they can get always +voice and use these pub commands incase the cahnnel is +m they wont have to wait for an op to voice them. 3rd with this script people do not really need to get @op when they can perform all the things when they're voiced. I have modified this script almost 90% and I use it in my channel it works pretty nice. For more let me know.
starpossen wrote:iamdeath, thanks alot I will test it later, btw, would it be possible to add an !op !deop !hop !dehop too?
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.
You're right, sorry long day, however, I will test this script later tonight, and report back, once again thanks for helping, and i'll let you know if something is needed if you got time for more help.
*EDIT* Okay, i've tested it, but I cant get anyone to use the commands, I did add them with .chattr nick +E