mIRC Home    About    Download    Register    News    Help

Print Thread
#200717 10/06/08 01:16 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Hi there,
How do you message a variable by using another variable...

Code:
%test_1 = test
%1 = 1
msg $chan %test_ $+ %1


Doesn't message %test_1

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
It's because mirc first evaluate %test_ ($null) then %1, and after stick them.Use $($+(%,test_,%1),2) for exemple

Last edited by Wims; 10/06/08 02:16 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Thanks for the reply Wims. Can you explain what the code is doing there please, I'm learning lol. Also is that really the only way of doing it?

Thanks


Ninko

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
$+() stick the data, $+(a,b,c) will return abc.
Here, $+(%,test_,%1) will return %test_1 because each parameter are evaluate but since you don't want %test_1 but the value of it, you need to evaluate the whole thing another time, $(,2) (the same as $eval(,2)) do it.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Thank you Wims!

Take care


Ninko


Link Copied to Clipboard