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.

ban script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Amr
Halfop
Posts: 94
Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt

ban script

Post by Amr »

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)
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

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
User avatar
Amr
Halfop
Posts: 94
Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt

Post by Amr »

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.
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

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
User avatar
Amr
Halfop
Posts: 94
Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt

Post by Amr »

So , what will be the command then?
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

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
User avatar
Amr
Halfop
Posts: 94
Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt

Post by Amr »

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?
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

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.
M
Mabus4444
Halfop
Posts: 51
Joined: Mon Oct 30, 2006 7:40 pm

Post by Mabus4444 »

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" 
}
User avatar
Amr
Halfop
Posts: 94
Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt

Post by Amr »

It's not possible to have it with timer?
Post Reply