This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Tue Mar 01, 2011 9:14 am
Guys , any script which ban someone with specific message on the main channel is available ?
For example : when I type (trigger ban $nick $bantime $kickmsg) it ban the nick and type on the main channel , Admin which is me has banned you for (kickmsg) for (bantime)
Mabus4444
Halfop
Posts: 51 Joined: Mon Oct 30, 2006 7:40 pm
Post
by Mabus4444 » Tue Mar 01, 2011 6:35 pm
This is a snippet from Eggdrop Toolz v2.01 for Eggdrop v1.3.4 & up by tzun
Code: Select all
# Start KickBan
proc msg_kban {nick host hand chan text} {
global botnick
set target [lindex $text 0]
set reason [lrange $text 0 end]
set bhost [getchanhost $target $chan]
set banmask "*!*[string trimleft [string range $bhost [string first "!" $bhost] end] ?^~-_+?]"
if {[matchattr $nick o|-] == "1"} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $target :$reason"
} elseif {$target != $botnick} {
if {[matchattr $target o|-] == "0"} {
if {[matchattr $nick o|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 kick the Op $target"
}
} elseif {[matchattr $target o|-] == 1} {
putserv "NOTICE $nick : You don`t have permission to kick the Op $target"
}
} else {
putquick "PRIVMSG $chan : banned"
}
}
# End Kickban
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Tue Mar 01, 2011 8:51 pm
What I mean is to ban the user without kicking him/her , and say on the main channel the ban message which the admin mentioned.
Mabus4444
Halfop
Posts: 51 Joined: Mon Oct 30, 2006 7:40 pm
Post
by Mabus4444 » Wed Mar 02, 2011 4:17 pm
Change putserv "KICK $chan $target :$reason" lines to
# putserv "KICK $chan $target :$reason"
That rems out the kick line so he won't be kicked
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Fri Mar 04, 2011 3:15 am
So , what will be the command then?
Mabus4444
Halfop
Posts: 51 Joined: Mon Oct 30, 2006 7:40 pm
Post
by Mabus4444 » Fri Mar 04, 2011 10:03 am
sorry, my bad
add this line at the top;
bind pub o|o !ban pub:msg_kban
and the command will then be !ban user
or !ban user message
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Fri Mar 04, 2011 3:16 pm
Did you tried it?
because when I type the ban command , I got this in the party line.
Tcl error [pub:msg_kban]: invalid command name "pub:msg_kban"
what about the ban time?
Mabus4444
Halfop
Posts: 51 Joined: Mon Oct 30, 2006 7:40 pm
Post
by Mabus4444 » Fri Mar 04, 2011 7:21 pm
sorry change pub:msg_kban
to msg_kban
or change the proc to pub:msg_kban
The bind binds a command to a keyword
and the proc activates it when someone types it on the channel, so they have to match
As for bantime, this doesn't do that.
Mabus4444
Halfop
Posts: 51 Joined: Mon Oct 30, 2006 7:40 pm
Post
by Mabus4444 » Fri Mar 04, 2011 7:39 pm
Ok,
Sorry about all the confusion. The below works (tested), but again with no timer.
Code: Select all
bind pub o|o !ban4 pub:bannokick
proc pub:bannokick {nick host hand chan text} {
global botnick
set target [lindex $text 0]
set reason [lrange $text 0 end]
set bhost [getchanhost $target $chan]
set banmask "*!*[string trimleft [string range $bhost [string first "!" $bhost] end] ?^~-_+?]"
putserv "MODE $chan +b $banmask"
putquick "PRIVMSG $chan : $reason"
}
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sat Mar 05, 2011 7:50 am
It's not possible to have it with timer?