mIRC Home    About    Download    Register    News    Help

Print Thread
#216235 03/11/09 09:15 PM
Joined: Oct 2009
Posts: 14
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Oct 2009
Posts: 14
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
    }
  }
}

Last edited by nkneumann; 03/11/09 09:16 PM.
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
You can issue a "mode $chan b", but you'll have to wait for the end of the reply (raw 368).

Joined: Oct 2009
Posts: 14
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Oct 2009
Posts: 14
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

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
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.

Joined: Oct 2009
Posts: 14
N
Pikka bird
OP Offline
Pikka bird
N
Joined: Oct 2009
Posts: 14
Oh, sorry, now I know what you meant! smile It works now laugh thanx a lot.


Link Copied to Clipboard