| View previous topic :: View next topic |
| Author |
Message |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Tue Mar 01, 2011 9:14 am Post subject: ban script |
|
|
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) |
|
| Back to top |
|
 |
Mabus4444 Halfop
Joined: 30 Oct 2006 Posts: 51
|
Posted: Tue Mar 01, 2011 6:35 pm Post subject: |
|
|
This is a snippet from Eggdrop Toolz v2.01 for Eggdrop v1.3.4 & up by tzun
| Code: |
# 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
|
_________________ http://www.dalnetdebates.com/ |
|
| Back to top |
|
 |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Tue Mar 01, 2011 8:51 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Mabus4444 Halfop
Joined: 30 Oct 2006 Posts: 51
|
Posted: Wed Mar 02, 2011 4:17 pm Post subject: |
|
|
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 _________________ http://www.dalnetdebates.com/ |
|
| Back to top |
|
 |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Fri Mar 04, 2011 3:15 am Post subject: |
|
|
| So , what will be the command then? |
|
| Back to top |
|
 |
Mabus4444 Halfop
Joined: 30 Oct 2006 Posts: 51
|
Posted: Fri Mar 04, 2011 10:03 am Post subject: |
|
|
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 _________________ http://www.dalnetdebates.com/ |
|
| Back to top |
|
 |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Fri Mar 04, 2011 3:16 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
Mabus4444 Halfop
Joined: 30 Oct 2006 Posts: 51
|
Posted: Fri Mar 04, 2011 7:21 pm Post subject: |
|
|
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. _________________ http://www.dalnetdebates.com/ |
|
| Back to top |
|
 |
Mabus4444 Halfop
Joined: 30 Oct 2006 Posts: 51
|
Posted: Fri Mar 04, 2011 7:39 pm Post subject: |
|
|
Ok,
Sorry about all the confusion. The below works (tested), but again with no timer.
| Code: |
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"
}
|
_________________ http://www.dalnetdebates.com/ |
|
| Back to top |
|
 |
Amr Halfop

Joined: 14 Sep 2007 Posts: 94 Location: Egypt
|
Posted: Sat Mar 05, 2011 7:50 am Post subject: |
|
|
| It's not possible to have it with timer? |
|
| Back to top |
|
 |
|