mIRC Homepage
Posted By: LostShadow Combining on unban events for -bbb... - 10/07/07 07:41 AM
I have an unban event script that while loops unban events.

Works like this.

* Operator sets mode: -b host
Unban affects: nicks, separated, by, commmas.
Unban also affects: nicks, outside, the, channel.

But when I have something like..

* Operator sets mode: -bbbb host1 host2 host3 host4
Unban affects: Nicks
Unban affects: Nicks
Unban affects: Nicks
Unban affects: Nicks

Of course, most of the time bans affect only 1 nick, only bans like a* b* c* does it list more than 1..

So I'd kind of like to combine each -bbb as 1 individual on unban event and while loop that instead..

It seems I would have to make variables in several on unban events to combine them all..

Because it's common knowledge that mIRC treats -bbbb as each individual event.

Thanks.

-Neal.
Posted By: Riamus2 Re: Combining on unban events for -bbb... - 10/07/07 12:57 PM
Do something like this. It will reset the timer for each ban, so will be able to do them all at once 2 seconds after the ban.

Code:
on *:unban:#: {
  set %unban.list $addtok(%unban.list,$chr(32) $+ $banmask,44)
  .timerUnbanEffect 1 2 DisplayUnbanEffect $chan
}

alias DisplayUnbanEffect {
  echo $1 Unban affects: %unban.list
  unset %unban.list
}
Posted By: qwerty Re: Combining on unban events for -bbb... - 10/07/07 01:22 PM
Passing unknown content (including $chan) to /timer is dangerous. In this case, this would do the trick:
Code:
.timerUnbanEffect 1 2 DisplayUnbanEffect $!decode( $encode(#,m) ,m)

However, there's a simpler way of tracking multiple bans set in one /mode command, and this is the on RAWMODE event. mirc even provides the very handy $mode() identifier, which allows you to loop through any modes (one would loop through $mode(N).ban in this case, from 1 to $mode(0).ban).
© mIRC Discussion Forums