Page 1 of 1

little help plz

Posted: Sat Jun 19, 2004 4:04 pm
by shaman001
ok i run a bard and mage in hoh sometime i forget to send pet in so i made mac to send in pet if i for get only problem is i cant get it to loop now any help would be nice on how to fix i could nto find anything to fix it

Code: Select all

#event exp "You have gained#*#" 
#event pet "Attacking a#*#"

sub main 
   /declare pet int outer
   /delay 1s
   /declare iAssistHealthPct int local
   /declare sAssistName string local
   /doevents 
   /delay 1s 
   /if (${Defined[Param0]}) {
      /varset sAssistName ${Param0}
   }

   /if (${Defined[Param1]}) {
      /varset iAssistHealthPct ${Param1}
   } else /varset iAssistHealthPct 60

   /goto :mainloop 
   /return 
       
         :Mainloop
            /delay 10
            /assist ${sAssistName}
            /delay 20
            /if ((${PetTarget}==0)&&(${Target.PctHPs}<=${iAssistHealthPct})) {
            /pet attack
            } 
            /return 

         :waitforexp 
            /doevents 
            /delay 1s 
            /doevents 
            /if (${PetTarget}<1) :goto main 
            /goto :waitforexp 
            /return

Sub Event_exp
   /varset pet 0
/return

Sub Event_pet
   /varset pet 1
/return

/echo working

/goto :main

/endmacro

Posted: Sat Jun 19, 2004 4:13 pm
by Falco72
Your

Code: Select all

#Sub Event_exp
   /varset pet 0
/return

#Sub Event_pet
   /varset pet 1
/return
should be

Code: Select all

Sub Event_exp
   /varset pet 0
/return

Sub Event_pet
   /varset pet 1
/return
Without #.

Posted: Sat Jun 19, 2004 7:55 pm
by blueninja
You were using different names for variables in several places.

Also, the only code that's executed is the stuff inside Sub Main and subs called from it. Code will execute starting from the top of Sub Main. The macro will end when it reaches a /return inside sub main, you had one too many in there.

Thus, these lines do nothing at all:

Code: Select all

/echo working 

/goto :main 

/endmacro

Code: Select all

#event exp "You have gained#*#" 
#event pet "Attacking a#*#" 

sub main 
   /declare pet int outer 
   /delay 1s 
   /declare iAssistHealthPct int local 
   /declare sAssistName string local 
   /doevents 
   /delay 1s 
   /if (${Defined[Param0]}) { 
      /varset sAssistName ${Param0} 
   } 

   /if (${Defined[Param1]}) { 
      /varset iAssistHealthPct ${Param1} 
   } else /varset iAssistHealthPct 60 

        
         :Mainloop 
            /delay 10 
            /assist ${sAssistName} 
            /delay 20 
            /if ((${pet}==0)&&(${Target.PctHPs}<=${iAssistHealthPct})) { 
            /pet attack 
            } 
            

         :waitforexp 
            /doevents 
            /delay 1s 
            /doevents 
            /if (${pet}<1) /goto :Mainloop
            /goto :waitforexp 
            /return 

Sub Event_exp 
   /varset pet 0 
/return 

Sub Event_pet 
   /varset pet 1 
/return