Where am I going wrong.

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

Where am I going wrong.

Post by RDPidb » Sun Oct 31, 2004 4:21 pm

Here is some code I am trying to get to work:

/declare MobArray[2,2] int outer

/varset MobArray[1,1] "-2331"
/varset MobArray[1,2] "-1676"

/echo ${MobArray[1,1]}
/echo ${MobArray[1,2]}

Results in:
[MQ2] 0
[MQ2] 0


Any ideas why its not displaying the locs?

Thanks

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Sun Oct 31, 2004 4:25 pm

Does ${MobArray[2,1]} and ${MobArray[2,2]} need to be set?

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Sun Oct 31, 2004 4:29 pm

Just a thought, not sure if it'll work but try without the quotes around the numbers. Only time you need those are when you have a string containing whitespace.

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Sun Oct 31, 2004 5:01 pm

Dude.. use code brackets please.

-j

User avatar
Cr4zyb4rd
Plugins Czar
Posts: 1449
Joined: Tue Jul 20, 2004 11:46 am

Post by Cr4zyb4rd » Sun Oct 31, 2004 5:10 pm

edit: I am teh dumbass :)
Last edited by Cr4zyb4rd on Sun Oct 31, 2004 6:14 pm, edited 1 time in total.

eqjoe
a grimling bloodguard
a grimling bloodguard
Posts: 984
Joined: Sat Sep 28, 2002 12:26 pm

Post by eqjoe » Sun Oct 31, 2004 5:17 pm

The problem is the quotes. String!=Int and the quotes makes the value a string.

I tested using this using straight up integers with and without the quotes and verified that the quotes are a problem. With quotes your return is 0 everytime.


-j

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

Post by RDPidb » Mon Nov 01, 2004 8:11 am

Ok , thanks guys , works like a charm now.
Sorry for not using code bracets :shock: