mIRC Home    About    Download    Register    News    Help

Print Thread
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

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
i havet check it but i would say $(#,0) should work

Joined: Dec 2002
Posts: 191
N
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
Try if ($chr(35) isin text) do this.

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.
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 |/

Joined: Sep 2003
Posts: 4,230
D
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 |

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 !

Joined: Aug 2003
Posts: 1,831
I
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


Link Copied to Clipboard