mIRC Homepage
Posted By: nkneumann Updating IBL manually - 03/11/09 09:15 PM
Hi all!

I'm trying to get all the bans of the Ban list in the moment that I join a channel, so I can then handle them from a hash list (adding every ban mask and aditional info via /hadd). I'm using $ibl(...), so I made an On JOIN event that triggers only if $nick == $me.

The problem comes when I notice that on that event, if I try getting the $ibl of that $chan, the total number of bans is always 0 ($ibl($chan, 0) == 0), so something tells me that the internal ban list is not updated in the moment I join that channel.

I tried setting a timer that triggers one minute after my join, but didn't work. Also tried with /updatenl and didn't work. The only way is double-clicking on the channel for viewing the ban list, so after that I can access all bans with $ibl($chan, ...).

Could someone tell me if is there any way for updating the IBL without double-clicking on the channel?

Sorry, my english is not very good but I hope you understood what I mean smile

Thanx a lot in advance!

Code:
On *:JOIN:#: {
  if ($nick == $me) {
    var %bans.i 1
    updatenl
    var %bans.totalbans $ibl($chan, 0)

    ; The following line always shows %bans.totalbans = 0 -> Need to update $ibl here!
    echo -s Totalbans' value is: %bans.totalbans
    while (%bans.i <= %bans.totalbans) {
      hadd $chan $ibl($chan, %bans.i) $ibl($chan, %bans.i).by $+ $chr(38) $+ $ibl($chan, %bans.i).date
      inc %bans.i
    }
  }
}
Posted By: Collective Re: Updating IBL manually - 03/11/09 09:59 PM
You can issue a "mode $chan b", but you'll have to wait for the end of the reply (raw 368).
Posted By: nkneumann Re: Updating IBL manually - 03/11/09 10:19 PM
The problem of using your solution is that if someone sets a ban after my entrance, the IBL is updated but only with that ban; I mean, if I do echo -s $ibl($chan, 0) after that ban, it will return 1, independently of how many bans are in the list, so it doesn't solve it, but thanx anyway! smile
Posted By: Collective Re: Updating IBL manually - 03/11/09 11:00 PM
I didn't tell you to set a ban, I told you to use the command "mode #channel b". That is the same command mIRC issues in the background when you open the Channel Central dialog.
Posted By: nkneumann Re: Updating IBL manually - 03/11/09 11:39 PM
Oh, sorry, now I know what you meant! smile It works now laugh thanx a lot.
© mIRC Discussion Forums