WARNING!! Serious revamp IS LIVE!!

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Fri Oct 03, 2003 9:11 am

Array and Array2... any way to implement arrays of unlimited dimensions, and declare an array(#). So array(1) would be your basic list, array(2) a "table", array(3) a "cube", etc.?

I can visualize a three dimensional array of mobs, and a macro that sorts them into the array based on con color and "named" vs. "unnamed".
MQ2: Think of it as Evolution in action.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Oct 03, 2003 6:40 pm

Code: Select all

/sub main
/echo @param0
/return
prints @param0

Is this correct?

Code: Select all

/sub main(param0)
/echo @param0
/return
print the first parameter.

Code: Select all

/sub main
/call sub2 @param0
/return

/sub sub2(param0)
/echo @param0
/return
Hangs like a mo' fo'. One of the search argument routines is broken.

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Fri Oct 03, 2003 8:50 pm

dont_know_at_all wrote:

Code: Select all

/sub main
/echo @param0
/return
prints @param0

Is this correct?
Yes, variables are case sensitive, and unnamed parameters are Param, not param

dont_know_at_all wrote:

Code: Select all

/sub main
/call sub2 @param0
/return

/sub sub2(param0)
/echo @param0
/return
Hangs like a mo' fo'. One of the search argument routines is broken.
Ok, that's semi-bad... logically its: "@param0" doesn't resolve so it leaves it as "@param0" and passes it in
now, sub 2's /echo: replace "@param0" with the value, which is "@param0", and PMP then reparses the line,and replaces it again ;(

I'll have to think more on how to "fix" this...
- Plazmic

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Oct 03, 2003 8:58 pm

Plazmic wrote:Yes, variables are case sensitive, and unnamed parameters are Param, not param
Yikes.

Also, it seems a bit slower. My bard run-in-circles macro is definitely not a circle anymore. I'm not sure how to debug this....

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Fri Oct 03, 2003 9:20 pm

All variable lookups are string based. It'd be even slower if vars weren't case sensitive.
The fix to that recursion issue will probably slow things down a tiny bit more. since I'm going to have to check the contents of the variable when it's deferenced for any variable dereferences.

Fixes in test:
Recursive dereferences.
/for doesn't work unless var is all lowercase
Plus sign (+) changes into a @
- Plazmic

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Fri Oct 03, 2003 10:33 pm

It all works now I think... I wrote a fairly extensive uservarstest.mac that is included in the diff I sent DKAA...
Stay tuned for the official word back that the zip is updated ;)
- Plazmic

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Fri Oct 03, 2003 11:44 pm

Plazmic wrote:All variable lookups are string based. It'd be even slower if vars weren't case sensitive.
But it's always been a string lookup more or less. I think there is something really inefficient going on.

I'm only getting like four course adjustments per cast time, which means it takes nearly a second to do some simple math and a doevents on a PII 450. I'm going to add some more spew and see if I can figure it out.

CVS and zip are updated.

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Fri Oct 03, 2003 11:44 pm

is it possible to set up an array of timers? I what to be able to time multiple buffs.

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sat Oct 04, 2003 12:02 am

Pseudo-code:

Code: Select all

/declare BuffTimer0 timer
/declare BuffTimer1 timer
/declare BuffTimer2 timer
/declare BuffTimer3 timer
/declare BuffTimer4 timer
/declare BuffTimer5 timer
/declare BuffIndex local

/for BuffIndex 0 to 5
   /if n @BuffTimer@BuffIndex==0 /call rebuff @BuffIndex
/next BuffIndex
- Plazmic

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sat Oct 04, 2003 12:05 am

dont_know_at_all wrote:But it's always been a string lookup more or less. I think there is something really inefficient going on.
No, before we parsed 1 char, and did an atoi, and referenced an indexed array...
Now we walk a linked list strcmping each varname against the one we want to dereference...

dont_know_at_all wrote:I'm only getting like four course adjustments per cast time, which means it takes nearly a second to do some simple math and a doevents on a PII 450. I'm going to add some more spew and see if I can figure it out.
That does sound slow, but if you are in #turbo mode, it would be 4 frames per second, unless your code is overloaded with /doevents, which could be part of the slowdown (inefficient code?)
- Plazmic

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sat Oct 04, 2003 2:19 am

Turbo is off. I will play with that...

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sat Oct 04, 2003 2:30 am

With turbo off, each /declare command will eat a full pulse cycle.
That would explain some slowdown...
- Plazmic

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Post by Plazmic » Sat Oct 04, 2003 5:25 am

DKAA noticed a memory leak if a macro does any /calls
I found leaks in both /return and EndMacro()
There will be a minor update tomorrow when I'm sober.
- Plazmic

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sat Oct 04, 2003 6:25 pm

Got the diff.

CVS and zip file are updated.

MattHensley
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sat Oct 04, 2003 7:18 pm

Arrays...

Post by MattHensley » Sat Oct 04, 2003 7:24 pm

Currently if I set an array ie..

/declare test array
/varset test(1) "testarray1"
/varset test(2) "testarray2"

and then try to echo it

/echo "test(1)"

it shows as "test(1)" in the echo...

This happening for anyone else? Are arrays still broken atm? I've tried everything under the sun to make this work but it doesn't seem to work no matter what I try. I've made sure the cases are correct as well.
-MattHensley