egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ban script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Amr
Halfop


Joined: 14 Sep 2007
Posts: 94
Location: Egypt

PostPosted: Tue Mar 01, 2011 9:14 am    Post subject: ban script Reply with quote

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
View user's profile Send private message
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Tue Mar 01, 2011 6:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
Amr
Halfop


Joined: 14 Sep 2007
Posts: 94
Location: Egypt

PostPosted: Tue Mar 01, 2011 8:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Wed Mar 02, 2011 4:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Amr
Halfop


Joined: 14 Sep 2007
Posts: 94
Location: Egypt

PostPosted: Fri Mar 04, 2011 3:15 am    Post subject: Reply with quote

So , what will be the command then?
Back to top
View user's profile Send private message
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Fri Mar 04, 2011 10:03 am    Post subject: Reply with quote

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
View user's profile Send private message
Amr
Halfop


Joined: 14 Sep 2007
Posts: 94
Location: Egypt

PostPosted: Fri Mar 04, 2011 3:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Fri Mar 04, 2011 7:21 pm    Post subject: Reply with quote

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 Smile

As for bantime, this doesn't do that.
_________________
http://www.dalnetdebates.com/
Back to top
View user's profile Send private message
Mabus4444
Halfop


Joined: 30 Oct 2006
Posts: 51

PostPosted: Fri Mar 04, 2011 7:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Amr
Halfop


Joined: 14 Sep 2007
Posts: 94
Location: Egypt

PostPosted: Sat Mar 05, 2011 7:50 am    Post subject: Reply with quote

It's not possible to have it with timer?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber