mIRC Home    About    Download    Register    News    Help

Print Thread
how to distinguish channels from nicks #70093 02/02/04 01:35 PM
Joined: Feb 2004
Posts: 7
M
morphy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2004
Posts: 7
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

Re: how to distinguish channels from nicks #70094 02/02/04 01:47 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
i havet check it but i would say $(#,0) should work

Re: how to distinguish channels from nicks #70095 02/02/04 01:48 PM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
Try if ($chr(35) isin text) do this.

Re: how to distinguish channels from nicks #70096 02/02/04 02:29 PM
Joined: Oct 2003
Posts: 273
E
EVH Offline
Fjord artisan
Offline
Fjord artisan
E
Joined: Oct 2003
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)

Last edited by EVH; 02/02/04 02:29 PM.
Re: how to distinguish channels from nicks #70097 03/02/04 07:11 AM
Joined: Feb 2004
Posts: 7
M
morphy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2004
Posts: 7
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 |/

Re: how to distinguish channels from nicks #70098 03/02/04 10:11 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 |

Re: how to distinguish channels from nicks #70099 03/02/04 11:21 AM
Joined: Feb 2004
Posts: 7
M
morphy Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2004
Posts: 7
yeap...
'understand!
ok... thanks several time !

Re: how to distinguish channels from nicks #70100 03/02/04 11:35 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
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