Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!
Moderator: MacroQuest Developers
-
[40oz]
- a hill giant

- Posts: 156
- Joined: Tue Nov 12, 2002 12:14 pm
Post
by [40oz] » Sun Dec 07, 2003 5:38 am
Is there a way to make an ARRAY of TIMERS.
Here's my thought process:
Say I want to keep track of whether or not a certain person should still have Supernal Elixer on. I have a 6 slot array of timers... Each timer is at 0 if the person doesn't have supernal elixer on, or is > 0 if they do.
This way I can use the following psuedo code:
if groupmember(health) < 70 && groupmember(health) > 30
if elixerarray[groupmember(number)] == 0 cast Supernal Elixer
else if groupmember(health <= 30
cast supernal remedy
end if
or something to that effect. this way the timers always correlate to the group number the person is in the array. otherwise I gotta keep 6 timers defined globally like "ElixTimer1" so i can use "ElixTimer@GrpMember" or something.
Thoughts, ideas?
(PS if you can't tell, I'm doing a huge overhaul on my healing macros, this is just some base groundwork i'm thinking about)
-
OldNecro
- a ghoul

- Posts: 136
- Joined: Thu Dec 19, 2002 3:09 am
Post
by OldNecro » Fri Apr 23, 2004 4:19 pm
Bumping this to see if anyone ever thought of a way to do this, rather than start my own thread about it.... heh
Saddam Hussein begins to use An Innocent Bystander as a living shield!
An Innocent Bystander ceases protecting Saddam Hussein's corpse.
-
wassup
- Official Guardian and Writer of TFM

- Posts: 1487
- Joined: Sat Oct 26, 2002 5:15 pm
Post
by wassup » Fri Apr 23, 2004 4:26 pm
To my knowledge, you can't make an array of timers, or an array of arrays for that matter.
-
ml2517
- a grimling bloodguard

- Posts: 1216
- Joined: Wed Nov 12, 2003 1:12 am
Post
by ml2517 » Fri Apr 23, 2004 4:39 pm
Read autodebuff.mac. You don't set a bunch of timers, but you track it based on a timestamp stored in an array compared to the current timestamp.
So yes, its sort of doable.
I also requested, from Lax, some sort of general purpose counter that starts timing up second by second from the time you launch MQ. I'm not sure if he has had time to look at it. With this you could do something similar to what I am doing now, but it would take alot less cpu.
-
vzfef
- decaying skeleton

- Posts: 5
- Joined: Mon Mar 01, 2004 4:30 am
Post
by vzfef » Sat Apr 24, 2004 5:43 am
What you really need is the UNIX timestamp, which is essentially an integer of the seconds since 1-1-1970. I proposed a patch, but it never got into CVS -- maybe because of the MQ2Data stuff

-
Lax
- We're not worthy!

- Posts: 3524
- Joined: Thu Oct 17, 2002 1:01 pm
- Location: ISBoxer
-
Contact:
Post
by Lax » Sat Apr 24, 2004 6:14 am
unix timestamp shimestamp.
${Time.SecondsSinceMidnight}
Resets every night at midnight but whatever. Do you want an arbitrary number that represents time in milliseconds?

-
ml2517
- a grimling bloodguard

- Posts: 1216
- Joined: Wed Nov 12, 2003 1:12 am
Post
by ml2517 » Sat Apr 24, 2004 7:04 am
I'd like an arbitrary number that starts counting upward from the first moment that Macroquest gets attached to EQ.
Milliseconds would be best, but please have it be able to use members of .Seconds .Minutes etc.
This is going to be the best case scenario for my uses.
-
vzfef
- decaying skeleton

- Posts: 5
- Joined: Mon Mar 01, 2004 4:30 am
Post
by vzfef » Sat Apr 24, 2004 10:41 am
Lax wrote:unix timestamp shimestamp.
${Time.SecondsSinceMidnight}
Resets every night at midnight but whatever.
Exactly that is the reason why the AutoDebuff Script will go frenzy at midnight: Every tracked mob in the arrays will have a timestamp value higher than 0, which is, uhm, exactly the number of seconds since midnight. Well, some people tend to play around midnight...
-
ml2517
- a grimling bloodguard

- Posts: 1216
- Joined: Wed Nov 12, 2003 1:12 am
Post
by ml2517 » Sat Apr 24, 2004 12:06 pm
Yeah this is a known issue and there really hasn't been anything I could do about it until I get something like what I am asking for. Hopefully we'll have it in the next zip?

-
Lax
- We're not worthy!

- Posts: 3524
- Joined: Thu Oct 17, 2002 1:01 pm
- Location: ISBoxer
-
Contact:
Post
by Lax » Sat Apr 24, 2004 2:20 pm
int macroquest.Running: Running time of current MQ2 session, in milliseconds
next zip
-
ml2517
- a grimling bloodguard

- Posts: 1216
- Joined: Wed Nov 12, 2003 1:12 am
Post
by ml2517 » Sat Apr 24, 2004 2:28 pm
Yay!

-
dok
- a ghoul

- Posts: 127
- Joined: Mon Mar 15, 2004 3:38 pm
Post
by dok » Sat Apr 24, 2004 3:39 pm
I use ${Macro.RunTime} myself to keep track of time elapsed. it returns the seconds the macro has been running. Unless using an ini file to store the timers, this works just as good as any propper timestamp for tracking time.
-
ml2517
- a grimling bloodguard

- Posts: 1216
- Joined: Wed Nov 12, 2003 1:12 am
Post
by ml2517 » Sat Apr 24, 2004 3:46 pm
How the hell did I miss that heh.