I don't know the formula for casting skill caps post 40, so for now it caps itself at 200. Also, I have been unable to find a way to read the skill used by a spell through code so for now it requires the skill name to be specified as a parameter.
Comments, questions, feedback and suggestions are welcome.
Code: Select all
| CasterPract.mac
| by anOrcPawn00
|
|
| NOTE: CURRENTLY THIS MACRO DOES NOT WORK ABOVE 200 SKILL!
| If you know the level-skill formula for post 40 levels leave a
| reply here, I will be glad to update this macro with the right
| formula.
|
|
| Usage: /macro CasterPract <#> <Skill>
| Where: # - the number of the spell gem to use
| Skill - the MQ name of the skill used by the spell
| in that gem (Abjuration, Alteration,
| Conjuration, Divination, Evocation).
| THIS IS CASE SENSITIVE!
|
| Disclaimer:
| While this macro has worked ok for me I offer no guarantees it
| will for you. If you choose to use it you do so AT YOUR OWN
| RISK and I am not responsible should anything bad happen to your
| character, account, computer, etc.
|
| Features:
| - Repeatedly cast the specified spell _on self_ until the skill
| cap is reached. (see below)
| - Auto determines skill cap under level 40, or uses a skill
| cap of 200 if above. (I need to find out the formula
| for skill caps at 40+ and fix this)
| - Uses track (UNTESTED!), forage (stacks the stuff on your cursor
| until /click is fixed) and sense heading whenever
| possible. These are not checked against skill caps!
| - Auto picks the highest level "Heal" spell that is memmed.
| (Currently it will only use spells with "Heal" in their
| name, no Chloroblast and such)
| - When the character falls under 50% HPs it will start healing
| itself if a healing spell was found. (Keeps your health
| up if you're practicing a DD hopefully) If no heal spell
| is found it keeps practicing.
| - If no heal spell is available and the character falls under 30%
| HPs the macro sits and exits.
| - Fairly verbose log output (casting the practice spell, casting
| the heal, skill-ups (all), starting to med, finished
| medding, character life warnings). Will clear its log
| at each startup to keep it from getting really really big.
|
#turbo 100
#Event CastOOM "Insufficient Mana to cast this spell!"
#Event CastFizzle "Your spell fizzles!"
#Event SkillUp "You have become better at"
#define ReadyCast v70
#define SkillCap v71
#define HealGem v72
#define ForIndex v73
#define SpellGem v74
#define WaitTime v75
#define AmCasting v76 |0=casting the training spell, 1=casting a heal
#define HealName v77
#define SpellName v78
#define HealLevel v79
Sub Main
/echo AnOrcPawn00's Caster Practice Macro v1.00
/echo ===========
/mqlog clear
/if n $strlen("$p0")==0 {
/echo Error: Specify the number of the spell to use
/return
} else /if n $strlen("$p1")==0 {
/echo Error: Specify the skill "$char(gem,$p0)" uses.
/return
}
/varset SpellGem "$p0"
/varset SpellName "$char(gem,$p0)"
/echo Using "$char(gem,$p0)" ($p1) in slot $SpellGem.
/if n $char(level)>39 {
/varset SkillCap 200
} else {
/varcalc SkillCap $char(level)*5+5
}
/echo Using skill cap of $SkillCap. (Now: $char(skill,$p1))
/echo .
/varset HealGem 0
/varset HealLevel 0
/echo Searching for a healing spell:
/for ForIndex 1 to 8
/if "$char(gem,$ForIndex)"~~"Heal" {
/echo ... "$char(gem,$ForIndex)" found in slot $ForIndex.
/if n $spell("$char(gem,$ForIndex)",level)>$HealLevel {
/varset HealGem $ForIndex
/varset HealLevel $spell("$char(gem,$ForIndex)",level)
}
}
/next ForIndex
/if n $HealGem>0 {
/echo Using lev $HealLevel "$char(gem,$HealGem)" in slot $HealGem.
} else {
/echo Warning!
/echo ========
/echo YOU DO NOT HAVE A HEALING SPELL MEMORIZED!!
/echo If you are practicing a damaging spell your character may die!
}
/varset HealName "$char(gem,$HealGem)"
/varset WaitTime 0
/varset AmCasting 0
:loop
/doevents
/call MashSkills
/call EnsureCastStatus
/if n $char(hp,pct)<50 {
/if n $HealGem==0 {
/if n $char(hp,pct)<30 {
/mqlog LIFE $char(hp,pct)%: Under critical limit. No heal memmed, EXITING!
/echo CRITICAL LIFE LIMIT REACHED!
/echo Sitting & exiting!
/sit on
/return
} else {
/mqlog LIFE $char(hp,pct)%: No heal memmed, continuing practice.
/goto :CastSpell
}
}
/varset AmCasting 1
/call GetWaitTime "$char(gem,$HealGem)"
/varcalc WaitTime $return
/mqlog LIFE $char(hp,pct)%: Casting $HealName.
/cast $HealGem
/doevents
/delay $WaitTime
/goto :loop
} else /if n $char(skill,$p1)<$SkillCap {
:CastSpell
/varset AmCasting 0
/call GetWaitTime "$char(gem,$SpellGem)"
/varcalc WaitTime $return
/mqlog Casting $SpellName. [$p1 = $char(skill,$p1)]
/cast $p0
/doevents
/delay $WaitTime
/goto :loop
}
/echo SKILL CAP of $SkillCap in $p1 REACHED!!
/mqlog SKILL CAP of $SkillCap in $p1 REACHED!!
/return
Sub Event_CastOOM
/varset l1 0
/mqlog Need to med... ($char(mana,pct)% mana)
/varset WaitTime 0
/sit
:medding
/call MashSkills
/doevents SkillUp
/delay 60
/varcalc l1 $l1+1
/if n $char(mana,pct)<100 /goto :medding
/mqlog Finished medding! (Medded $l1 ticks, now at $char(mana,pct)% mana)
/stand
/return
Sub Event_CastFizzle
/call GetWaitTime FIZZLE
/varcalc WaitTime $return
/mqlog Fizzled, waiting $WaitTime.
/return
Sub EnsureCastStatus
/if $target(id)!=$char(id) {
/mqlog I had "$target(name)" targetted, targetting myself.
/target myself
}
/if $char(state)=="SIT" {
/mqlog I am sitting, standing up.
/sit off
} else /if $char(state)!="STAND" {
/mqlog My state is $char(state), sitting then standing up to reset.
/sit on
/delay 5
/sit off
}
/return
Sub MashSkills
/if $char(state)=="STAND" {
/if n $char(ability,"Forage")>0 /doability "Forage"
}
/if n $char(ability,"Sense Heading")>0 /doability "Sense Heading"
/if n $char(ability,"Tracking")>0 /doability "Tracking"
/return
Sub Event_SkillUp
/mqlog SKILL UP! ($p0)
/return
Sub GetWaitTime
/if "$p0"=="FIZZLE" {
/varset l1 10
} else /if n $spell("$p0",recoverytime)>$spell("$p0",recasttime) {
/varcalc l1 $spell("$p0",casttime)*10+$spell("$p0",recoverytime)*10+3
} else {
/varcalc l1 $spell("$p0",casttime)*10+$spell("$p0",recasttime)*10+3
}
/return $l1
