Out of ideas, help please!

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

Eloasti
a lesser mummy
a lesser mummy
Posts: 31
Joined: Tue Feb 24, 2004 8:03 am

Out of ideas, help please!

Post by Eloasti » Tue Feb 24, 2004 4:57 pm

Hi all!

I've been trying to make a simple cleric heal script, which would be activated by me saying "Assist me on" in group chat and go back to main loop if I say "Fight over". Starting the script with "Assist me on" will work, and the script will heal. But NONE of the other Event calls will work!

I'm going crazy over this and I hope someone can point out to me where the error(s) is, because i'm out of ideas...

Here's the script;

Code: Select all

#turbo
#Chat group

| Simple cleric script by Sarah/Eloasti


#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 Stunned "You cannot cast while stunned" 
#event Collapse "Your gate is too unstable, and collapses."
#event Fight "Assist me on"
#event NoFight "Fight over"


Sub Main
	/declare SpellName global
	/declare FastHeal global
	/declare Heal global
	/declare Hotheal global
	/declare ChatText global
	/declare Spelldelay global
	/declare GroupMember global
	/declare GroupMemNum global
	/declare Owner global
	/declare Player global
	/declare Fight global
	/declare ALREADYSTART global
	/declare ALREADYSTOP global

	/varset SpellName " "
	/varset FastHeal "Ethereal Remedy"
	/varset Heal "Complete Healing"
	/varset Hotheal "Supernal Elixir"
	/varset ChatText " "
	/varset Spelldelay 0
	/varset GroupMemNum 0
	/varset GroupMember " "
	/varset Fight 0


	/gsay Starting!

:MainLoop
	/delay 0
	/if n $char(mana,pct)<50 {
		/if n @Fight==0 {
			/gsay Low mana, need to meditate.
			/sit
			/call med
			/gsay Full mana now.
			/stand
		}
	}
	/doevents
	/if "$return"=="FIGHT_START" {
		/varset Fight 1
		/call Fight
	}
/goto :MainLoop


Sub Fight
	:GroupHPCheck
		/for GroupMemNum 1 to $group(count)
		/doevents
		/if "$return"=="FIGHT_STOP" {
			/gsay Ending...
			/varset Fight 0
			/return
		}
		/varset Player $group($calc(@GroupMemNum-1)) 
		/if n @Player>0 { 
			/if n $spawn(@Player,hp,pct)<50 {
				/tar id @Player
				/delay 1s
				/call healfast
			}			
			/if n $spawn(@Player,hp,pct)<70 {
				/tar id @Player
				/delay 1s
				/call heal
			}

		}
		/next GroupMemNum
		/goto :GroupHPCheck
/return


Sub healfast
	
		/varset SpellName "@FastHeal"
		/call spell_cast
/return


Sub heal

		/varset SpellName "@Heal"
		/call spell_cast
/return


Sub med
:medloop
	/if n $char(mana,pct)==100 /return
/goto :medloop


Sub spell_cast
	/stand
	:castcast
	/cast "@SpellName"
	/doevents Event_Recover
	/if "$return"=="RECOVER" /goto :castcast
	/varset Spelldelay $spell("@SpellName",casttime)
	/gsay Casting @SpellName at %t, landing in @Spelldelay seconds.
	:WaitCast
	/if "$char(casting)"=="TRUE" { 
	/delay 1 
	/goto :WaitCast
	}
	/doevents Event_Stunned
	/if "$return"=="STUNNED" {
		/delay 3s
		/varset SpellName "@FastHeal"
		/goto :castcast
	}
	/doevents Event_Interrupt
	/if "$return"=="INTERRUPT" {
		/delay 2s
		/varset SpellName "@FastHeal"
		/goto :castcast
	}
	/doevents Event_Fizzle
	/if "$return"=="FIZZLE" /goto :castcast
	/sit
/return


Sub Gate
	/cast Gate
/return


Sub Event_Fizzle
	/call spell_cast
/return FIZZLE

Sub Event_Revover
/return RECOVER

Sub Event_Interrupt
/return INTERRUPT

Sub Event_Stunned
/return STUNNED

Sub Event_Collapse
	/delay 5
	/call cast_spell
/return

Sub Event_Chat(Group,Eloasti,"Fight over")
/return FIGHT_STOP

Sub Event_Chat(Group,Eloasti,"Assist me on")
/return FIGHT_START

Sub End
/endmacro
Please please tell me what i'm doing wrong!

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 » Tue Feb 24, 2004 5:13 pm

one event_chat only

Eloasti
a lesser mummy
a lesser mummy
Posts: 31
Joined: Tue Feb 24, 2004 8:03 am

Post by Eloasti » Tue Feb 24, 2004 5:22 pm

Hi!

Any ideas on what I could use instead?
Also, none of the other events seem to work.
For example, if the cleric starts to cast a CH and I duck to interrupt the spell, he wouldn't start over as he should, but rather go another round in the groupcheck look before he tried to heal again.

Any clues on why?

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Tue Feb 24, 2004 5:43 pm

Any ideas on what I could use instead?

Code: Select all

Sub Event_Chat(ChatType,Sender,ChatText) 
/if "@ChatText"~~"Fight over" /return FIGHT_STOP
/if "@ChatText"~~"Assist me on" /return FIGHT_START

Eloasti
a lesser mummy
a lesser mummy
Posts: 31
Joined: Tue Feb 24, 2004 8:03 am

Post by Eloasti » Tue Feb 24, 2004 5:49 pm

Oh... That was a nice solution.

Thank you!

Catt
a lesser mummy
a lesser mummy
Posts: 76
Joined: Mon Sep 16, 2002 2:49 am

Post by Catt » Fri Feb 27, 2004 3:59 am

Assuming you are in a group/raid you could look for the "You gain" in You gain (group/raid) experience! to end the fight, rather than manually saying it each time.

Or you could look for the full text of each.

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Fri Feb 27, 2004 1:53 pm

Eloasti wrote:Hi!

Any ideas on what I could use instead?
Also, none of the other events seem to work.
For example, if the cleric starts to cast a CH and I duck to interrupt the spell, he wouldn't start over as he should, but rather go another round in the groupcheck look before he tried to heal again.

Any clues on why?
Snippet of your code:

Code: Select all

   /doevents Event_Interrupt 
   /if "$return"=="INTERRUPT" { 
      /delay 2s 
      /varset SpellName "@FastHeal" 
      /goto :castcast 
   } 
   /doevents Event_Fizzle 
/doevents <name up at top in definition, not name of sub>

Should be:

Code: Select all

/doevents Interrupt
...
/doevents Fizzle
etc.

G