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.

Channelbanlist Full

Old posts that have not been replied to for several years.
Locked
A
After8

Channelbanlist Full

Post by After8 »

Hey everybody,
how can i Remove the 6 oldest Channel Bans?

Code: Select all

proc defender_mode_ban { nick host handle channel mode victim } {
  if {[botisop $channel] && [llength [chanbans $channel]] >= 45} {
    putserv "mode $chan -bbbbbb $remove_the_6_oldest_bans
  }
}
Maybe another way is better, i saw it sometimes in some Quakenet Channel's. They ban (No Timeban) the $nick, and kick 'em. If a Count of (maybe) 15 is reached, the Bot set's -b+b TheFirstBan TheNewBan. I got already some Script's, so i need only this -b+b part.
Thanx for any Help.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Hi,

Well I made a script.
It basically, detects when the banlist is full.

You should know you networks banlist capacity.
For e.g. DALnet is 100 and EFnet is 20 I think.

The script basically checks, if the banlist is near
to 100, suppose 99 on DALnet, and then it would
clear out the complete ban list. (/resetbans $chan)

This I made is for big channels where the bot
is opped on, and kicks/bans are implemented
every minute at the most making the banlist
fill in a quick amount of time.

If you need the script, let me know.

I am myself trying to make it to expire, lets
say the last 10, 20 added bans in the banlist
rather than removing all the bans in the banlist.
But that will take time I guess. It would involve
some hardcore coding.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
A
After8

Post by After8 »

The Bot is placed on Quakenet (There is the Maximun 45 Bans). I'm interested fo your Script, can you Paste it? I'm sure i'm not the only one who need's a Script like that =)
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

something like this should work

Code: Select all

set maxbans 40

bind mode - "*+b*" auto:unban

proc auto:unban {nick uh hand chan arg} {
 global botnick maxbans
  set lenbanlist [llength [chanbans $chan]]
  if { $lenbanlist >= $maxbans } {
    set unban [lindex [chanbans $chan] 1]
    putserv "MODE $chan -b $unban"
    return 1
  }
}
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well, its really very simple.
Here give it a go.

Code: Select all

######################################
## -------------------------------- ##
##  Channel Banlist Cleaner Script  ##
## -------------------------------- ##
######################################


#Set the channels you want this script activated on
set banlistchans "#elite"

# Change this variable to how many bans you dont want 
# your banlist to go past. Most DALnet servers dont 
# allow more than 100, so you should keep it around 98.
set maxbanlist 98

######  Don't change anything below here   ######
###### unless you know what you are doing! ######

bind mode - "*+b*" clear:banlist

proc clear:banlist {nick uhost hand chan mode arg} {
  global botnick banlistchans maxbanlist
   set numbanlist [llength [chanbans $chan]]
  if {(([lsearch -exact [string tolower $banlistchans] [string tolower $chan]] != -1) || ($banlistchans == "*")) && ($mode == "+b") && ($numbanlist >= $maxbanlist)} {
  if (![botisop $chan]) {return 0}
      putserv "NOTICE @$chan :BANLIST FULL: WARNING - $chan's banlist was detected to be *full* of nearly 100 entries, with $numbanlist bans."
      putserv "NOTICE @$chan :CLEARING BANLIST: The banlist for $chan is now being *cleared* to 0 entries."
      putlog "BANLIST: Clearing the banlist of $chan, as it is full."
      utimer 3 "resetbans $chan"
      }
  return 0
}
You can change the putserv commands if you like, or remove them. Basically I've set it according to my needs, also the formatting of bolds and control codes in it.

They just send out a notice to all active OPS like "/ONOTICE" saying that the channel banlist was near to be full and I am clearing out the banlist, nothing much, rest is simple as well.

If you find a script, or get one to make it like remove the earliest, 10, 20 bans in the banlist, I would surely love it. Also if anyone can help me out to build a script like that, with this one I would be glad.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
A
After8

Post by After8 »

Thanx awyeah, your Script works fine.
awyeah wrote: If you find a script, or get one to make it like remove the earliest, 10, 20 bans in the banlist, I would surely love it. Also if anyone can help me out to build a script like that, with this one I would be glad.
Yeah, if someone can help us, it would be so nice =)
oh, and if someone can help me to script the -b+b tcl,
feel free to post :)
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

http://forum.egghelp.org/viewtopic.php?t=7055

please use the forum search feature in the future...
A
After8

Post by After8 »

strikelight wrote:http://forum.egghelp.org/viewtopic.php?t=7055

please use the forum search feature in the future...
so can you solve the question in the thread?
pushmode won't work, and
-b
-b
-b
-b
-b
-b
Suckz so hard..
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

pushmode works fine
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

putserv "MODE #chan -bbbbbb $your_[censored]"
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Would this: "pushmode $chan -bbbbbb $ban"
or: putserv "MODE $chan -bbbbbb $ban" both
of which, which would work fine?

Then again, would we have to specify, $ban 6
times, after the -bbbbbb, because my irc network
can support 6 user mode modifications in 1 command.

And suppose, if we want to clean X defined number
of bans. X being a variable, like 10, 20, 30?
One idea which comes to my mind, is maybe a loop?
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

AFAIK pushmode doesnt accept multiple modes.
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

You use pushmode to place one mode at a time, it gets added to a queue, until being flushed or the proc is exited, at which point, the bot then issues all the modes in that pushmode queue...

See doc/tcl-commands.doc for more details...
Locked