mIRC Homepage
Posted By: morphy how to distinguish channels from nicks - 02/02/04 01:35 PM
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
Posted By: DaveC Re: how to distinguish channels from nicks - 02/02/04 01:47 PM
i havet check it but i would say $(#,0) should work
Posted By: Nobodi Re: how to distinguish channels from nicks - 02/02/04 01:48 PM
Try if ($chr(35) isin text) do this.
Posted By: EVH Re: how to distinguish channels from nicks - 02/02/04 02:29 PM
... or narrow it down further
if ($left(text,1) == $chr(35))

or

if it's a channel you're on
if (text ischan)
Posted By: morphy Re: how to distinguish channels from nicks - 03/02/04 07:11 AM
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 |/
Posted By: DaveC Re: how to distinguish channels from nicks - 03/02/04 10:11 AM
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 |
Posted By: morphy Re: how to distinguish channels from nicks - 03/02/04 11:21 AM
yeap...
'understand!
ok... thanks several time !
Posted By: Iori Re: how to distinguish channels from nicks - 03/02/04 11:35 PM
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
© mIRC Discussion Forums