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!
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
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.