mIRC Home    About    Download    Register    News    Help

Print Thread
#109478 30/01/05 02:45 AM
Joined: Dec 2002
Posts: 174
K
Kev_Uk Offline OP
Vogon poet
OP Offline
Vogon poet
K
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) }

#109479 30/01/05 03:44 AM
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
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,

#109480 30/01/05 03:54 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
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.
#109481 30/01/05 04:01 AM
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
Ah I see now. Thanks smile

#109482 30/01/05 04:08 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Welcome.


Gone.
#109483 31/01/05 06:57 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
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.
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):!

#109484 31/01/05 02:36 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
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 wink

Guess it slipped my mind this time.

Greets


Gone.
#109485 04/02/05 09:45 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
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. laugh


Link Copied to Clipboard