anoying "cannot parse Sub event_PetHealth"

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

nukem419
orc pawn
orc pawn
Posts: 24
Joined: Tue Jan 28, 2003 10:48 pm

anoying "cannot parse Sub event_PetHealth"

Post by nukem419 » Wed Jan 29, 2003 11:07 pm

i know why i get this message, but i don't know how to "send" the macro to the text imedialty after the line "Sub event_PetHealth" like you would send it inside a routine using :tags and the /goto command. btw this macro works great, but there are a few bugs and alot more features that i want to add to it. My first macro WooT

Code: Select all

#event PetHealth "Captain Boshinko"
#event KillNpc "Captain Boshinko"
#event Target "100"
Sub Main 
  /echo STARTING MACROMAGE
Sub event_PetHealth
  /press f1
  /press f1
 :petok
  /delay 5s
  /echo $target(hp,pct)
  /doevent Target
  /goto :petok
Sub event_Target
 :target
  /target NPC Captain Boshinko
  /delay 1s
  /echo %t
  /doevents KillNpc
  /delay 5s
  /goto :target
Sub event_KillNpc
 :kill
  /target NPC Captain Boshinko
  /delay 1s
  /pet attack
  /stand
  /press 3
  /delay 10s
  /sit
  /echo %t 
  /doevent PetHealth
just pretend i said something cool and unique, I have no imagination

lifewolf
a ghoul
a ghoul
Posts: 143
Joined: Fri Oct 18, 2002 6:29 pm

Re: anoying "cannot parse Sub event_PetHealth"

Post by lifewolf » Thu Jan 30, 2003 11:26 am

nukem419 wrote:i know why i get this message, but i don't know how to "send" the macro to the text imedialty after the line "Sub event_PetHealth" like you would send it inside a routine using :tags and the /goto command. btw this macro works great, but there are a few bugs and alot more features that i want to add to it. My first macro WooT

Code: Select all

#event PetHealth "Captain Boshinko"
#event KillNpc "Captain Boshinko"
#event Target "100"
Sub Main 
  /echo STARTING MACROMAGE
Sub event_PetHealth
  /press f1
  /press f1
 :petok
  /delay 5s
  /echo $target(hp,pct)
  /doevent Target
  /goto :petok
Sub event_Target
 :target
  /target NPC Captain Boshinko
  /delay 1s
  /echo %t
  /doevents KillNpc
  /delay 5s
  /goto :target
Sub event_KillNpc
 :kill
  /target NPC Captain Boshinko
  /delay 1s
  /pet attack
  /stand
  /press 3
  /delay 10s
  /sit
  /echo %t 
  /doevent PetHealth
/call Event_WhateverSub
/call HealMe
Like

Code: Select all


Sub Main 
   /echo STARTING MACROMAGE
:PHL
   /call PetHealth
   /delay 1s
   /goto :PHL
/return

Sub PetHealth
   /press f1
   /press f1
:petok
   /delay 5s
   /echo $target(hp,pct)
   /call Target
   /goto :petok

Sub Target
:target
   /target NPC Captain Boshinko
   /delay 1s
   /echo %t
   /call KillNpc
   /delay 5s
   /goto :target

Sub KillNpc
:kill
   /target NPC Captain Boshinko
   /delay 1s
   /pet attack
   /stand
   /press 3
   /delay 10s
   /sit
   /echo %t 
   /call PetHealth


That probably doesent work, because it doesent make much sense to me, but it should atleast run and screw up properly now ...

YKW-28983
a hill giant
a hill giant
Posts: 252
Joined: Sun Dec 01, 2002 11:37 pm

Post by YKW-28983 » Sat Feb 01, 2003 5:37 pm

Your subs need to have

Code: Select all

/return
at the end of them.


and you do not do /call event_blah.

add

Code: Select all

/doevents
into beginning of code.


What are you trying to do with the macro btw?

Code: Select all

#define Pet.ID "$char(pet)"

#event PetHealth "Captain Boshinko" 
#event KillNpc "Captain Boshinko" 
#event Target "100" 

Sub Main
|** This will add Captain Boshinko to an alert list and echo "Starting Macromage" **|
  /echo STARTING MACROMAGE 
  /alert add 1 npc "Captain Boshinko"
|** This will check to make sure your pet is at 100% hp's. It will loop till Pet is 100%. Once your pet is at 100% it will call the Target sub. **|

:petcheck
  /delay 5s 
  /if $spawn(Pet.ID,hp,pct)==100 {
   /call Target
  }
  /delay 0
  /goto petcheck
/return

|** This will target alert 1 (otherwise known as Captain Boshinko). It will then echo the name and call the Kill sub **|

Sub Target 
:target 
  /if $alert(1)==TRUE {
   /target alert 1
   /delay 1s 
   /echo $target(name) 
   /call Kill
   /delay 5s
   /goto :target
/return

|** This will send your pet to attack, sit and then stand, and press 3, delay 10 seconds and then sit. It will then echo your target name and move back to the pet health loop **|

Sub Kill
:kill 
  /delay 1s 
  /pet attack 
  /sit on
  /sit off
  /press 3 
  /delay 10s 
  /sit 
  /echo $target(name) 
/return
I think this is what your after.. tell me if this helps and if you need some more help.