Page 1 of 1

Help with spell recasting

Posted: Wed Sep 01, 2004 6:06 pm
by Lane
Hey everyone. In the macro below once Blood of Thule wears off it keeps trying to cast it on the mob. Not sure what could be wrong and thought I had looked at everything. Maybe a new set of eyes will help.

What happens:
1. Cast snare, funeral pyre, Blood of Thule
2. Start macroing the kite, pet gets sent, saryrn's kiss gets cast
3. Blood of thule wears off, and at next stop start to cast again
4. Every time I stop, blood gets cast.

Saryn's kiss works just fine.

Any help would be appriciated.

-Lane

Code: Select all


| Necrokite2.mac
| Originally By: Terramantian however highly modified by Lane
|
| Kiting macro for a 65 necromancer in a specific zone.
| Pull mob with Darkness, FP, and BT already applied, start macro


#turbo
#include spell_routines.inc
#include move.inc

#event Hit "#*#YOU for#*#"
#event exp "#*#experience!#*#"
#event blood "#*#Blood of Thule#*#"

Sub Main
   /declare PetAttacking bool outer
   /declare Sarynson bool outer
   /declare Bloodofon bool outer
   /declare startexp outer 0
   /declare startaaxp outer 0
   /declare currentxp outer 0
   /declare xpgain outer 0
   /declare currentaa outer 0
   /declare aagain outer 0

   /varset PetAttacking 0
   /varset Sarynson 0
   /varset Bloodofon 1
   /varset startexp ${Me.PctExp}
   /varset startaaxp ${Me.PctAAExp}

:Loop

   /delay 2s (${Target.Distance} <= 120)
      /call MoveToLoc -363 947

/doevents
/call checkpet
/call checkdots

   /delay 5s (${Target.Distance} <= 120)
	/call MoveToLoc -520 948

/doevents
/call checkpet
/call checkdots

   /delay 5s (${Target.Distance} <= 120)
	/call MoveToLoc -440 763

/doevents
/call checkpet
/call checkdots

   /delay 5s (${Target.Distance} <= 120)
	/call MoveToLoc -242 805

/doevents
/call checkpet
/call checkdots

/goto :Loop

Sub safe
 	/call MoveToLoc -363 947
/return

Sub checkpet
   /if ((!${PetAttacking}) && (${Target.PctHPs} < 90)) {
      /pet attack
      /varset PetAttacking 1
	}
/return

Sub checkdots
/if ((!${Sarynson}) && (${Target.Distance} >= 165)) {
		/delay 1s
		/call cast "Saryrn's Kiss" 2	
		/delay 1s	
		/varset Sarynson 1
	}


/if ((!${Bloodofon}) && (${Target.Distance} >= 165)) {
		/delay 1s
		/call cast "Blood of Thule" 5	
		/delay 1s	
		/varset Bloodofon 1
	}
/return

Sub Event_exp
   /varset currentxp ${Me.PctExp}
   /varset xpgain ${Math.Calc[${currentxp}-${startexp}]}
   /varset currentaa ${Me.PctAAExp}
   /varset aagain ${Math.Calc[${currentaa}-${startaaxp}]}
      /popup "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa"
      /echo "Gain: ${xpgain}% xp - ${aagain}% aa ## Cur: ${Me.PctExp}% xp - ${Me.PctAAExp}% aa"
   /varset startexp ${Me.PctExp}
   /varset startaaxp ${Me.PctAAExp}

  /end
/return

Sub Event_blood
	/varset Bloodofon 0
/return


Posted: Wed Sep 01, 2004 6:54 pm
by aChallenged1

Code: Select all

Sub Event_blood 
   /varset Bloodofon 0 
/return 
I notice that there isn't such a sub for Saryn, which you say works properly. They both have the exact same format of /if statements, so the only difference is that, the event. Try taking it out and see what happens.

Posted: Wed Sep 01, 2004 7:02 pm
by Lane
Actually, Blood is cast before the macro start. So I set the variable at 1 when I start, then I need this event to see when it drops because I want to cast it again. Saryrn's almost never runs out before the mob is dead so I never bother to set it back to 0 so that I will cast it again.
They both have the exact same format of /if statements,
Which is what's really pissing me off that it doesn't work right. :)

-Lane

Posted: Wed Sep 01, 2004 7:10 pm
by aChallenged1
Ok then I think there is a miscommunication here.
Lane wrote:In the macro below once Blood of Thule wears off it keeps trying to cast it on the mob.
Which I take to mean you don't want it casting it again.

Now it sounds like you are having an issue with it casting non stop.
Perhaps after the Bloodof event you should /doevents flush? I'm not totally sure how that works, but from my understanding it should do exactly that, flush your event buffer clear of everything. Problem is that this could cause you to miss something, but what is the likelyhood of that?

Posted: Wed Sep 01, 2004 7:46 pm
by Lane
/doevents flush
Wow, simple command makes things work much better.... Thanks aC1.

-Lane

Posted: Wed Sep 01, 2004 7:51 pm
by aChallenged1
Have you tried it and found it to work then?

Posted: Thu Sep 02, 2004 6:57 am
by blueninja
You're matching your blood event after the string "blood of thule" which would not only be triggered by the text you see when it wears off but also from for example "You begin casting Blood of Thule" and "MobX has taken 100 damage from your Blood of Thule". Make the event "Your Blood of Thule spell has worn off." or whatever the message is instead.

Posted: Thu Sep 02, 2004 7:56 am
by aChallenged1
"#*#Blood of#*#worn off#*#"

Posted: Thu Sep 02, 2004 8:17 am
by Cr4zyb4rd
Um, aC1, what's so terrible about doing the (much faster...not that it matters in a macro) exact string match?

Posted: Thu Sep 02, 2004 8:39 am
by aChallenged1
Because I don't have it in front of me? But yeah, exact would be better.

I think it would be "#*#Your Blood of Thule spell has worn off."

Posted: Thu Sep 02, 2004 6:56 pm
by Lane
Yes. Flushing the events worked. I made the mistake of thinking that they would get dumped once I did a /doevents.

Doing it on exact match would be better, I agree, and now I'm wondering why it doesn't keep casting because it's not. Oh, I know why. I call the cast, then flush the events (in the macro I have on my puter), so I flush whatever event happens while I'm casting (i.e. You begin casting blood of thule. Otherwise I would be casting over and over. That's probably not the best option either as I could lose other events later on if this macro grows.

Thanks for all the good ideas.

-Lane