MQ2 DataVars -- 2D arrays

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

MQ2 DataVars -- 2D arrays

Post by dok » Thu Apr 29, 2004 2:51 pm

I may be a bit confused, but as I understand it, well, I'll post a sample code and the errors I'm getting and let you decide if I'm crazy ;)

Code: Select all

Sub Main
    |create 2d array 10x2 in size
    /declare test2[10,2] string local NULL   

    |assign values to array
    /varset test2[1,1] test11
    /varset test2[1,2] test12
    /varset test2[2,1] test21
    /varset test2[2,2] test22
    |returns /varset 'test2[-1]' failed, out of bounds on array
    /varset test2[3,1] test31
    |returns /varset 'test2[-1]' failed, out of bounds on array
    /varset test2[3,2] test32

    /echo ${test2[1,1]} -- ${test2[1,2]}   |test11 -- test 12
    /echo ${test2[2,1]} -- ${test2[2,2]}   |test21 -- test22
    /echo ${test2[3,1]} -- ${test2[3,2]}   |NULL -- NULL

    |tried just for the hell of it to swap the 2 locations, knowing it shouldn't work, which it doesn't as it should
    |returns /varset 'test2[-1]' failed, out of bounds on array
    /varset test2[1,3] test13
    /echo ${test2[1,3]}    |NULL
/return
Anyway, I dont think I'm misunderstanding how 2d arrays work, but I'll let you be the judge ;)

btw, MQ2-20040429.zip (29-Apr-2004 03:19) build

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Apr 29, 2004 3:12 pm

Not sure why this isn't working but try naming your variable with no numbers in it and see what that does.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Apr 29, 2004 3:13 pm

Wish i'd seen this before I just updated the zip :P

I'll go through and test it again, the problem with 2d arrays prior to 20040429 was out of bounds crashes.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Thu Apr 29, 2004 3:15 pm

You might also want to do a batch clean - batch build to make sure you have a clean compile. I haven't seen those issues.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Apr 29, 2004 3:18 pm

This macro indeed produces the results he shows. I'm going to debug it ;)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Apr 29, 2004 3:28 pm

Fixed in 20040429b (coming in a few minutes)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Thu Apr 29, 2004 3:48 pm

works great. thanks man :)

MrSmallie
a hill giant
a hill giant
Posts: 167
Joined: Fri Oct 11, 2002 11:18 am

Post by MrSmallie » Thu Apr 29, 2004 5:04 pm

Bah. Now it's fixed. I think I tore out most of the hair I had left trying to figure out what I was doing wrong.
Me
[img]http://home.comcast.net/~mrsmallie/ches.JPG[/img]

secrettoo
orc pawn
orc pawn
Posts: 29
Joined: Sat Oct 25, 2003 10:56 am

Similiar problem = array out of bounds in the b zip

Post by secrettoo » Thu Apr 29, 2004 5:41 pm

With the _b zip I still am getting the same issue Lax.

/declare MainArray[3,50] string outer UNDEFINED-ARRAY-ELEMENT

/varset MainArray[1,0] "honey berry"
/varset MainArray[1,1] "silk"
/varset MainArray[1,2] "high quality brute hide"
/varset MainArray[1,3] "empty"
/varset MainArray[1,4] "ruby"
/varset MainArray[1,5] "sapphire"
/varset MainArray[1,6] "fire opal"
/varset MainArray[1,7] "opal"
/varset MainArray[1,8] "fire emerald"
/varset MainArray[1,9] "diamond"
/varset MainArray[1,10] "blue diamond"
/varset MainArray[1,11] "black pearl"
/varset MainArray[1,12] "peridot"
/varset MainArray[1,13] "emerald"

/varset MainArray[2,0] "empty"
/varset MainArray[2,1] "empty"
/varset MainArray[2,2] "empty"

/declare PriorityMobList[50] string outer UNDEFINED-ARRAY-ELEMENT
/varset PriorityMobList[0] "empty"


returns the following errors:

/varset 'MainArray[-1]' failed, out of bounds on array.
/varset 'MainArray[-1]' failed, out of bounds on array.
/varset 'PriorityMobList[-1]' failed, out of bounds on array.


I downloaded the most recent zip, 5.39pm EST with the top of the changes.txt in the release dir being:

29 Apr 2004 by Lax (more):
- Fixed Multi-dimensional arrays


Thanks,

Sectoo.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Apr 29, 2004 5:44 pm

arrays are 1-based as mentioned in the MQ2DataVars zip
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

secrettoo
orc pawn
orc pawn
Posts: 29
Joined: Sat Oct 25, 2003 10:56 am

Post by secrettoo » Thu Apr 29, 2004 5:48 pm

Thanks, problem solved and thanks for an almost instant response :=)

Well done on the new stuff, its make coding the macros a lot easier and much more flexible.