CasterPract.mac - Another skill practice for casters (beta)

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

anOrcPawn00
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sat May 10, 2003 6:15 am

CasterPract.mac - Another skill practice for casters (beta)

Post by anOrcPawn00 » Wed May 21, 2003 8:39 am

Well, I was in need of a skill practice macro for the druid I'm PLing and nothing fit exactly what I wanted so I wrote one. It's beased and inspired on a lot of macros on here (it's my first macro so been a learning experience from examples).

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

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Wed Jun 18, 2003 3:38 pm

May be a little late to say so, but hey nice job! I love using this on all my casters to practice skills they let fall low.

Getting Conj up on a wizard for Flappy is a pain in the ass usually.

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Wed Jun 18, 2003 4:42 pm

Well, now that I actually tried it, it doesn't work for me. First, it had too many variables, 13 instead of the 10 max, I realize that I can change my max myself, but I decided to take out all the Healing crap instead, I don't play any classes that have heal spells. Then, once that was done, it crashes EQ totally as soon as I type "/mac SpellPract 1 Abjuration", so after looking through it carefully, I removed a couple extra things and still crashes, I walked through in my head exactly what the macro should be doing and can see no problems that make it crash with the macro itself.

Therefore, I had to write my own, alot more basic then this one but it works. That's what counts.

If anyone wants mine, just ask and I'll paste it.

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

icon
Official loudmouth
Official loudmouth
Posts: 158
Joined: Fri Jun 14, 2002 2:59 pm
Location: ...
Contact:

Post by icon » Thu Jun 19, 2003 1:53 pm

Well, I don't care if you want it or not, I haven't contributed a macro yet, so you're going to get it! Neener neener bite me.

Code: Select all

| Recast.mac
| Usage -- /macro Recast
|  - Icon
| Spellgem 1 is always used.
| Put the spell you want 
| recasted a thousand times
| Into spell slot 1 then run this.
|
| If you run OOM, it will auto
| Meditate till you have > 95% mana
|
| If you fizzle, it will wait
| three seconds to recast
| for any recast delays on fizzles
| Feel free to change the delay
| to suit your needs.

#Event CastOOM "Insufficient Mana to cast this spell!"
#Event CastFizzle "Your spell fizzles!"

Sub Main
/echo Eat Shit and Die, thanks.
/echo Level: $char(level)
/echo HP: $char(hp,cur) Mana: $char(mana,cur)
:loop
 /pet get lost
 /doevents
 /pet get lost
 /cast 1
 /doevents
 /pet get lost
 /goto :loop
}

Sub Event_CastOOM
 /echo Medding Time... ($char(mana,pct)% mana)
 /sit
 :medding
 /delay 60
 /if n $char(mana,pct)<95 /goto :medding
 /echo Finished Medding! At $char(mana,pct)% Mana!
 /stand
/return

Sub Event_CastFizzle
 /echo Fizzled!! Waiting three seconds...
 /delay 30
/return
Muahaha, short, sweet, to the point. How I like it.

- Icon
In memory of [b][color=darkblue]MasTerKeyZ[/b][/color].

anOrcPawn00
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sat May 10, 2003 6:15 am

Post by anOrcPawn00 » Mon Jun 23, 2003 6:32 am

The reason the above macro doesn't work currently is $char(gem,) and I believe $spell() cause client crashes. Or at least they do with my build, I need to update CVS and see if there's been a fix made.