mIRC Homepage
Posted By: Kev_Uk Usermodes - 30/01/05 02:45 AM
What's wrong with this?

User Modes
.$iif(i isincs $gettok($nick($me).mode,1,32),$style(1)) Invisible « i »: { mode $me $iif(i isincs $gettok($nick($me).mode,1,32),-i,+i) }
Posted By: nycdiesel Re: Usermodes - 30/01/05 03:44 AM
Code:
menu status {
  User Modes
  .$iif($regex($usermode,/(i)/),$style(1)) Invisible « i »:{ mode $me $iif($regex($usermode,/(i)/),-i,+i) }
}


The above should work. What I did was replaced your method with my own. Basically I'm comparing a string using regular expressions (/help Regular Expressions), depending on the result the event is taken. This is similar to the one you had but using regular expressions,
Posted By: FiberOPtics Re: Usermodes - 30/01/05 03:54 AM
Just a small thing:

Since you are capturing the pattern (i) by using the brackets (), you might as well take advantage of it.

That second $regex becomes obsolete and we can do something like this:

.$iif($regex($usermode,/(i)/),$style(1)) Invisible « i »: mode $me $iif($regml(1),-i,+i)
Posted By: nycdiesel Re: Usermodes - 30/01/05 04:01 AM
Ah I see now. Thanks smile
Posted By: FiberOPtics Re: Usermodes - 30/01/05 04:08 AM
Welcome.
Posted By: Iori Re: Usermodes - 31/01/05 06:57 AM
It would probably be a good idea to name the RE s if you want to do it that way.
Code:
User Modes
.$iif($regex([color:blue]umode[/color],$usermode,/(i)/),$style(1)) Invisible « i »:mode $me $iif($regml([color:blue]umode[/color],1),-i,+i) 


If there is any more regex calls later in the same popup they may slew the results.
e.g. The second re here should always be false, and will make the mode command always try to set +i
  • .$iif($regex($usermode,/(i)/),$style(1)) Invisible « i »:mode $me $iif($regml(1),-i,+i)
    .$iif($regex($me,/\n/),a stuffup occurred):!
Posted By: FiberOPtics Re: Usermodes - 31/01/05 02:36 PM
Yea I know about naming regexes, suppose you could add it. Wasn't really a point in trying to explain to me, if you have seen some of my previous posts, you would have noticed I use it now and then, for the same reason: not corrupting previous and future captured patterns wink

Guess it slipped my mind this time.

Greets
Posted By: Iori Re: Usermodes - 04/02/05 09:45 PM
The explanation wasn't really aimed at anyone in particular, the reply was to your post mostly to keep it in the right thread order. laugh
© mIRC Discussion Forums