Need help writing a recast during interrupt and/or fizzle

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

Gellenole
orc pawn
orc pawn
Posts: 20
Joined: Wed Oct 29, 2003 10:28 pm

Need help writing a recast during interrupt and/or fizzle

Post by Gellenole » Tue Nov 04, 2003 8:16 pm

I only included this part... but it should be enough for you guys to understand and help ^^ thnx ahead of time!

Code: Select all

Sub Spellcast
	:recast
	/doevents
	/if @Casteagle_Flag=="1" {
		/cast "Eagle Eye"
		/varset Casteagle_Flag 0
	}

	
	/if @CastsoE_Flag=="1" {
		/press tab
		/cast "Spirit of Eagle"
		/varset CastsoE_Flag 0
	}

	/if @Nalot_Flag=="1" {
		/cast item "Eyepatch of Plunder"
		/varset Nalot_Flag 0
	}
	/goto :recast
			
/return

| --> EVENTS DONE by #EVENT

Sub Event_EAGLEEYE
	/Echo (re)casting Eagle Eye
	/varset Casteagle_Flag 1
/return 

Sub Event_SPIRITOF
	/Echo (re)casting Spirit of Eagle
	/varset CastsoE_Flag 1
/return	

Sub Event_FIZZLE
	/ECHO You Fizzle.
	/varset Fizz_Flag 1
/return

| -->The 4 haste events is to ensure you to keep haste 100% of the time on yourself.
| -->Only when you begin with selfbuffs
Sub Event_HASTE
	/Echo (re)casting Captain Nalot's Quickening
	/varset Nalot_Flag 1
	/call Spellcast
/return

| -->These #Events are described as:  E = Enchanter S = Shaman  S2 = Shaman
| -->When these spells fade, it checks whether you are still targetting an NPC (hopefully while in battle)
| -->When the haste fades during battle it will trigger an event and cast your selfhaste item on you
| -->This minimizes the dramatic loss of DPS during the fight.
Sub Event_HASTE_E
	/if $target(type)=="NPC" {
		/Echo (re)casting Captain Nalot's Quickening
		/varset Nalot_Flag 1
		/call Spellcast
	}
/return

Sub Event_HASTE_S
	/if $target(type)=="NPC" {
		/Echo (re)casting Captain Nalot's Quickening
		/varset Nalot_Flag 1
		/call Spellcast
	}
/return

Sub Event_HASTE_S2
	/if $target(type)=="NPC" {
		/Echo (re)casting Captain Nalot's Quickening
		/varset Nalot_Flag 1
		/call Spellcast
	}
/return

Sub Event_SLAINBY
	/Echo Slained Event Entered
	/endmacro
/return

nosirs

Post by nosirs » Wed Nov 05, 2003 2:20 am

Add an event and have it retry until you get the haste message (You are filled by the spirit of water?). Have the event set your cast flag to 0.

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

Post by MattHensley » Wed Nov 05, 2003 2:45 am

If it's for buffs you can always do something like :

:loop
/if n $char(buff,"buffname")==0 {
/doevents
/target myself
/cast "buffname"
/goto :loop
}
-MattHensley

MrSmallie
a hill giant
a hill giant
Posts: 167
Joined: Fri Oct 11, 2002 11:18 am

Post by MrSmallie » Wed Nov 05, 2003 9:13 am

Are the event triggered flags not working for you? (Fizzflag=1)

Joshjje
orc pawn
orc pawn
Posts: 18
Joined: Mon Oct 27, 2003 2:39 pm

..

Post by Joshjje » Thu Nov 06, 2003 3:21 pm

I didnt look at your code at all, but i included what i wrote myself for my own sub. To use it just /call spell# It will cast the spell then check for events and each event will return an error which will restart the loop and cast again, every loop clearreturnvalue is called which resets the return value so on a succesful cast it doesnt equal the error and the cast is not recasted. Only thing you might want to edit is the /delay 75 after the spell cast perhaps put a parameter there..also i included no Sub MedTime presumably you would /sit /delay # /stand to med a little, hope this helps.

Code: Select all

#event Fizzle "Your spell fizzles!"
#event Interrupt "Your casting has been interrupted!"
#event Interrupt "Your spell is interrupted."
#event Recover "You haven't recovered yet..."
#event Recover "Spell recovery time not yet met."
#event Collapse "Your gate is too unstable, and collapses."
#event MedTime "Insufficient Mana to cast this spell" 

|===============================================
Sub CastSpell
:StartCast
/call ClearReturnValue
/delay 15
/cast @Param0
/delay 75
/doevents Interrupt
/doevents Fizzle
/doevents Recover
/doevents Collapse
/doevents MedTime
/delay 15
/if "$return"=="CAST_RESTART" /goto :StartCast

/return
|===============================================
Sub Event_Fizzle
/return CAST_RESTART
|===============================================
Sub Event_Interrupt
/echo yaya!
/return CAST_RESTART
|===============================================
Sub Event_Recover 
   /delay 5 
/return CAST_RESTART
|===============================================
Sub Event_Collapse 
/return CAST_RESTART
|===============================================
Sub ClearReturnValue 
/return CAST_SUCCESS
|===============================================

After looking at your code however lol i noticed some things

the /doevents should be right after the /cast spell (ADD A DELAY appropriate to the amount of time it takes to cast the spells) then in the events instead of /return try /return ERROR then check to see if the return is ERROR like i did above and if it is recast, but youd have to have a sub to clear the return value at the beginning of each loop.