mIRC Home    About    Download    Register    News    Help

Print Thread
#244010 16/01/14 06:43 PM
Joined: Jan 2014
Posts: 2
R
Rolezn Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Jan 2014
Posts: 2
Hello, I'm new to scripting and got into a problem I did not know how to solve.

I have a list of variables which consists of:
%current_object %object1
%object1 1
%object2 2
%object3 3


On *:Text:!current:#:{
msg $chan Current is: %current_object
}
;Prints out "%object1" instead of "1";


I would like to message out the current object using %current_object , is that possible?

Thanks in advance!

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
You need to evaluate it twice, $(%current_object,2)

Joined: Jan 2014
Posts: 2
R
Rolezn Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
R
Joined: Jan 2014
Posts: 2
Originally Posted By: Loki12583
You need to evaluate it twice, $(%current_object,2)


Thanks! I've been wondering how to do that for a while trying $$ and %% , I have one more question that I got stuck on.

How would I move to a next object? for example:
Having a new variable.

%current_objectnum 1

On *:Text:!next:#:{
var %next_object = %current_objectnum + 1
%current_object = %object $+ %next_object
%current_objectnum = %next_object
msg $chan %current_object
}
;This prints 2 instead of %object2;

Thanks again!


Link Copied to Clipboard