mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 7,168
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
When someone does a -b mode change, the ON UNBAN event is triggered. Did I miss them, or are there no equivalent events for -i (Invite) or -e (Except).

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
There is no equiv for those. It would have to be written. That would be a decent Feature Suggestion though.

Joined: Aug 2004
Posts: 7,168
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Anyone got an idea as to how this could be worked around (for now)?
I've got an alias that needs to run when any of those commands are done (-b, -i or -e). The -b is easy, just use the ON UNBAN event, but I still need something for the other two.

And before it's suggested that I just run the alias after the mode line is executed, I already tried that, and because of timing difficulties the mode command doesn't complete.

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Well, this isn't complete by any means. There's probably a faster way to do it, but I couldn't really think of one off the top of my head.

Code:
alias checkmode {
  var %i = 1 , %pos = 1
  if ($regex($1,/[beIkl]/)) {
    while ($mid($1,%i,1)) {
      var %v1 = $v1
      if ($istok(+ -,%v1,32)) { var %mode = %v1 }
      elseif ((%mode == - && $istokcs(b e I,%v1,32)) || (%mode == + && $istokcs(b e I k l,%v1,32))) {
        inc %pos
        echo -ag Mode %mode %v1 takes $ $+ %pos which is: $ [ $+ [ %pos ] ]
      }
      inc %i
    }
  }
}


You can use it as a basis to do whatever you want, using "on rawmode" with it.

Example:

//checkmode +l+IemiMR-eImib 5 Rand1!*@* Rand2!*@* Rand3!*@* Rand4!*@* Doofus!nightshade@blues.com
(Granted, you don't see two +es in a row ever, since the server will combine them if there is no -'s between them. But that isn't the point, the functionality just needs to be there for it.)
Would give you:

Mode + l takes $2 which is: 5
Mode + I takes $3 which is: Rand1!*@*
Mode + e takes $4 which is: Rand2!*@*
Mode - e takes $5 which is: Rand3!*@*
Mode - I takes $6 which is: Rand4!*@*
Mode - b takes $7 which is: Doofus!nightshade@blues.com

Joined: Dec 2002
Posts: 2,884
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,884
I hate spamming my own posts, but you might wanna take a look at the code I provided showing how to make your own mode events using the 'on rawmode' event.

Using that code you can create simple signal-based events to handle whatever you need with all the correct parameters supplied.

Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
Hah, pretty much the exact same idea I came up with, with the useage of $chan/nickmode.

Which I actually spaced off the nickmodes.

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
You're looking for on RAWMODE.

Also, to make life easier, a while ago a wrote this sniplet to give you more control over the modes. I think that's what you're looking for.

Joined: Aug 2004
Posts: 7,168
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
Thanks to all who responded. I'll try the various ideas and include the authors name in the credits section when I've got this completed.


Link Copied to Clipboard