mIRC Home    About    Download    Register    News    Help

Topic Options
#95373 - 24/08/04 03:05 PM check mode
jacksparrow2 Offline
Fjord artisan

Registered: 30/10/03
Posts: 306
Loc: Argentina
i have this
on 1:mode:#: if $1 == m or should be (+m) { .do my stuff }

but isnt work , any help please?
_________________________
mess with the best

Top
#95374 - 24/08/04 03:21 PM Re: check mode
Mentality Offline
Planetary brain

Registered: 01/06/03
Posts: 5024
Loc: London, England
on 1:mode:#: if (+*m* iswmcs $1) { do stuff }

...should work fine.

The reason I say use 'iswmcs' is some servers have a +M mode, I don't know about the one you use. Also, someone could set +im and it wouldn't detect it. If you really do only want to detect if +m is set on its own though, use if (+m === $1).

You do need to specify the + because otherwise it will also detect the -.

Hope this helps!

Regards,


Edited by Mentality (25/08/04 12:33 AM)
_________________________
Mentality/Chris

Top
#95375 - 24/08/04 03:40 PM Re: check mode
jacksparrow2 Offline
Fjord artisan

Registered: 30/10/03
Posts: 306
Loc: Argentina
you rulez
_________________________
mess with the best

Top
#95376 - 24/08/04 04:02 PM Re: check mode
jacksparrow2 Offline
Fjord artisan

Registered: 30/10/03
Posts: 306
Loc: Argentina
how can i add a nicklist ,to the other post

menu nicklist {
$iif($me isop #,Op Commands,$null)
}

something like that
_________________________
mess with the best

Top
#95377 - 25/08/04 12:17 AM Re: check mode
Ddan Offline
Babel fish

Registered: 15/02/04
Posts: 50
Code:
 
menu nicklist {
  $iif($me isop #,Op Commands)
  .ban:/etc
  .kick:/etc
}


is that what you mean? there's no need for the $null bit.

also it would probably be better to use:

Code:
on *:MODE:#: {
  if (m isincs $1-) { do stuff, like check $chan(#).mode to see if m is still active in the channel. }
}


as with Mentalities idea, if someone sets the mode +im your script will not trigger. <- disregard that, he edited his post after he saw mine :P~~~


Edited by Ddan (25/08/04 12:34 AM)

Top
#95378 - 25/08/04 12:39 AM Re: check mode
starbucks_mafia Offline
Hoopy frood

Registered: 09/12/02
Posts: 2962
Loc: Norwich, UK
Quote:
on 1:mode:#: if (+*m* iswmcs $1) { do stuff }

That would match +i-m, the simplest way to match it is $regex($1, /\+[^-]*m/)
_________________________
Spelling mistakes, grammatical errors, and stupid comments are intentional.

Top
#95379 - 25/08/04 08:48 AM Re: check mode
KingTomato Offline
Planetary brain

Registered: 04/01/03
Posts: 3012
Loc: New Hampshire, USA
Not sure how into it you'd like to get, but this script will retrieve individual modes for you. Just loop through for a +m
_________________________
-KingTomato

Top