Page 1 of 2

practice.mac - practice spells w/ features (upd. 8/4/04)

Posted: Sat Jul 31, 2004 9:40 pm
by JP5
August 4, 2004 Update:
Changes:
- Hitting ESC leaves macro and gives you results.
- Better clarity loop that meds up if you don't have enough mana to cast it.
- Macro now only quits out if you have finished skilling up the skill you were practicing as a main skill. Maxing out Meditation or Channeling will no longer end the macro.
- Better medding loop that allows for spellcasting while in the med loop without spamming you.

Please tell me if something goes wrong, although I have tested this macro and have not run across any mistakes yet.

Code: Select all


|**
Usage: /macro practice [gem#] [target]

Example: /macro practice 5 Gobartik

Target is optional. Default is ${Me} when not defined.

If you want to stop practicing, Hit ESC.

When macro is terminated (with ESC or skill maxed out),you will be 
given a report on your skillups.

As long as your DD doesn't do >20% damage to yourself, you won't die
from nuking yourself......
**|

#event NotTakeHold "Your spell did not take hold."
#event ClarityFades "The cool breeze fades."
#event SkillUp "You have become better at #1#! (#2#)"
#event ESC "You no longer have a target."

Sub Main
/declare GemNumber int outer
/declare PTarget string outer

/if (${Defined[Param0]}) {

  /varset GemNumber ${Param0}
  /echo Practicing ${Spell[${Me.Gem[${GemNumber}]}].Skill}. Hit ESC at any time to end and see results.
  } else {
  
  /echo Usage: /macro practice [gem#] [target]
  /echo Which spell would you like to practice?
  /endmacro
  }

/if (${Defined[Param1]}) {
  /varset PTarget ${Param1}
  } else {
  /echo No target defined. Defaulting to ${Me}.
  /varset PTarget ${Me}
  }
  

/declare MainSkillUp int outer 0
/declare SecSkillUp int outer 0

:start
/stand
/target ${PTarget}

:bleh
/doevents
/if (${Me.SpellReady[${GemNumber}]}) {
  /if (${Me.Gem[${GemNumber}].Mana} > ${Me.CurrentMana}) {
    /sit
    /goto :medup
    }
  /if (${Me.PctHPs}<20) {
    /sit
    /echo Ending Macro. HPs are too low.
    /call Results
    }
  /if (${Me.State.NotEqual[STAND]}) {
    /stand
    /delay 1
    }
  /if (${Math.Calc[${Me.Level}*5+5]}==${Me.Skill[${Spell[${Me.Gem[${GemNumber}]}].Skill}]}) {
    /call Results
    }
  /goto :cast
  } else {
  /goto :bleh
  }

:cast
  /cast ${GemNumber}
  /goto :bleh

:medup
/doevents
/if (${Me.State.NotEqual[SIT]}) {
  /delay 10
  /sit
  }
/if (${Me.CurrentMana}==${Me.MaxMana}) {
  /goto :start
  } else {
  /goto :medup
  }

/return

|-- Sub Event_ClarityFades
Sub Event_ClarityFades
:test	
/if (${Me.Class.Name.Equal[Enchanter]}) {
  /if (${Me.SpellReady[Clarity]}) {
    /if (${Me.CurrentMana}>${Spell[Clarity].Mana}) {
      /stand
      /cast Clarity
      } else {
      /sit
      /goto :test
      }
    } else {
    /goto :test
    }
  }
/return

|-- Sub Event_NotTakeHold
Sub Event_NotTakeHold
/echo Macro ended. Invalid Target.
/call Results
/return

Sub Event_ESC
/echo Macro Ended by user.
/call Results
/return

|-- Sub Event_SkillUp
Sub Event_SkillUp(string Line, string SkillType, int SkillValue)

/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.Equal[${SkillType}]}) {
  /varcalc MainSkillUp ${MainSkillUp}+1
  }
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.NotEqual[${SkillType}]}) {
  /varcalc SecSkillUp ${SecSkillUp}+1
  }

/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.Equal[${SkillType}]}) {
  /if (${Math.Calc[${Me.Level}*5+5]}==${SkillValue}) {
    /call Results
    }
  }
/return 

|-- Sub Results
Sub Results
/echo Results: ${Spell[${Me.Gem[${GemNumber}]}].Skill} (${Me.Skill[${Spell[${Me.Gem[${GemNumber}]}].Skill}]}) -- Total of ${MainSkillUp} skillups!
/echo Total other skillups (not ${Spell[${Me.Gem[${GemNumber}]}].Skill}) -- ${SecSkillUp}.
/endmacro

/return

----------------------------------------------------------------------------------

Original Post:

Have debugged except for when skill becomes maxed.
Maxed Skill = you get results on what skill you maxed, current skill, number of skillups, etc.

I included something that prevents you from killing yourself casting DD spells (because you weren't in the suggested zones).

Later I might add Param1 that defines your target, so that you don't always have to cast on yourself.

Enjoy.

Code: Select all

|Usage: /macro practice (gem#)
|
|The spell you choose will be cast on yourself. If it is a DD spell,
|  make sure to use it in a zone like PoK, nexus, or PoTranq.
|
|If you are enchanter level 29 or above, it will recast clarity
|  if you have it mem'd
|
|When your skill is maxed in the skill of the spell you are practicing,
|  the macro will give a report on number of skillups. If you had
|  skillups in other areas.. such as medding, or specialize alteration,
|  it will give a report with those skillups as well.
|
|Once you are oom, you will sit, med to FM, then start over.



#event ClarityFades "The cool breeze fades."
#event SkillUp "You have become better at #1#! (#2#)"


Sub Main
/declare GemNumber int outer

/if (${Defined[Param0]}) {
  /varset GemNumber ${Param0}
  /echo Practicing ${Spell[${Me.Gem[${GemNumber}]}].Skill}
  } else {
  
  /echo Usage: /macro practice (gem#)
  /echo Which spell would you like to practice?
  /endmacro
  }

/declare MainSkillUp int outer 0
/declare SecSkillUp int outer 0

:start
/stand
|remove following line if you want to cast spell on target, not yourself
/target ${Me}

:bleh
/if (${Me.SpellReady[${GemNumber}]}) {
/doevents
/if (${Me.Gem[${GemNumber}].Mana} > ${Me.CurrentMana}) {
  /sit
  /goto :medup
  }
/if (${Me.PctHPs}<20) {
  /echo Ending macro because your HPs are too low. Don't want to kill yourself.
  /endmacro
  }
/if (${Me.State.Equal[SIT]}) {
  /stand
  }
/if (${Math.Calc[${Me.Level}*5+5]}==${SkillValue}) {
  /call Results
  }
  /goto :cast
  } else {
  /goto :bleh
}
:cast
|comes from :bleh if the spell is ready
  /cast ${GemNumber}
  /goto :bleh

:medup
|comes from Sub Checks
/doevents
/if (${Me.State.NotEqual[SIT]}) {
  /sit
  }
/if (${Me.CurrentMana}==${Me.MaxMana}) {
  /goto :start
  } else {

  /goto :medup
  }

/return

Sub Event_ClarityFades
/stand
/keypress D
/keypress D
/cast Clarity
/return

Sub Event_SkillUp(string Line, string SkillType, int SkillValue)
|This part aids the end-macro results.
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.Equal[${SkillType}]}) {
  /varcalc MainSkillUp ${MainSkillUp}+1
  }
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.NotEqual[${SkillType}]}) {
  /varcalc SecSkillUp ${SecSkillUp}+1
  }
|checking if skill is maxed.. if it is you're done!
/if (${Math.Calc[${Me.Level}*5+5]}==${SkillValue}) {
  /call Results
  }

/return


Sub Results
/echo You have finished skilling up ${Spell[${Me.Gem[${GemNumber}]}].Skill} !
/echo Results: ${Spell[${Me.Gem[${GemNumber}]}].Skill} (${Math.Calc[${Me.Level}*5+5]}) -- Total of ${MainSkillUp} skillups!
/echo Total other skillups (not ${Spell[${Me.Gem[${GemNumber}]}].Skill}) -- ${SecSkillUp}.
/endmacro

error

Posted: Mon Aug 02, 2004 11:08 am
by icm_24
after trying to run the mac it immediately ended and gave me the error "[MQ2] Practicing NULL". i tried to different methods of calling the mac "/mac practice gem1" and "/mac practice (gem1) neither of which worked. i thought maybe it might be that my skill was maxed out for that spell type so i tried different gem slots all of which gave me the same exact error. considering 90something people have read this post i figure someone besides me has used it and gotten it to work so if its something my dumb noobie ass did please forgive and explain. many thanks :smile: .

Edit:

i know its pointing to this line of the code

/echo Practicing ${Spell[${Me.Gem[${GemNumber}]}].Skill}

but im not sure why its coming up with the NULL instead of te spell name and why its not casting it.

Edit:

after reading through the code and thinking about it a while im thinking im just using it wrong. instead of "/mac practice (gem5)" for instance it should be "/mac practice (5)." im getting that idea form this part of the code "/cast ${GemNumber}" and the fact that when you use the cast command in a hotbutton for example you dont use "/cast gem5" but "/cast 5." ill try it later today since im at work. lol i knew it was something simple that I was doing wrong. tolda ya i was a dumb noobie. neway many thnx for the macro. :D hope to make my own someday :D good luck and good hunting.

Posted: Mon Aug 02, 2004 12:00 pm
by ieatacid
/mac practice 5

Posted: Mon Aug 02, 2004 3:47 pm
by Kambic
Here, this will also recast Spiritual Light, if you are a Beastlord :) Additionally, this will /autoinventory summoned items.

Code: Select all

|Usage: /macro practice (gem#) 
| 
|The spell you choose will be cast on yourself. If it is a DD spell, 
|  make sure to use it in a zone like PoK, nexus, or PoTranq. 
| 
|If you are enchanter level 29 or above, it will recast clarity 
|  if you have it mem'd 
| 
|When your skill is maxed in the skill of the spell you are practicing, 
|  the macro will give a report on number of skillups. If you had 
|  skillups in other areas.. such as medding, or specialize alteration, 
|  it will give a report with those skillups as well. 
| 
|Once you are oom, you will sit, med to FM, then start over.

| [Spiritual Light code and /autoinventory code added (Kambic)] 



#event ClarityFades "The cool breeze fades."
#event SpiritualLightFades "The aura of light fades." 
#event SkillUp "You have become better at #1#! (#2#)" 


Sub Main 
/declare GemNumber int outer 

/if (${Defined[Param0]}) { 
  /varset GemNumber ${Param0} 
  /echo Practicing ${Spell[${Me.Gem[${GemNumber}]}].Skill} 
  } else { 
  
  /echo Usage: /macro practice (gem#) 
  /echo Which spell would you like to practice? 
  /endmacro 
  } 

/declare MainSkillUp int outer 0 
/declare SecSkillUp int outer 0 

:start 
/stand 
|remove following line if you want to cast spell on target, not yourself 
/target ${Me} 

:bleh 
/if (${Me.SpellReady[${GemNumber}]}) { 
/doevents 
/if (${Me.Gem[${GemNumber}].Mana} > ${Me.CurrentMana}) { 
  /sit 
  /goto :medup 
  } 
/if (${Me.PctHPs}<20) { 
  /echo Ending macro because your HPs are too low. Don't want to kill yourself. 
  /endmacro 
  } 
/if (${Me.State.Equal[SIT]}) { 
  /stand 
  } 
/if (${Math.Calc[${Me.Level}*5+5]}==${SkillValue}) { 
  /call Results 
  } 
  /goto :cast 
  } else { 
  /goto :bleh 
} 
:cast 
|comes from :bleh if the spell is ready 
  /cast ${GemNumber}
  /autoinventory 
  /goto :bleh 

:medup 
|comes from Sub Checks 
/doevents 
/if (${Me.State.NotEqual[SIT]}) { 
  /sit 
  } 
/if (${Me.CurrentMana}==${Me.MaxMana}) { 
  /goto :start 
  } else { 

  /goto :medup 
  } 

/return 

Sub Event_ClarityFades 
/stand 
/keypress D 
/keypress D 
/cast Clarity 
/return

Sub Event_SpiritualLightFades 
/stand 
/keypress D 
/keypress D 
/cast "Spiritual Light 
/return  

Sub Event_SkillUp(string Line, string SkillType, int SkillValue) 
|This part aids the end-macro results. 
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.Equal[${SkillType}]}) { 
  /varcalc MainSkillUp ${MainSkillUp}+1 
  } 
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.NotEqual[${SkillType}]}) { 
  /varcalc SecSkillUp ${SecSkillUp}+1 
  } 
|checking if skill is maxed.. if it is you're done! 
/if (${Math.Calc[${Me.Level}*5+5]}==${SkillValue}) { 
  /call Results 
  } 

/return 


Sub Results 
/echo You have finished skilling up ${Spell[${Me.Gem[${GemNumber}]}].Skill} ! 
/echo Results: ${Spell[${Me.Gem[${GemNumber}]}].Skill} (${Math.Calc[${Me.Level}*5+5]}) -- Total of ${MainSkillUp} skillups! 
/echo Total other skillups (not ${Spell[${Me.Gem[${GemNumber}]}].Skill}) -- ${SecSkillUp}. 
/endmacro

dumb noob

Posted: Tue Aug 03, 2004 11:22 am
by icm_24
i was right it was me doing it wrong. dumb noob mistake lol. neway many thnx for the macro i raised my abj and divination on 2 of my toons last night. im going to look at the kid and see if i can figure out on my own how to cast breeze on my baby enc and spiritual radiance on my bigger bst. kambic posted the spiritual light one but im higher in level and i want to learn how thses things work neway :) if i can get mine to work with spiritual radiance and breeze ill post the updates as my first tweaked macro :) thats a long way from some schmuck not knowing what command to use it with lol but we shall see. many thanks again for the macro.

Posted: Tue Aug 03, 2004 2:13 pm
by JP5
Glad it's working properly, I'm a relative newb macro writer =)

Changes I'm busy making:
1. Better clarity recaster.
2. You can define what target you want it to cast on.. If you don't say what target, it defaults to ${Me}
3. Something that cancels it when your target changes, but:

${PTarget} comes from:
/declare PTarget string outer
/if (${Defined[Param1]}) {
/varset PTarget ${Param1}
} else {
/varset PTarget ${Me}
}

Code: Select all

/if (${Me.Target.CleanName.NotEqual[${PTarget}]}) {
  /call Results
| /call Results tells you what skillups you've had and such
  }
Even though I have this before all of my loops (casting loop, medding loop, even my sub events), it doesn't stop the macro. It just .... does nothing.

I figure it is a problem with my syntax with ${Me.Target.CleanName.NotEqual[${PTarget}]}

The other problem I was having is that if another skill than the one you wanted to practice is maxed, the macro stops. I thought I had avoided this by saying:

Code: Select all

Sub Event_SkillUp(string Line, string SkillType, int SkillValue)
|This part aids the end-macro results.
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.Equal[${SkillType}]}) {
  /varcalc MainSkillUp ${MainSkillUp}+1
  }
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.NotEqual[${SkillType}]}) {
  /varcalc SecSkillUp ${SecSkillUp}+1
  }
|checking if skill is maxed.. if it is you're done!
/if (${Math.Calc[${Me.Level}*5+5]}==${SkillValue}) {
  /call Results
  }

/return 
But I forgot to say "if the skill that skilled up = the skill I'm practicing, do:

/if (${Math.Calc[${Me.Level}*5+5]}==${SkillValue}) {
/call Results
}

So.. with that version, if your medding decides to max out, the macro ends.

The new Sub Event_SkillUp code should be

Code: Select all

Sub Event_SkillUp(string Line, string SkillType, int SkillValue)
|This part aids the end-macro results.
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.Equal[${SkillType}]}) {
  /varcalc MainSkillUp ${MainSkillUp}+1
  }
/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.NotEqual[${SkillType}]}) {
  /varcalc SecSkillUp ${SecSkillUp}+1
  }
|checking if skill is maxed.. if it is you're done!

/if (${Spell[${Me.Gem[${GemNumber}]}].Skill.Equal[${SkillType}]}) {
  /if (${Math.Calc[${Me.Level}*5+5]}==${SkillValue}) {
    /call Results
    }
  }

/return 
On that note I'll try to fix this stuff today for a better practice.mac

Posted: Tue Aug 03, 2004 2:20 pm
by JP5
For those that want to customize this macro for different classes, here are the changes you need to make for recasting your mana regeneration spell.

#event ClarityFades "The cool breeze fades."
Changes to:
#event ClarityFades "Your Spell Fade Message Here."

-------------------

Sub Event_ClarityFades
/stand
/keypress D
/keypress D
/cast Clarity
/return

changes to

Sub Event_ClarityFades
/stand
/keypress D
/keypress D
/cast "Your Spell Here in Quotes"
/return

ATM the clarity fading Sub event is kind of poor.. it doesn't consider if you are LOM, and doesn't consider what class you are.. I will also be fixing these issues in my next update.

Posted: Wed Aug 04, 2004 4:09 pm
by JP5
Updated the macro. Is there anyone that could clue me in on a good way to autoinventory summoned items? The method would be under :bleh, which is the casting checking loop.

Posted: Wed Aug 04, 2004 5:35 pm
by Kambic

Code: Select all

|comes from :bleh if the spell is ready 
  /cast ${GemNumber} 
  /autoinventory
  /goto :bleh
Really you could probably put it in a number of places. It is just important that it gets hit at least once per iteration. I figured I'd make it /autoinventory right after casting, but you could put it right before, or wherever you want.

Posted: Thu Aug 05, 2004 5:59 pm
by Kambic
Also, instead of ending the macro at 20% health, try this:

Code: Select all

/if (${Me.PctHPs}<20) { 
  /sit
  /delay 360s (${Me.PctHPs}==100)
  /goto :bleh 
  }
I believe that is the correct code. Instead of ending the macro, this should make you sit, and then wait 6 minutes or until you you are full health (whichever comes first) and then begin casting again.

This is a pretty useful macro, and even though I'm not using it for evocation, I have been using it lately and thought I'd throw that one in there for others :)

Posted: Tue Aug 10, 2004 5:05 pm
by JP5
Apparently the ${Me.Level}*5+5 calculation doesn't work past level 40. Not sure what the skill maxes are, although I could only get 200 skill at level 41.

Posted: Tue Aug 10, 2004 5:06 pm
by aChallenged1
That is likely due to many skills maxing out at 200 until lvl 51.

Posted: Wed Aug 11, 2004 4:10 pm
by desnts
and if u do practice evocation u should do it in a zone that wont allow u to kill yourself thus not having to worry about it.

Posted: Wed Aug 11, 2004 4:34 pm
by aChallenged1
Evocation is best practiced, IMO if not a pet class, in Nexus on a guard. This does not apply to PvP(Red) servers.

Posted: Fri Aug 13, 2004 2:09 pm
by JP5
I try to make macro retard-proof.
I think skills are maxed at 200 until level 45 or something, because now at 46 my divination is up to 201.

if you want to practice on your pet, use:
/macro practice 3 Gobartik