|
Joined: Dec 2002
Posts: 174
Vogon poet
|
OP
Vogon poet
Joined: Dec 2002
Posts: 174 |
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) }
|
|
|
|
Joined: Dec 2004
Posts: 81
Babel fish
|
Babel fish
Joined: Dec 2004
Posts: 81 |
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,
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
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)
Gone.
|
|
|
|
Joined: Dec 2004
Posts: 81
Babel fish
|
Babel fish
Joined: Dec 2004
Posts: 81 |
Ah I see now. Thanks
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Gone.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
It would probably be a good idea to name the RE s if you want to do it that way.
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):!
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
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 Guess it slipped my mind this time. Greets
Gone.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
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.
|
|
|
|
|