mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2003
Posts: 13
P
Pilo Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Jun 2003
Posts: 13
If I write following in a Channel...

Code:
//set % $+ $me $me


I can create as example an variable and value looking like this...

Code:
%Pilo Pilo


But...if I try to read them out in the same style I created this variable...

Code:
//echo % $+ $me


...I get only this message...

%Pilo

...why...if I can create this variables...why couldn't I read them out...

mIRC-Help tells following...

Quote:
You can also set/unset dynamic variables using [] brackets:

vartest {
set %a [ $+ b ] 1
set %a [ $+ c ] 2
set %a [ $+ d ] 3

echo ab = %ab
echo ac = %ac
echo ad = %ad

unset %a [ $+ b ] %a [ $+ c ] %a [ $+ d ]
}


But...this aren't dynamic variables... b, c and d are just static characters and no variables...

to set or unset %ab you can simply use %ab and not this %a [ $+ b ] <- useless stuff

Code:
set %b b
set %a [ $+ %b ] test
echo %a [ $+ %b ]   -&gt; output: test
echo %ab  -&gt; output: test


..%a [ $+ %b ] is in this case a real dynamic variable...nothing else...

so...why isn't it working like this...???

Please tell me...

Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
alias test {
set % [ $+ [ $me ] ] $me
echo -a % [ $+ [ $me ] ]
}


That seems to work. Don't know if that's what you mean though...

Joined: Jun 2003
Posts: 20
I
Ameglian cow
Offline
Ameglian cow
I
Joined: Jun 2003
Posts: 20
try //echo -a


Get into the Flamez
Joined: Jun 2003
Posts: 2
C
Bowl of petunias
Offline
Bowl of petunias
C
Joined: Jun 2003
Posts: 2
Referring back to your example with the $me identifier, try doing it like this:

// set % [ $+ [ $me ] ] $me | echo % [ $+ [ $me ] ]


-----
Oops it seems that someone else got there first. Oh well. The contrast is that the line here can be typed into the editbox still.

Last edited by Chris84; 05/06/03 03:28 AM.
Joined: Dec 2002
Posts: 60
C
Babel fish
Offline
Babel fish
C
Joined: Dec 2002
Posts: 60
u can use $eval for it

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Your /set commands work fine; you don't need square brackets or anything in /set. However, you do need some way to force further evaluation when you want to retrieve the value of such variable, and that's square brackets or $eval()
First way:
//echo -s % [ $+ [ $me ] ]

Second way:
//echo -s $eval(% $+ $me,2)
or $eval($+(%,$me),2)


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#28222 06/06/03 03:29 PM
Joined: Jun 2003
Posts: 13
P
Pilo Offline OP
Pikka bird
OP Offline
Pikka bird
P
Joined: Jun 2003
Posts: 13
Thanx a lololot guys...this really seems to work like I need it...
Oh man...I was close before an heart attack...cause I need this dynamic variables for my own little script to block some triggerspam wink

P.S. to many brackets for my brain... he he


Link Copied to Clipboard