When your screen shows something you have set as an event, it puts it on the stack of events. These can pile up indefinatly so far as I know.
When you issue a /doevents, it gives all the events permission to process before continuing on. So each loop it checks for the DT message.
I'm not sure what you mean by /if (!${Me.Buff[Creeping Doom].ID} ) /call DT
That will call DT every cycle, unless you have Creeping Doom on you. Remove the ! and it would work. What your attempting though is redundancy. And while redundancy is ok (I'm a fan of it) your possibly allowing it to jump to the DT too many times.
What you want is:
1) Watch for trigger text or an egg to spawn
2) When one of those happens, take necessary actions, then return
So you will:
1) Make a master loop
2) In that loop call a /doevents to check for DT text
3) Check for an egg. If one exists, call an outside sub to announce it
4) Repeat the loop
Possible problems:
1) Finding the same egg every cycle, and spamming it.
Solution:
1) Check the egg ID against previous. This is assuming there is only 1 egg up at a time.
Code:
|Vishtimar.Mac - Mrktwiz
|Begin macro at 100% and should cure yourself from DT (using /throw SYB)
|and calls out egg direction in /rs
#Event DT "#*#You sense your doom approaching#*#"
Sub Main
/declare EggID int outer 0
:loop
/doevents
/if (${Spawn[npc "A Tainted Egg"].ID} && ${Spawn[npc "A Tainted Egg"].ID}!=${EggID}) /call EggSub
/goto :loop
/return
|---
|- Vish
|---------
Sub Event_DT
/target mournful
/delay 1s
/throw Shoulder My Burden
/return
|-----------
|- Set Egg ID and Announce
|--------------------------
Sub EggSub
/varset EggID ${Spawn[npc "A Tainted Egg"].ID}
/tar npc "A Tainted Egg"
/delay 2s (${Target.CleanName.Equal[A Tainted Egg]})
/face fast
/delay 2s
/rs EGG ${Me.Heading} !!!!
/return
That's my personal take on it. You were very close again though, so long as you don't mind it spamming the egg in chat every 3 seconds. Just need the following change
Code:
/if (!${Target.CleanName.Equal[A Tainted Egg.ID]}) [COLOR="red"]{[/COLOR]
/face
/delay 3s
/rs EGG ${Me.Heading} !!!!
[COLOR="Red"]}[/COLOR]
/if (!${Target.CleanName.Equal[A Tainted Egg.ID]})
Has a couple of problems. Don't take this the wrong way, but I'm going to assume you don't understand exactly how this works.
Target is a TLO. CleanName does just what it says, returns the name you see by looking at the npc, as a string. You can't use a math operation on a string. ie you can't do ${Target.Name}=="John Doe".
That's where the .Equal comes in. It compares what you have to whatever is inside of the brackets. If you want it to trigger only if it doesn't match, then use .NotEqual ie. /if (${Target.CleanName.NotEqual[Rare Pop]}) /echo Still not up...
!= means "does not equal"
== means "equals"
Both of which are math functions.
Your original line was trying to say "If my target is NOT an egg, then announce the egg to the raid"
By using .ID you cast the entire thing into an INT (integer) which can then be parsed with math. You aren't really casting it so much as extracting a number from it to work with, instead of text.
So by (!${Target.ID}) you are saying "If my target doesn't have a spawn #, do suchandsuch". And of course, if you don't have a target, it cant possibly have a spawn #. So it returns null for the ID, null is NOT a number, and so it proceses. The .ID should never be used with .Equal
And when you do use .ID it will be by itself outside of any [] brackets and right before the } bracket
All /if statements work on two conditions. Either /if (TRUE) or /if (FALSE). That's all it can return. Whatever happens inside of ( ) comes out as one of those two answers. TRUE processes. FALSE checks for an 'else' statement, or keeps going if there is none.
So
/declare Test int local 2
/if (${Test}==2) /echo I can count!
is seen as /if (TRUE) /echo I can count!
whereas
/declare Test int local 3
/if (${Test}==2) /echo I can count!
is seen as /if (FALSE) /echo I can count!
Since it's false, it doesn't echo anything.
and /if (${Test}!=2)
is the same as /if (TRUE). Because it's true that 3 does not equal 2.
If your wondering how we come up with all the types, and .Equal .CleanName .Distance .ID stuff you can look
here
(must follow along here with each step request)
TLO (Top Level Object) is the first item inside of a ${}. In this case we are working with ${Target}. So click the link Top-Level Objects. Scroll down and click Target.
You can see that Target has access to 'spawn' types. Spawn is not the same as spawn. Spawn is a TLO as well. spawn is a set of types. So click the word spawn.
All those bold words are things you can put after Target.
/echo ${Target.ConColor} would echo 'GREEN' into your MQ window on a green mob.
We are working with CleanName. Notice it says string CleanName. This lets you know that if you end it right there ${Target.CleanName} that your return will be in string form.
/if (${Target.CleanName}) /echo Stuffage..
will never ever echo. If statements have to compare something to something else. In this case you aren't comparing anything. It's not even saying "If the target has a name". It's simply "here's a name". So for it to be an if statement, we have to keep building.
If you scroll down to ID you will see it's an int type.
So click on string, beside the CleanName. These are things that you can put after CleanName. You can see Equal down there. That's how we built ${Target.CleanName.Equal[Mob]}. Equal is a bool
Bool only has 2 values. TRUE and FALSE. So when it doesn't match you have /if (FALSE). For all regards, in this example a NULL is treated as a FALSE as well. There is no half TRUE.
Coming back to /if (!${Target.CleanName.Equal[A Tainted Egg.ID]})
which should be written as /if (${Target.CleanName.Equal[A Tainted Egg]})
if you are wanting to do something when you target the egg
or /if (${Target.CleanName.NotEqual[A Tainted Egg]})
if you are wanting to do something with anything else as a target
If you knew all this, disregard. Perhaps somebody will learn something from it though.