Help plz, i have this error when running this CHchain macro

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

mauroxx
orc pawn
orc pawn
Posts: 24
Joined: Mon Jan 31, 2005 5:23 am

Help plz, i have this error when running this CHchain macro

Post by mauroxx » Tue Feb 01, 2005 12:43 pm

Image

Code: Select all

#Include spell_routines.inc 
#Chat Chat 
#Chat tell 
#turbo


|Spells used to heal and info on cleric
/declare healspell string outer Complete Healing
/declare fasthealspell string outer Pious Remedy
/declare hotspell string outer Pious Elixir
/declare nextclericname string outer ${Me.name}
/declare mynumber int outer 1
/declare autohealmode int outer 0
/declare interrupt2healself int outer 1
/declare interrupt2healselfhp int outer 30

|default options
/declare CHdly int outer 30 
/declare allowquickheal int outer 0
/declare autosit int outer 0
/declare announce int outer 1 

/declare tankname string outer ${Target} 
/declare tanknameid int outer ${Target.id}
/declare tankclass string outer
/declare lowhealth int outer 25
/declare oomspam int outer 1 
/declare lomspam int outer 1 
/declare duckspam int outer 1 
/declare duckfdspam int outer 1 
/declare duckselfspam int outer 1 
/declare nomtspam int outer 1 


Sub Main 



/if (!${Target.ID}) { 
      /echo Target the Tank when you run this macro to designate him as MT 
      /end 
   } else { 
      /varset tanknameid ${Target.ID}
   } 

   /if (${Defined[Param0]}) {    
      /varset CHdly ${Param0} 
   } else /echo No CHchain delay specified, defaulting to 3s 
    
   /if (!${Defined[Param1]}) {    
      /echo Usage: /mac CHchain (delay) (1|0) (nextclericname) (myclericnumber)
      /echo Example: /mac CHchain 30 1 Allakhazam 5
      /echo Defaulting CH chain to ${CHdly} and NOT ALLOWING to duck and quick heal when tank arrives to 25% life 
   } else {     
      /varset allowquickheal ${Param1}
      /echo Setting CH chain to ${CHdly} and ALLOWING to duck and quick heal when tank arrives to 25% life
      }
   /if (!${Defined[Param2]}) {
      /varset nextclericname ${Me.Name}
      /echo You are the only healer.
   } else {
      /varset nextclericname ${param2}
      /echo ${param2} is the cleric that will heal ${tankname}
   }
   /if (!${Defined[Param3]}) {
      /varset mynumber 1
   } else {
      /varset nmynumber ${param3}
      /echo I am the (${param3}) cleric in CH chain
   }
/echo CH chain started.
/echo Casting ${healspell} on ${tankname} with ${CHdly} delay.

|beginning of the cycle to ceck raidchat

:chchainloop
   /if ((${ChatText.Equal[$(Me.Name) next]})||(${ChatText.Equal[next $(Me.Name)]})){
   /delay ${CHdly}
   /if (${String[${Spawn[${tanknameid}]}].NotEqual[${tankname}]}) /varset tanknameid 0 
   /if (!${Spawn[${tanknameid}].ID}) /if (${Spawn[${tankname}].ID}) { 
      /if (${SpawnCount[${tankname} ${tankclass}]}==1) { 
         /varset tanknameid ${Spawn[${tankname} ${tankclass}].ID} 
         /echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid} 
      } 
      /if (${SpawnCount[${tankname} ${tankclass}]}>1) { 
         /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) { 
            /beep 
            /varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID} 
            /echo Defaulting to PC ${Spawn[pc ${tankname} ${tankclass}].Name} as MT. If incorrect, please restart macro 
         } else { 
            /beep 
            /echo Need to restart macro to correctly identify the MT 
         } 
      } 
   } 
   /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.Equal[Corpse]}) { 
      /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) { 
         /varset tanknameid ${Spawn[pc ${tankname ${tankclass}}].ID} 
         /echo ${Spawn[pc ${tankname} ${tankclass}].Name} is MT and has ID# ${tanknameid}. If incorrect, please restart macro 
      } 
   } 
   /if ((!${Target.ID})||(${Target.ID}!=${tanknameid})) { 
      /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) { 
         /target id ${tanknameid} 
         /delay 6 ${Target.ID}==${tanknameid} 
      } 
   } 
   /if (!${Spawn[${tanknameid}].ID}) { 
      /if (${nomtspam}==1) { 
         /e Warning No Designated MT is available 
         /timed 300 /varset nomtspam 1 
         /varset nomtspam 0 
      } 
   } 
   /if ((${Me.PctMana}<=20)&&(${announce}==1)&&(${lomspam}==1)) { 
      /rs ${Me.PctMana} % mana 
      /varset lomspam 0 
      /timed 300 /varset lomspam 1 
   } 
   /if ((${Me.PctMana}<=7)&&(${announce}==1)&&(${oomspam}==1)) { 
      /rs OOM skip me 
      /varset oomspam 0 
      /timed 300 /varset oomspam 1 
      /call MedTime 
   } 
    

|end of varioust ceck.... real healing now
   
   /if (${Target.Distance}<=${healspellrange}) { 
      /if (${announce}==1) /rs Casting ${healspell} on %T next ${nextclericname} (${mynumber})
         /call Cast "${healspell}" gem9 2s Lowhpheal  
      } 
      /call CheckEvents 
   } 
   /if ((${autosit}>=1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) { 
      /if ((${Me.PctMana}>98)||(${Me.PctHPs}<=90)) /stand 
   } 
   /if ((${autosit}==1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) { 
      /if (${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]}) /stand 
   } 
   /if (${autohealmode}==0) { 
      /call CheckEvents 
      /goto :chchainloop
   } else {
   /if ((${autohealmode}>=1)&&(${Me.PctHPs}<=40)) /call Healself
   }    
   /goto :chchainloop
}
/return


Sub Lowhpheal 
   /if (!${Window[CastingWindow].Open}) /return 
   /if ((${allowquickheal}>=1)&&(${Target.PctHPs}<=${lowhealth})) { 
      /if ((${announce}==1)&&(${duckspam}==1)) { 
         /e Ducking heal on ${Target.Name} 
         /call Healself
	 /varset duckspam 0 
         /timed 60 /varset duckspam 1 
      } 
      /call Interrupt 
      /return 
   } 
   /if ((${interrupt2healself}==1)&&(${Target.Name.NotEqual[${Me}]})&&(${Me.PctHPs}<${interrupt2healselfhp})) { 
      /if ((${usedivarb}==1)&&(${Me.PctHPs}<=${divarbpoint})&&(${Me.AltAbilityReady[Divine Arbitration]})) { 
         /call Interrupt 
         /call Divarbcast
	 /rs Interrupted for Divine Arbitration, SKIP me, ${nextclericname} CH now 
         /return 
      } 
      /if ((${announce}==1)&&(${duckselfspam}==1)) { 
         /rs Ducking heal on %T, need to heal myself, SKIP me, ${nextclericname} CH now 
         /e Ducking heal on ${Target}, need to heal myself, SKIP me, ${nextclericname} CH now
         /varset duckselfspam 0 
         /timed 60 /varset duckselfspam 1 
      } 
      /call Interrupt 
      /return 
   } 
  }
/return


Sub Healself 
   /if (${Me.PctHPs}>55) /return 
   /target myself 
   /delay 6 ${Target.Name.Equal[${Me}]} 
     /if (${Target.Name.Equal[${Me}]}) { 
      /if (${announce}==1) 
            /call Cast "${patchheal}" gem2 1s Lowhpheal 
            /rs Ducking CH on %T, ${fasthealspell} on %T 
            /delay 15 ${Me.SpellReady[${fasthealspell}]} 
         } 
      } 
      /if ((${Me.PctHPs}<=20&&(${Me.SpellReady[${daspell}]})) { 
         /if (${announce}==1) /rs Casting DA!! <<WARNING>> DA!! No Heals for 18 SECONDS SKIP ME (${mynumber}
         :retryda 
         /call Cast "${daspell}" 
         /delay 1 
         /if ((!${Me.Buff[${daspell}].ID})&&(${Me.SpellReady[${daspell}]})) /goto :retryda 
         :dawait 
         /if (${Me.Buff[${daspell}].ID}) { 
            /delay 1s !${Me.Buff[${daspell}].ID} 
            /call CheckEvents 
            /goto :dawait 
         } 
      }            
   } 
   /if (${Me.PctHPs}<=55) { 
      /target myself 
      /delay 6 ${Target.Name.Equal[${Me}]} 
      /if (${Target.Name.Equal[${Me}]}) { 
         /if (${announce}==1) /rs Casting ${fasthealspell} on %T 
         /call Cast "${fasthealspell}" gem2 1s Lowhpheal 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } 
   } 
/return 
 
Sub CheckEvents 
   /delay 1 
   /doevents Chat 
   /doevents tell 
   /doevents flush 
/return 


/echo ending 
/endmacro
any help is appreciated, i think the problem is most on how to keep cecked the raidchat with a cycle, i dont really know where to close the cycle...

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Tue Feb 01, 2005 12:53 pm

The lines associated with the problem you are having are listed right there in your picture of your MQ2Chat window.
lines 43, 47, 55, 59, 66, and 77.

I hope you have an editor that has line numbering in it so you don't have to count them manually.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

Useless
a ghoul
a ghoul
Posts: 84
Joined: Fri Jul 16, 2004 2:29 pm

Post by Useless » Tue Feb 01, 2005 3:32 pm

REAL men use notepad :twisted:



OK maybe real dum men.......
Absolutly Useless
Why lie?

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Tue Feb 01, 2005 4:01 pm

I prefer my Tribal
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!

Zeus
a hill giant
a hill giant
Posts: 180
Joined: Wed Feb 19, 2003 10:03 am
Contact:

Post by Zeus » Tue Feb 01, 2005 7:29 pm

Try declaring them inside the main.

mauroxx
orc pawn
orc pawn
Posts: 24
Joined: Mon Jan 31, 2005 5:23 am

textpad

Post by mauroxx » Wed Feb 02, 2005 2:37 am

textpad owns :D

still having problems tho

wizzyman
a ghoul
a ghoul
Posts: 106
Joined: Fri Dec 10, 2004 6:03 pm

Post by wizzyman » Wed Feb 02, 2005 8:41 am

Code: Select all


#Include spell_routines.inc 
#Chat Chat 
#Chat tell

Sub Main 

|Spells used to heal and info on cleric 
/declare healspell string outer Complete Healing 
/declare fasthealspell string outer Pious Remedy 
/declare hotspell string outer Pious Elixir 
/declare nextclericname string outer ${Me.CleanName} 
/declare mynumber int outer 1 
/declare autohealmode int outer 0 
/declare interrupt2healself int outer 1 
/declare interrupt2healselfhp int outer 30 

|default options 
/declare CHdly int outer 30 
/declare allowquickheal int outer 0 
/declare autosit int outer 0 
/declare announce int outer 1 

/declare tankname string outer ${Target} 
/declare tanknameid int outer ${Target.ID} 
/declare tankclass string outer 
/declare lowhealth int outer 25 
/declare oomspam int outer 1 
/declare lomspam int outer 1 
/declare duckspam int outer 1 
/declare duckfdspam int outer 1 
/declare duckselfspam int outer 1 
/declare nomtspam int outer 1 

:Main_loop

/if (!${Target.ID}) { 
   /echo Target the Tank when you run this macro to designate him as MT 
   /endmacro
} else { 
   /varset tanknameid ${Target.ID} 
} 

/if (${Defined[Param0]}) {    
   /varset CHdly ${Param0} 
} else /echo No CHchain delay specified, defaulting to 3s 
    
/if (!${Defined[Param1]}) {    
   /echo Usage: /mac CHchain (delay) (1|0) (nextclericname) (myclericnumber) 
   /echo Example: /mac CHchain 30 1 Allakhazam 5 
   /echo Defaulting CH chain to ${CHdly} and NOT ALLOWING to duck and quick heal when tank arrives to 25% life 
} else {      
   /varset allowquickheal ${Param1} 
   /echo Setting CH chain to ${CHdly} and ALLOWING to duck and quick heal when tank arrives to 25% life 
} 
/if (!${Defined[Param2]}) { 
   /varset nextclericname ${Me.Name} 
   /echo You are the only healer. 
} else { 
   /varset nextclericname ${param2} 
   /echo ${param2} is the cleric that will heal ${tankname} 
} 
/if (!${Defined[Param3]}) { 
   /varset mynumber 1 
} else { 
   /varset mynumber ${param3} 
   /echo I am the (${param3}) cleric in CH chain 
} 
/echo CH chain started. 
/echo Casting ${healspell} on ${tankname} with ${CHdly} delay. 

|beginning of the cycle to check raidchat 

:chchainloop 
/if ((${ChatText.Equal[$(Me.Name) next]})||(${ChatText.Equal[next $(Me.Name)]})) { 
   /delay ${CHdly} 
   /if (${String[${Spawn[${tanknameid}]}].NotEqual[${tankname}]}) /varset tanknameid 0 
   /if (!${Spawn[${tanknameid}].ID}) /if (${Spawn[${tankname}].ID}) { 
      /if (${SpawnCount[${tankname} ${tankclass}]}==1) { 
         /varset tanknameid ${Spawn[${tankname} ${tankclass}].ID} 
         /echo ${Spawn[${tankname} ${tankclass}].Name} is the designated MT and has ID# ${tanknameid} 
      } 
      /if (${SpawnCount[${tankname} ${tankclass}]}>1) { 
         /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) { 
            /beep 
            /varset tanknameid ${Spawn[pc ${tankname} ${tankclass}].ID} 
            /echo Defaulting to PC ${Spawn[pc ${tankname} ${tankclass}].Name} as MT. If incorrect, please restart macro 
         } else { 
            /beep 
            /echo Need to restart macro to correctly identify the MT 
         } 
      } 
   }
} 
/if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.Equal[Corpse]}) { 
   /if (${SpawnCount[pc ${tankname} ${tankclass}]}==1) { 
      /varset tanknameid ${Spawn[pc ${tankname ${tankclass}}].ID} 
      /echo ${Spawn[pc ${tankname} ${tankclass}].Name} is MT and has ID# ${tanknameid}. If incorrect, please restart macro 
   } 
} 
/if ((!${Target.ID})||(${Target.ID}!=${tanknameid})) { 
   /if (${Spawn[${tanknameid}].ID}) /if (${Spawn[${tanknameid}].Type.NotEqual[Corpse]}) { 
      /target id ${tanknameid} 
      /delay 6 ${Target.ID}==${tanknameid} 
   } 
} 
/if (!${Spawn[${tanknameid}].ID}) { 
   /if (${nomtspam}==1) { 
      /e Warning No Designated MT is available 
      /timed 300 /varset nomtspam 1 
      /varset nomtspam 0 
   } 
} 
/if ((${Me.PctMana}<=20)&&(${announce}==1)&&(${lomspam}==1)) { 
   /rs ${Me.PctMana} % mana 
   /varset lomspam 0 
   /timed 300 /varset lomspam 1 
} 
/if ((${Me.PctMana}<=7)&&(${announce}==1)&&(${oomspam}==1)) { 
   /rs OOM skip me 
   /varset oomspam 0 
   /timed 300 /varset oomspam 1 
   /call MedTime 
} 
    

|end of various check.... real healing now 
    
/if (${Target.Distance}<=${healspellrange}) { 
   /if (${announce}==1) /rs Casting ${healspell} on %T next ${nextclericname} (${mynumber}) 
      /call Cast "${healspell}" gem9 2s Lowhpheal  
   } 
   /call CheckEvents 
} 
/if ((${autosit}>=1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) { 
   /if ((${Me.PctMana}>98)||(${Me.PctHPs}<=90)) /stand 
} 
/if ((${autosit}==1)&&(${Bool[${Me.Sitting}]})&&(!${Window[SpellBookWnd].Open})) { 
   /if (${NearestSpawn[NPC].Distance}<=${Math.Calc[${NearestSpawn[NPC].MaxRange}+${Math.Calc[${distancetosit}/3]}]}) /stand 
} 
/if (${autohealmode}==0) { 
   /call CheckEvents 
   /goto :chchainloop 
} else { 
   /if ((${autohealmode}>=1)&&(${Me.PctHPs}<=40)) /call Healself 
}    
/goto :chchainloop 
}
/goto :Main_loop 
/return 


Sub Lowhpheal 
   /if (!${Window[CastingWindow].Open}) /return 
   /if ((${allowquickheal}>=1)&&(${Target.PctHPs}<=${lowhealth})) { 
      /if ((${announce}==1)&&(${duckspam}==1)) { 
         /e Ducking heal on ${Target.Name} 
         /call Healself 
    /varset duckspam 0 
         /timed 60 /varset duckspam 1 
      } 
      /call Interrupt 
      /return 
   } 
   /if ((${interrupt2healself}==1)&&(${Target.Name.NotEqual[${Me}]})&&(${Me.PctHPs}<${interrupt2healselfhp})) { 
      /if ((${usedivarb}==1)&&(${Me.PctHPs}<=${divarbpoint})&&(${Me.AltAbilityReady[Divine Arbitration]})) { 
         /call Interrupt 
         /call Divarbcast 
    /rs Interrupted for Divine Arbitration, SKIP me, ${nextclericname} CH now 
         /return 
      } 
      /if ((${announce}==1)&&(${duckselfspam}==1)) { 
         /rs Ducking heal on %T, need to heal myself, SKIP me, ${nextclericname} CH now 
         /e Ducking heal on ${Target}, need to heal myself, SKIP me, ${nextclericname} CH now 
         /varset duckselfspam 0 
         /timed 60 /varset duckselfspam 1 
      } 
      /call Interrupt 
      /return 
   } 
  } 
/return 


Sub Healself 
   /if (${Me.PctHPs}>55) /return 
   /target myself 
   /delay 6 ${Target.Name.Equal[${Me}]} 
     /if (${Target.Name.Equal[${Me}]}) { 
      /if (${announce}==1) 
            /call Cast "${patchheal}" gem2 1s Lowhpheal 
            /rs Ducking CH on %T, ${fasthealspell} on %T 
            /delay 15 ${Me.SpellReady[${fasthealspell}]} 
         } 
      } 
      /if ((${Me.PctHPs}<=20&&(${Me.SpellReady[${daspell}]})) { 
         /if (${announce}==1) /rs Casting DA!! <<WARNING>> DA!! No Heals for 18 SECONDS SKIP ME (${mynumber} 
         :retryda 
         /call Cast "${daspell}" 
         /delay 1 
         /if ((!${Me.Buff[${daspell}].ID})&&(${Me.SpellReady[${daspell}]})) /goto :retryda 
         :dawait 
         /if (${Me.Buff[${daspell}].ID}) { 
            /delay 1s !${Me.Buff[${daspell}].ID} 
            /call CheckEvents 
            /goto :dawait 
         } 
      }            
   } 
   /if (${Me.PctHPs}<=55) { 
      /target myself 
      /delay 6 ${Target.Name.Equal[${Me}]} 
      /if (${Target.Name.Equal[${Me}]}) { 
         /if (${announce}==1) /rs Casting ${fasthealspell} on %T 
         /call Cast "${fasthealspell}" gem2 1s Lowhpheal 
         /delay 15 ${Me.SpellReady[${patchheal}]} 
      } 
   }
 
/return 
  
Sub CheckEvents 
   /delay 1 
   /doevents Chat 
   /doevents tell 
   /doevents flush 
/return 


/echo ending 
/endmacro

try this, not tested but many fix..