PDA

View Full Version : Macro woes


Drablak
09-02-2003, 10:12 PM
Is it possible that two-dimensional arrays in macros don't accept variables as index?

I have something like this:
------------------------------
set my_array[1][1] 9
...

set my_first_index 1
set my_second_index 1
...

if my_array[my_first_index][my_second_index] == 9
...
------------------------------

and I can't get the @#% thing to work. If I replace the index variables by numbers it works (but of course beat the purpose of using an array in the first place).

Any ideas?

D,

Hidden
09-03-2003, 11:34 AM
I believe the problem isn't so much index variables as multiple index variables (that is to say, one index and one constant will work). One think you could try is concatenating the second dimension together as a set of strings stored in the first dimension. Then, to access [x][y] you would:

set bobthetemporaryvar my_big_array[x]
set thevalueI'mactuallyafter bobthetemporaryvar.word[y]

Drablak
09-03-2003, 12:00 PM
Oh thanks that works!

Now of course I need to reformat all my database (yeah for BBEdit) and it's a workaround but I can move forward with this project.

Thanks,
D.

P.S. is that a bug in the macro implementation or a unavoidable limitation of the system?

Hidden
09-03-2003, 12:15 PM
P.S. is that a bug in the macro implementation or a unavoidable limitation of the system?

Uh, both? <G>

That is to say, it's probably a bug, and an unavoidable limitation of the current implementation, but it wouldn't be THAT hard to change.

Steady Foot
09-03-2003, 01:48 PM
Is it possible that two-dimensional arrays in macros don't accept variables as index?

I have something like this:
------------------------------
set my_array[1][1] 9
...

set my_first_index 1
set my_second_index 1
...

if my_array[my_first_index][my_second_index] == 9
...
------------------------------

and I can't get the @#% thing to work. If I replace the index variables by numbers it works (but of course beat the purpose of using an array in the first place).

Any ideas?

D,


Ok I am curious.. what in the world of Clan Lord would that kind of marco be for? [:)]

This is from an un-educated human fighter. [:)]

Drablak
09-03-2003, 02:04 PM
Ok I am curious.. what in the world of Clan Lord would that kind of marco be for? [:)]

This is from an un-educated human fighter. [:)]

I'm doing a macro to find a path from any snell to any other snell in Orga Outback. The last time we were there with a group (going to the FH) someone took a wrong turn and we needed to get to her. With a macro like this it would have been simple to type "/obd 18 5" and get "Path from 18 to 5 is: ESW-NWN-EEE" and then when you need to get back to the group from snell 5 you type "/obd 5 18" and get "Path from 5 to 18 is: SWN-NEW-WNS". Ain't that cool? :)

Hidden
09-03-2003, 02:52 PM
I've been thinking -- might it be easier to write a system to farm out this type of complicated macro to an external program? It could either capture the outgoing packet stream and catch "Macro 2.0" commands, or you could setup "Macro 2.0"s as hooks that fed the arguments to something in the text log that a scanner would pick up and execute. The first is cleaner, but I'm not sure how many people would be willing to use such a system.

Drablak
09-04-2003, 06:42 AM
I've been thinking -- might it be easier to write a system to farm out this type of complicated macro to an external program? It could either capture the outgoing packet stream and catch "Macro 2.0" commands, or you could setup "Macro 2.0"s as hooks that fed the arguments to something in the text log that a scanner would pick up and execute. The first is cleaner, but I'm not sure how many people would be willing to use such a system.
Er, I guess it might be easier but I have no idea how to do that.

Hidden
09-04-2003, 05:15 PM
Er, I guess it might be easier but I have no idea how to do that.

Yes, but I do. <G>

Drablak
09-06-2003, 08:32 PM
Woo! Go me!

My OOB macro now works. Be sure to quiz me when you see me, I need to test it.

[:D]