mIRC Home    About    Download    Register    News    Help

Topic Options
#70093 - 02/02/04 01:35 PM how to distinguish channels from nicks
morphy Offline
Nutrimatic drinks dispenser

Registered: 02/02/04
Posts: 7
Loc: Germany
i want to use an if-then-else like this:
if (the charakter "#" is in "text") { do this }
else { do that }

how to do it?

this doesn't work:
if { # isin %var } echo $active chan
else echo active nick

but this for example works excellent:
if ( #abc isin %var ) echo $active chan
else echo $active nick

i thing by typing # only, mirc understands a command not the char "#". so how to tell mirc to take the char "#".

or is there a command like islatter, isalnum, to tell mirc to distinguish channels from nicknames confused

Top
#70094 - 02/02/04 01:47 PM Re: how to distinguish channels from nicks
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
i havet check it but i would say $(#,0) should work

Top
#70095 - 02/02/04 01:48 PM Re: how to distinguish channels from nicks
Nobodi Offline
Vogon poet

Registered: 10/12/02
Posts: 191
Loc: Australia
Try if ($chr(35) isin text) do this.

Top
#70096 - 02/02/04 02:29 PM Re: how to distinguish channels from nicks
EVH Offline
Fjord artisan

Registered: 22/10/03
Posts: 273
... or narrow it down further
if ($left(text,1) == $chr(35))

or

if it's a channel you're on
if (text ischan)


Edited by EVH (02/02/04 02:29 PM)

Top
#70097 - 03/02/04 07:11 AM Re: how to distinguish channels from nicks
morphy Offline
Nutrimatic drinks dispenser

Registered: 02/02/04
Posts: 7
Loc: Germany
10x ppl !!!
i toke the variant of Nobodi, but i'll remember all the other commands for latter scriptings...

P.S.: Dovec... what do you mean with $(#,0) ? how can i use that ?

thanks all...
PeacE |/

Top
#70098 - 03/02/04 10:11 AM Re: how to distinguish channels from nicks
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
Quote:
thing by typing # only, mirc understands a command not the char "#". so how to tell mirc to take the char "#".


You asked that, i replied.

you dont want # to be evaluated to the current channel, then dont use # uses $(#,0)
$(#,0) = evaluate # zero times

works the same as if u wanted to see this | Hi There |
you can go ECHO $(|,0) Hi There $(|,0)
its easier than trying to remeber the asc for |

Top
#70099 - 03/02/04 11:21 AM Re: how to distinguish channels from nicks
morphy Offline
Nutrimatic drinks dispenser

Registered: 02/02/04
Posts: 7
Loc: Germany
yeap...
'understand!
ok... thanks several time !

Top
#70100 - 03/02/04 11:35 PM Re: how to distinguish channels from nicks
Iori Offline
Hoopy frood

Registered: 30/08/03
Posts: 1831
Bear in mind that channels do not always start with #

if $left(<text/var/$n>,1) isin $chantypes { echo -a channel }
else echo -a not channel

Top