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.

prob with "chanbans" getting the right ban positio

Old posts that have not been replied to for several years.
Locked
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

prob with "chanbans" getting the right ban positio

Post by z_one »

Hi,

I found it weird that when the bot joins a channel on which there are already bans in the list ... the bot doesn't get them in the correct order!

Example:
- We have channel #test on which someone has already banned 10 ips
- The bot now joins channel #test
- An op places a new ban (after the bot has joined)
-The bot considers this new ban to be ([lindex [lindex [chanbans $chan] 0] 0]) and all other 10 bans are after this one in the list!

How come ? I want my bot to unban the 12 oldest bans on the channel (those which are at the bottom of the list that mIRC shows) when the list is full ... it's not doing that, instead it's unbanning from somewhere in the middle of the ban list!

z_one
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

what u want to do is to check the "age" of the bans, make a list of the bans with their age and then use lsort to get them in order... if u want an example of how to do this I've made a script which does exactly this, it's on my webby and is called Unbanner
Elen sila lúmenn' omentielvo
User avatar
z_one
Master
Posts: 269
Joined: Mon Jan 14, 2002 8:00 pm
Location: Canada

Post by z_one »

Thx man!

I read ur example and it helped me get the idea of how to fix my script so it checks the age of the ban.
I'll test it and keep u posted about any changes or comments.

z_one
Locked