mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
I am traying to make a var in a if but the var have o had %var $+ $nick. How can i do that
example:
if ( %var $+ $nick == On ) { comands }


Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
$eval($+(%,var,$nick),2)


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Humm that code you give to me don´t work, but if i put instad 2 i put 1 it works but not works very good becouse he separate the %var nick and i want %varnick all together.
And the code you just give to me make %var nick.

Joined: Sep 2003
Posts: 6
N
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
N
Joined: Sep 2003
Posts: 6
I didn't quite get what you mean,

but if you want to use %varNick1 %varNick2 %varNick3 as variables, when $nick is Nick1, Nick2, Nick3; you may use variables like
% [ $+ [ var $+ [ $nick ] ] ]

which are ugly, but can be used in the earlier versions of mIRC, too

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Here is two ways to set and retrieve such vars...

//set -u %var $+ $me test | echo -a %var $+ $me = %var [ $+ [ $me ] ]
//set -u $+(%,var,$me) test | echo -a $+(%,var,$me) = $eval($+(%,var,$me),2)

and how to use them in /if statements...

//set -u $+(%,var,$me) test | if $eval($+(%,var,$me),2) == test { echo -a * Match: $ifmatch }

Joined: May 2003
Posts: 161
A
Vogon poet
Offline
Vogon poet
A
Joined: May 2003
Posts: 161
the fastest way is just
Code:
%var [ $+ [ $nick ] ]


Link Copied to Clipboard