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



