Page 1 of 1

FIXED Spelltrain.mac

Posted: Sat Jul 03, 2004 12:37 am
by Fabolous1
Spelltrain.mac
Fixed the other cast.mac so it auctally works, and more features...

Features include:
- Automaticly Targets Self (Configured to F1 key)
- GM Checks
- Reports skill ups in "/echo" and "/popup"
- If insuffienct mana for spell, will meditate until full mana and begin casting spell again.
- If spell isnt in spellbook will end macro.
- Randomizes somethings.
- Logs all skillups into mq2 directory\logs\Spelltrain.mac.log

Requirements:
- Spell_Routines.inc or spellcast.inc but Spell_Routines.inc is recommended.

spelltrain.mac

Code: Select all

| spelltrain.mac 
| By: Fabolous1 (renaissanceoftranquility@yahoo.com)
| Originated from: cast.mac 
|
| Useage: /macro spelltrain.mac "spell name" 
| Quotes are needed for spell names with more than 
| one word. 
| 
| This macro has random delays and such.
| I use it in PoK with myself targeted. If you 
| don't currently have spell memorized, it will 
| mem spell into gem1 then cast. 
| If you want summoned items destroyed, uncomment 
| the line with the "/destroy" command. (Default, uncommented)
| If you have no target, will press F1 key to target self (F1 is defaulted to
| target self, configure to your settings.
|
| This macro uses "spell_routines.inc" so be sure it 
| is in your macro directory. 
|-------------------------------------------------------------------------------- 
#include spell_routines.inc 
#event SkillUp "You have become better at #1#! (#2#)" 
#event NeedTarget "You must first select a target for this spell!"
#event AbjurationSkillUp "You have become better at Abjuration! (#2#)"
#event AlterationSkillUp "You have become better at Alteration! (#2#)"
#event ChannelingSkillUp "You have become better at Channeling! (#2#)"
#event ConjurationSkillUp "You have become better at Conjuration! (#2#)"
#event DivinationSkillUp "You have become better at Divination! (#2#)"
#event EvocationSkillUp "You have become better at Evocation! (#2#)"
#event MeditateSkillUp "You have become better at Meditation (#2#)!"

Sub Main
    /keypress ESC
    /keypress F1
    :loop 
    /echo Casting "${Param0}"
    /call cast "${Param0}"
    /destroy
    /if (${Me.PctHPs}&<30) {
       /echo Health is lower or equal to 30 percent. Sitting down until full health.
       :healthloop
       /delay 5
       /if (${Me.PctHPs}<100) {
          /goto :healthloop
          }
    /return
    }
    /if (${Macro.Return.Equal["CAST_OUTOFMANA"]}) /call Med
    /if (${Macro.Return.Equal["CAST_UNKNOWNSPELL"]}) /call Unknown
    /delay ${Math.Calc[5+${Math.Rand[5]}]}
    /call GMCheck
    /doevents
    /goto :loop
/return
|-------------------------------------------------------------------------------- 
Sub Med 
    /echo Meditating... 
    /delay ${Math.Calc[10+${Math.Rand[10]}]} 
    /sit 
    :medloop 
    /delay 20 
    /if (${Me.PctMana}<100) /goto :medloop 
    /delay ${Math.Calc[20+${Math.Rand[50]}]} 
/return 
|-------------------------------------------------------------------------------- 
Sub Unknown 
    /echo You don't seem to have that spell in your spellbook!
    /echo Ending macro.
    /sit down
    /endmacro 
|-------------------------------------------------------------------------------- 
Sub GMCheck 

/echo Performing a GMCheck.
   /if (${Spawn[gm].ID}) { 
      /beep 
      /beep 
      /beep 
      
      /echo GM has entered the zone! 
      /echo Waiting one minute, and camping.

      /keypress forward 
      /keypress back 

      /delay 1m
      /camp
      /endmacro
   } 
    
/return 
|-------------------------------------------------------------------------------- 
Sub Event_AbjurationSkillUp(SkillUpText,Skill,int Amount) 
   /popup Your Abjuration skill has increased to ${Amount}!
   /echo Your Abjuration skill has increased to ${Amount}!
   /mqlog Your Abjuration skill has increased to ${Amount}!
/return 
|-------------------------------------------------------------------------------- 
Sub Event_AlterationSkillUp(SkillUpText,Skill,int Amount) 
   /popup Your Alteration skill has increased to ${Amount}!
   /echo Your Alteration skill has increased to ${Amount}!
   /mqlog Your Alteration skill has increased to ${Amount}!
/return 
|-------------------------------------------------------------------------------- 
Sub Event_ChannelingSkillUp(SkillUpText,Skill,int Amount) 
   /popup Your Channeling skill has increased to ${Amount}!
   /echo Your Channeling skill has increased to ${Amount}!
   /mqlog Your Channeling skill has increased to ${Amount}!
/return 
|-------------------------------------------------------------------------------- 
Sub Event_ConjurationSkillUp(SkillUpText,Skill,int Amount) 
   /popup Your Conjuration skill has increased to ${Amount}!
   /echo Your Conjuration skill has increased to ${Amount}!
   /mqlog Your Conjuration skill has increased to ${Amount}!
/return 
|-------------------------------------------------------------------------------- 
Sub Event_DivinationSkillUp(SkillUpText,Skill,int Amount) 
   /popup Your Divination skill has increased to ${Amount}!
   /echo Your Divination skill has increased to ${Amount}!
   /mqlog Your Divination skill has increased to ${Amount}!
/return 
|-------------------------------------------------------------------------------- 
Sub Event_EvocationSkillUp(SkillUpText,Skill,int Amount) 
   /popup Your Evocation skill has increased to ${Amount}!
   /echo Your Evocation skill has increased to ${Amount}!
   /mqlog Your Evocation skill has increased to ${Amount}!
/return 
|-------------------------------------------------------------------------------- 
Sub Event_MeditateSkillUp(SkillUpText,Skill,int Amount) 
   /popup Your Meditation skill has increased to ${Amount}!
   /echo Your Meditation skill has increased to ${Amount}!
   /mqlog Your Meditation skill has increased to ${Amount}!
/return 
|-------------------------------------------------------------------------------- 
Sub Event_NeedTarget
   /keypress ESC
   /keypress F1
   /echo Pressing F1 to target self. If this key is wrong please re-configure Spelltrain.mac.
/return
|-------------------------------------------------------------------------------- 
spell_routines.inc

Code: Select all

| spell_routines.inc 
| 
| Written by Rusty~ 
| Last Modified 6/19/2004 
| 
| Features: 
| - Casts spells, clicks items, or uses AA abilities for you 
| - Allows back to back casting without waiting on spell gems to pop all the way up 
| - Will interrupt spell if target dies while casting. If on a mount, it will dismount and duck if the time left 
|   is greater than 3 seconds, else it will strafe to interrupt 
| - Allows you to use items in bags. Equips item, clicks it, then returns it to its previous location 
| - Lets you set how long you want to keep trying to cast the spell (defaults to 0) 
|   If the spell is interrupted before the given time, it will recast, else it will return CAST_INTERRUPTED 
| - Lets you call a custom subroutine while waiting for spell to finish casting 
|   Try to keep custom subroutines very small. A common use would be to interrupt the spell if a certain condition is true 
| - Note: if you don't want this to cast spells while you're invis, in your main macro have this at the top: 
|      /declare noInvis int outer 1 
|   This will wait till invis is off to cast the spell 
| 
| Usage: 
|     /call Cast "spellname|itemname|AAname|AA#" [item|alt|gem#] [give up time][s|m] [custom subroutine name] 
| 
| examples: 
| 
|  To cast Howl of Tashan and mem it in slot 3 if not memmed: 
|    /call Cast "Howl of Tashan" gem3 
| 
|  To cast Arcane Rune and keep trying for 7 seconds, in case of interrupts. 
|    /call Cast "Arcane Rune" gem5 7s 
| 
|  To click Grim Aura earring that's in a bag: 
|    /call Cast "Shrunken Goblin Skull Earring" item 
| 
|  To use AA ability Eldritch Rune: 
|    /call Cast "Eldritch Rune" alt 
|      or 
|    /call Cast "173" alt 
| 
|  To call a subroutine that interrupts CH if target gets healed before it lands: 
|    /call Cast "Complete Healing" gem1 0 CheckHP 
|  Then in your macro have somewhere: 
|    Sub CheckHP 
|       /if ( ${Target.PctHPs}>=80 ) /call Interrupt 
|    /return 
| 
| Returns these values: 
|----------------------+----------------------------------------------------------------------+ 
| CAST_CANCELLED       | Spell was cancelled by ducking (either manually or because mob died) | 
| CAST_CANNOTSEE       | You can't see your target                                            | 
| CAST_IMMUNE          | Target is immune to this spell                                       | 
| CAST_INTERRUPTED     | Casting was interrupted and exceeded the given time limit            | 
| CAST_NOTARGET        | You don't have a target selected for this spell                      | 
| CAST_NOTMEMMED       | Spell is not memmed and you gem to mem was not specified             | 
| CAST_NOTREADY        | AA ability or spell is not ready yet                                 | 
| CAST_OUTOFMANA       | You don't have enough mana for this spell!                           | 
| CAST_OUTOFRANGE      | Target is out of range                                               | 
| CAST_RESISTED        | Your spell was resisted!                                             | 
| CAST_SUCCESS         | Your spell was cast successfully! (yay)                              | 
| CAST_UNKNOWNSPELL    | Spell/Item/Ability was not found                                     | 
|----------------------+----------------------------------------------------------------------+ 

#event BeginCast "You begin casting#*#" 
#event Collapse "Your gate is too unstable, and collapses.#*#" 
#event Fizzle "Your spell fizzles#*#" 
#event Immune "Your target is immune to changes in its attack speed#*#" 
#event Immune "Your target is immune to changes in its run speed#*#" 
#event Immune "Your target cannot be mesmerized#*#" 
#event Interrupt "Your casting has been interrupted#*#" 
#event Interrupt "Your spell is interrupted#*#" 
#event NoLOS "You cannot see your target.#*#" 
#event NoTarget "You must first select a target for this spell!#*#" 
#event NotReady "Spell recast time not yet met.#*#" 
#event OutOfMana "Insufficient Mana to cast this spell!#*#" 
#event OutOfRange "Your target is out of range, get closer!#*#" 
#event Recover "You haven't recovered yet...#*#" 
#event Recover "Spell recovery time not yet met#*#" 
#event Resisted "Your target resisted the #*#" 
#event Standing "You must be standing to cast a spell#*#" 
#event Stunned "You have been stunned.#*#" 
#event Stunned "You cannot cast while stunned#*#" 
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#" 


Sub Cast(string spellName,string spellType,timer giveUpTimer,string mySub) 
   /if ( ${Me.Invis} && ${noInvis} ) /echo You're invis... waiting to cast 
:wait_for_stop 
   /if ( ${Me.Casting.ID} || ( ${Me.Invis} && ${noInvis} ) ) { 
      /delay 1 
      /goto :wait_for_stop 
   }  
   /if ( ${Me.Speed} ) { 
   :wait_for_stop2 
      /delay 1 
      /if ( ${Me.Moving} ) /goto :wait_for_stop2 
   } 
   /if ( !${Defined[giveUpTimer]} ) /declare giveUpTimer timer local 0 
   /if ( !${Defined[spellRecastTime1]} ) { 
      /declare lastSpell string outer 
      /declare refreshTime timer outer 0 
      /declare itemRefreshTime float outer 0 
      /declare i int local 
      /declare castReturn string outer 
      /delay 5 
      /for i 1 to 8 
         /declare spellRecastTime${i} timer outer 
         /if ( ${Me.SpellReady[${i}]} ) { 
            /varset spellRecastTime${i} 0 
         } else { 
            /varcalc spellRecastTime${i} 10*${Me.Gem[${i}].RecastTime} 
         } 
      /next i 
   } 
   /declare currentTarget int local 
   /declare currentTargetType string local 
   /declare swapItemBack bool local false 
   /declare delayTime timer local 
   /declare castEndTime timer local 
   /declare moveBack bool local 
   /if ( !${Defined[spellType]} ) /declare spellType string local spell 
   /if ( ( ${spellType.Equal[spell]} || ${spellType.Left[3].Equal[gem]} ) && !${Int[${Me.Book[${spellName}]}]} ) { 
      /echo Spell: "${spellName}" was not found in your book 
      /return CAST_UNKNOWNSPELL 
   } 
   /if ( ${spellType.Equal[spell]} || ${spellType.Left[3].Equal[gem]} ) { 
      /if ( !${Me.Gem[${spellName}]} ) { 
         /if ( ${spellType.Left[3].Equal[gem]} ) { 
            /memspell ${spellType.Right[1]} "${spellName}" 
         } else { 
            /return CAST_NOTMEMMED 
         } 
         /delay 6s ${Me.Gem[${spellName}]} 
         /if ( !${Me.Gem[${spellName}]} ) { 
            /echo Spell mem interrupted... 
            /return CAST_INTERRUPTED 
         } 
         :wait_for_mem 
         /delay 15s ${Me.SpellReady[${spellName}]} 
         /if ( !${Me.SpellReady[${spellName}]} ) { 
            /if ( ${giveUpTimer} ) /goto :wait_for_mem 
            /return CAST_NOTREADY 
         } 
      } 
      /varset spellType spell 
   } 
   /if ( ${spellName.Find[illusion: ]} && ${Me.AltAbility[project illusion]} ) /call Cast "project illusion" "alt" 
   /declare slotName int local 
   /declare slotID int local 
   /declare oldSlotID int local 
:clear_events 
   /if ( ${Me.SpellReady[${spellName}]} ) /varset spellRecastTime${Me.Gem[${spellName}]} 0 
   /call ClearReturn 
   /doevents Recover 
   /doevents BeginCast 
   /doevents Fizzle 
   /doevents Interrupt 
   /doevents Standing 
   /doevents OutOfRange 
   /doevents OutOfMana 
   /doevents NoLOS 
   /doevents Resisted 
   /doevents Immune 
   /doevents Stunned 
   /doevents Collapse 
   /doevents NoTarget 
   /doevents NotReady 
   /if ( !${castReturn.Equal[CAST_SUCCESS]} ) { 
      /delay 1 
      /goto :clear_events 
   } 
   /varset giveUpTimer ${giveUpTimer.OriginalValue} 
   /declare recoverWaitTime timer local 30 
:cast_loop 
   /if ( ${Me.Ducking} ) /keypress duck 
   /if ( !${Me.Standing} ) /stand 
   /if ( ${spellType.Equal[item]} ) { 
      /if ( !${FindItem[${spellName}].InvSlot} ) { 
         /echo Cannot find item: ${spellName} 
         /return CAST_UNKNOWNSPELL 
      }      
      /if ( ${FindItem[${spellName}].InvSlot}>30 ) { 
         /varset swapItemBack true 
         /if ( ${FindItem[${spellName}].WornSlot[1]} ) { 
            /varset slotName ${FindItem[${spellName}].WornSlot[1]} 
         } else { 
            /varset slotName pack8 
         } 
         /varset slotID ${InvSlot[${slotName}].ID} 
         /varset oldSlotID ${FindItem[${spellName}].InvSlot.ID} 
         /autoinventory 
         /if ( ${InvSlot[${oldSlotID}].Pack} ) { 
         :open_pack 
            /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup 
            /if ( !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /goto :open_pack 
         } 
      :pick_up_item 
         /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup 
         /nomodkey /itemnotify ${InvSlot[${oldSlotID}]} leftmouseup 
         /if ( !${Cursor.Name.Equal[${spellName}]} ) /goto :pick_up_item 
      :exchange_items 
         /nomodkey /itemnotify ${slotID} leftmouseup 
         /if ( !${Me.Inventory[${slotID}].Name.Equal[${spellName}]} ) /goto :exchange_items 
         /if ( ${InvSlot[${oldSlotID}].Pack} ) { 
         :close_pack 
            /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup 
            /if ( ${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /goto :close_pack 
         } 
      } 
      /varset itemRefreshTime ${Math.Calc[${MacroQuest.Running}+500]} 
      /echo Casting: ${FindItem[${spellName}].Spell.Name}${If[!${FindItem[${spellName}].Spell.TargetType.Equal[PB AE]} && !${FindItem[${spellName}].Spell.TargetType.Equal[self]} && ${Target.ID}, on << ${Target.CleanName} >>,]} 
      /cast item "${spellName}" 
   } else /if ( ${spellType.Equal[spell]} ) { 
      /if ( !${lastSpell.Equal[item]} ) { 
      :wait_on_refresh 
         /if ( ${refreshTime} > 0 ) { 
            /delay 1 
            /goto :wait_on_refresh 
         } 
      :wait_for_spell 
         /if ( ${spellRecastTime${Me.Gem[${spellName}]}} ) { 
            /if ( !${giveUpTimer} ) /return CAST_NOTREADY 
            /delay 1 
            /goto :wait_for_spell 
         } 
         /varcalc delayTime 10*(1.5-${Spell[${spellName}].MyCastTime}) 
      :cast_delay_loop 
         /if ( ${delayTime} > 0 ) { 
            /delay 1 
            /goto :cast_delay_loop 
         } 
      } 
      /cast "${spellName}" 
   } else { 
      /if ( !${Me.AltAbilityReady[${spellName}]} ) /return CAST_NOTREADY 
      /varset itemRefreshTime ${Math.Calc[${MacroQuest.Running}+500]} 
      /echo Using AA Ability: ${AltAbility[${spellName}].Name} 
      /alt activate ${AltAbility[${spellName}].ID} 
   } 
   /if ( ${Me.Casting.ID} ) { 
      /varcalc castEndTime ${Me.Casting.MyCastTime}*10 
      /if ( ${spellType.Equal[spell]} ) /echo Casting: ${Me.Casting.Name}${If[!${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && ${Target.ID}, on << ${Target.CleanName} >>,]} 
   } 
   /varset currentTarget ${Target.ID} 
   /varset currentTargetType ${Target.Type} 
   /varset moveBack false 
:wait_cast_loop 
   /if ( ${Me.Casting.ID} ) { 
      /if ( ${Defined[mySub]} ) /call ${mySub} 
      /if ( ${currentTarget} && !${Spawn[${currentTarget}].Type.Equal[${currentTargetType}]} ) { 
         /if ( !${Me.Casting.TargetType.Equal[PB AE]} && !${Me.Casting.TargetType.Equal[self]} && !${moveBack} ) { 
            /if ( !${Me.Mount.ID} || ${castEndTime}>30 ) { 
               /call Interrupt 
            } else { 
               /keypress strafe_right hold 
               /delay 1 
               /keypress strafe_right 
               /varset moveBack true 
            } 
         } 
      } 
      /if ( ${Me.State.Equal[DUCK]} ) /varset castReturn CAST_CANCELLED 
      /delay 1 
      /goto :wait_cast_loop 
   } 
   /if ( ${moveBack} ) { 
      /keypress strafe_left hold 
      /delay 1 
      /keypress strafe_left 
      /delay 8 !${Me.Moving} 
   } 
   /if ( ${swapItemBack} ) { 
   :exchange_items2 
      /itemnotify ${slotID} leftmouseup 
      /if ( ${Me.Inventory[${slotID}].Name.Equal[${spellName}]} ) /goto :exchange_items2 
      /if ( ${InvSlot[${oldSlotID}].Pack} ) { 
      :open_pack2 
         /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup 
         /if ( !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /goto :open_pack2 
      } 
   :drop_item 
      /if ( ${InvSlot[${oldSlotID}].Pack} && !${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup 
      /nomodkey /itemnotify ${oldSlotID} leftmouseup 
      /if ( ${Cursor.ID} ) /goto :drop_item 
      /if ( ${InvSlot[${oldSlotID}].Pack} ) { 
      :close_pack2 
         /nomodkey /itemnotify ${InvSlot[${oldSlotID}].Pack} rightmouseup 
         /if ( ${Window[${InvSlot[${oldSlotID}].Pack.Name}].Open} ) /goto :close_pack2 
      } 
   } 
   /if ( ${castReturn.Equal[CAST_CANCELLED]} ) { 
      /echo Spell was cancelled... 
      /return CAST_CANCELLED 
   } 
   /call ClearReturn 
   /doevents Recover 
   /doevents BeginCast 
   /doevents Fizzle 
   /doevents Interrupt 
   /doevents Standing 
   /doevents OutOfRange 
   /doevents OutOfMana 
   /doevents NoLOS 
   /doevents Resisted 
   /doevents Immune 
   /doevents Stunned 
   /doevents Collapse 
   /doevents NoTarget 
   /doevents NotReady 

   /if ( !${castReturn.Equal[CAST_SUCCESS]} ) { 
      /if ( ${castReturn.Equal[CAST_NOTREADY]} ) /return CAST_NOTREADY 
      /if ( ${castReturn.Equal[CAST_FIZZLE]} ) { 
         /echo Spell Fizzled. Recasting... 
         /goto :cast_loop 
      } 
      /if ( ${castReturn.Equal[CAST_RECOVER]} && ${spellType.Equal[spell]} ) { 
         /if ( !${recoverWaitTime} ) { 
            /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellName}].RecastTime} 
            /if ( !${giveUpTimer} ) /return CAST_NOTREADY 
         } 
         /goto :cast_loop 
      } 
      /if ( ${castReturn.Equal[CAST_RESTART]} ) /goto :cast_loop 
      /if ( ${castReturn.Equal[CAST_STUNNED]} ) { 
         /delay 3s !${Me.Stunned} 
         /goto :cast_loop 
      } 
      /if ( ${castReturn.Equal[CAST_INTERRUPTED]} ) { 
         /if ( ${giveUpTimer} ) { 
            /echo Spell was interrupted. Recasting... 
            /goto :cast_loop 
         } 
         /echo Spell was interrupted... 
         /return CAST_INTERRUPTED 
      } 
   } 
   /if ( ${spellType.Equal[spell]} ) { 
      /varset lastSpell ${spellName} 
      /if ( !${castReturn.Equal[CAST_CANNOTSEE]} && !${castReturn.Equal[CAST_OUTOFRANGE]} && !${castReturn.Equal[CAST_OUTOFMANA]} && !${castReturn.Equal[CAST_NOTARGET]} ) { 
         /varcalc refreshTime 10*${Spell[${spellName}].RecoveryTime} 
         /varcalc spellRecastTime${Me.Gem[${spellName}]} 10*${Spell[${spellName}].RecastTime} 
      } 
   } else { 
      /varset lastSpell ${spellType} 
   :wait_item_loop 
      /if ( ${itemRefreshTime} > ${MacroQuest.Running} ) { 
         /delay 1 
         /goto :wait_item_loop 
      } 
   } 
   /if ( ${castReturn.Equal[CAST_COLLAPSE]} ) { 
      /varset giveUpTimer 200 
      /goto :cast_loop 
   } 
   /return ${castReturn} 

Sub Interrupt 
   /if ( ${Me.Mount.ID} ) /dismount 
   /if ( !${Me.Ducking} ) { 
      /keypress duck 
      /keypress duck 
   } 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_CANCELLED 
/return ${Macro.Return} 

Sub ClearReturn 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_SUCCESS 
/return 

Sub Event_Fizzle 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_FIZZLE 
/return 

Sub Event_Resisted 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RESISTED 
/return 

Sub Event_Interrupt 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_INTERRUPTED 
/return 

Sub Event_Recover 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RECOVER 
/return 

Sub Event_Immune 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_IMMUNE 
/return 

Sub Event_Stunned 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_STUNNED 
/return 

Sub Event_NoLOS 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_CANNOTSEE 
/return 

Sub Event_Standing 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_RESTART 
/return 

Sub Event_Collapse 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_COLLAPSE 
/return 

Sub Event_OutOfMana 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_OUTOFMANA 
/return 

Sub Event_OutOfRange 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_OUTOFRANGE 
/return 

Sub Event_NoTarget 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_NOTARGET 
/return 

Sub Event_NotReady 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_NOTREADY 
/return 

Sub Event_BeginCast 
   /if ( ${Defined[castReturn]} ) /varset castReturn CAST_SUCCESS 
/return
Updating as I find errors, or post updates you would like please. Thank you, Fabolous1.

Posted: Sat Jul 03, 2004 8:44 am
by DumbStruck
not sure whos macro i was using for spell skill ups but i love the idea .. worked great for me last night in 3 hours i went from 30 in abjur to 205 . Only thing i would like to see implemented if at all possible is to be able to say have the ability to do 3 spells , if i need to skill up in 3 areas lets say /macro cast 'tainted breath" "flash of light" "healing"

my hope would be to have it cast tainted breath untill mastered then onto flash of light untill mastered etc ..

Is that at all doable ? and if so can any one offer assistance as to how i can go about that ?

Posted: Sat Jul 03, 2004 9:30 am
by aChallenged1
I would think so with an array that you could make go from 1 to 5 so that you could do all your skills.

It would also require you to tell it what max skill is so that when you reach that point, it increments the array so that it starts casting the next spell gem.

There is a fantastic script in Xylobot that does this, with inputs in game. Is anyone here able to convert such a script into a macro here, or even better a plugin?

Posted: Sat Jul 03, 2004 11:14 am
by Fabolous1
I'm glad you guys like it!

I will work on that after but right now i'm working on the macro to just

Code: Select all

Sub Event_SkillUp(SkillUpText,Skill,int Amount) 
   /popup Your ${Skill} skill has increased to ${Amount}!
   /echo Your ${Skill} skill has increased to ${Amount}!
   /mqlog Your ${Skill} skill has increased to ${Amount}!
/return 
for events, to shorten it and to get them all to work. As of now only Abjuration works.
The problem with this, and why I can't put it up now is, ${Skill} returns NULL in /popup, /echo and /eqlog

Posted: Sat Jul 03, 2004 3:19 pm
by wassup
Fabolous1 wrote:I'm glad you guys like it!

I will work on that after but right now i'm working on the macro to just

Code: Select all

Sub Event_SkillUp(SkillUpText,Skill,int Amount) 
   /popup Your ${Skill} skill has increased to ${Amount}!
   /echo Your ${Skill} skill has increased to ${Amount}!
   /mqlog Your ${Skill} skill has increased to ${Amount}!
/return 
for events, to shorten it and to get them all to work. As of now only Abjuration works.
The problem with this, and why I can't put it up now is, ${Skill} returns NULL in /popup, /echo and /eqlog
No kidding? ${Skill} returns NULL in /popup, /echo, and /eqlog?

Here genious... let me show you what RTFM can do for you, just so everyone knows why people are giving you shit:

From the readme.chm, Top Level Objects:
skill Skill[n]
Skill by number

skill Skill[name]
Skill by name

access to type(s): skill

Object used to get information on your character skills

Examples

/echo ${Skill[1].ReuseTime}
Displays the reuse time of skill 1

/echo ${Skill[backstab].ID} <--Typo fixed for next readme. It was /echo ${Skill[backstab]].ID}
Displays the skill number of the backstab skill

Gee, with this information... I wonder why ${Skill} is returning NULL...

Think you can figure it out now that you actually have to read something instead of ask people to show you how to do it?

Note: While trying to point out a glaringly obvious reason why ${Skill} is returning NULL, I found a typo in the readme that I fixed. I guess in a way you helped me.

Posted: Sat Jul 03, 2004 3:20 pm
by TheWarden
Never mention Xylobot. It sux and I should know(I was dumb enough to pay for that piece of crap)! MQ2 is much much better.

Posted: Sat Jul 03, 2004 3:45 pm
by Chill
Fuergrissa wrote a very effective trainspell macro that works fine for me.

The code uses more :labels and /gotos than I woud have, but it goes through all your spell gems and casts them until your skill in each is maxed. All it requires is that you mem your practice spells. I did just that, and created a "training" spell set for each of my lower level toons. I often mem that spellset and call this macro from a safe spot just before camping.

Posted: Sat Jul 03, 2004 5:45 pm
by DumbStruck
Chill Wrote
Fuergrissa wrote a very effective trainspell macro that works fine for me.

no longer works ..

Posted: Sat Jul 03, 2004 7:20 pm
by Chill
Made some changes based off his macro. Added a couple features from here. Posted: Spells.mac

Posted: Sun Jul 04, 2004 2:15 pm
by monster69
Hey Wassup, Thanks for being a dick.

Here is a direct cut and paste from the CURRENT readme.chm:

Code: Select all

#Event SkillUp "You have become better at #1#! (#2#)"   

Sub Event_SkillUp(SkillUpText,Skill,int Amount)   
     /popup ${Skill} increased - ${Amount} ...   
     /echo ${Skill} increased - ${Amount} ...   
/return   
This came from the Macro Fundamentals / Custom Events / Custom Event Example

This is why people continue to make this mistake.

Now the easy way to fix this is to change the code to something similar to this:

Code: Select all

#Event SkillUp "You have become better at #1#! (#2#)"   

Sub Event_SkillUp(SkillUpText,SkillName,int Amount)   
     /popup ${SkillName} increased - ${Amount} ...   
     /echo ${SkillName} increased - ${Amount} ...   
/return   
Monster

Posted: Sun Jul 04, 2004 3:16 pm
by wassup
Yes, I had some old code in the readme... sue me.

This is why the very first line in the readme is:
If you have any suggestions or comments about this readme, PM Wassup on the MacroQuest2 website.
Now, if he had bothered looking at the readme, and noticed that the example was wrong by cross referencing it with the Skill TLO, he could have pointed out the code error.

Instead, he chooses to ask people to do the research for him.

If I was having issues with the Skill TLO... I would go look at the Skill TLO reference. Duh...

Thanks for pointing out the old code example, but I still stand by my reasoning that if something was wrong with his use of the Skill TLO, he should have looked at the reference to the Skill TLO.

From the CURRENT readme:
skill Skill[n]
Skill by number

skill Skill[name]
Skill by name

access to type(s): skill

Object used to get information on your character skills

Examples

/echo ${Skill[1].ReuseTime}
Displays the reuse time of skill 1

/echo ${Skill[backstab].ID}
Displays the skill number of the backstab skill


Thanks for the drive through. k thx bye

Oh, he might want to fix this too:

Code: Select all

/if (${Me.PctHPs}&<30) {