mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2009
Posts: 1
N
Mostly harmless
OP Offline
Mostly harmless
N
Joined: Jul 2009
Posts: 1
I need to concatenate a string or two to a variable. The variable will should look like %money_$nick when it's done (where $nick is...well you know.) The script that I originally got the concatenation from was for mIRC 6.02, and it doesn't seem to work in mIRC 6.35 (* /if: invalid format ). The string goes like this:

%money_ [ $+ [ $nick ] ]

While that (without money_) worked great in that bot, it doesn't now.

What is the new format for doing this?

tl;dr How do I put $nick in a %variable?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
instead of
Code:
%money_ [ $+ [ $nick ] ]
use
Code:
%money_ $+ [ $+ [ $nick ] ]
or (when setting)
Code:
$+(%,money_,$nick)

If you use the last method (which is my preferred method), to get the value, you have to double evaluate the variable, thus you would use
Code:
$($+(%,money_,$nick),2)
or
Code:
$eval($+(%,money_,$nick),2)


6.02 is such an old version, that it sounds like your script was taking advantage of a bug, which has been fixed in the mean time.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Originally Posted By: RusselB
instead of
Code:
%money_ [ $+ [ $nick ] ]
use
Code:
%money_ $+ [ $+ [ $nick ] ]
There is no problem with the first format (once again, a simple test would've shown you this, eg //set -s %money_ [ $+ [ $me ] ] test | echo -a %money_ [ $+ [ $me ] ] )

Nicholas_OConnor: apparently the problem is not in the way you set/get the variable. We need to see the entire line from your script that causes the problem.

Last edited by qwerty; 08/07/09 11:26 AM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jun 2007
Posts: 933
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Originally Posted By: qwerty
We need to see the entire line from your script that causes the problem.

Obviously yes, since the error message clearly says it's an if-statement causing the problem.


Link Copied to Clipboard