Trainspell.mac (Working) Spell Trainer.

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

bzt
a lesser mummy
a lesser mummy
Posts: 77
Joined: Fri Oct 10, 2003 3:39 pm

Post by bzt » Fri May 21, 2004 3:17 am

Ok..I am enchanting clay with a baby ench..the ench has enough mana for 2 fizzles, then not enough mana. I fixed it though..I just raised the min mana lvl to the min mana lvl that he needs to cast the spell..and its working great.. I am sorry to have posted before tinkering. I also edited the max arcane to *6+5 so that he never stops. It may be cheesy and chopy the way I did it..but its working for me. Thanks much!

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Fri May 21, 2004 4:26 am

thats good to hear, and by changing the macro you have adapted it to work for you.
You have actually bothered to have a go yaself, and to that means are well on the road to writing your own macs :)
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

bzt
a lesser mummy
a lesser mummy
Posts: 77
Joined: Fri Oct 10, 2003 3:39 pm

Post by bzt » Fri May 21, 2004 12:36 pm

ive adapted a few thru trial and error..but there is absoutleyy no way I could write one from scratch..lol heck the advbot, I couldnt even figure out the stuff to change for it to work for me..

I enjoy MQ2 and use it frequently..and I thank you folks for all your help!

User avatar
Soul Hunter
orc pawn
orc pawn
Posts: 13
Joined: Wed May 04, 2005 8:59 am

Post by Soul Hunter » Fri May 06, 2005 11:10 am

where can I find spellcast.inc?

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Fri May 06, 2005 11:15 am

I would change the top include from spellcast.inc to spell_routines.inc and they both can be found in the snippets sections.
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

User avatar
Soul Hunter
orc pawn
orc pawn
Posts: 13
Joined: Wed May 04, 2005 8:59 am

Post by Soul Hunter » Fri May 06, 2005 4:03 pm

When I run trainspell.mac using the .inc you included in the first post it gives me
Unparsable in Calculation: 'g'
trainspell.mac@16(Main):/if (${ArcaneLevel}>235 /varset ArcaneLevel 235
the current macro has ended
Failed to parse /if condition '(270>235)'. no-numeric encountered

I'm not sure if this is just an older macro and needs the cap reset or what...thanks in advance for the assistance

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Fri May 06, 2005 5:46 pm

Soul Hunter wrote:When I run trainspell.mac using the .inc you included in the first post it gives me
Unparsable in Calculation: 'g'
trainspell.mac@16(Main):/if (${ArcaneLevel}>235 /varset ArcaneLevel 235
the current macro has ended
Failed to parse /if condition '(270>235)'. no-numeric encountered

I'm not sure if this is just an older macro and needs the cap reset or what...thanks in advance for the assistance
The fix is on the board and was easily found with the search function, BUT i have edited my first post for you, quite a while ago there was a problem with the code on theboard that changed alot of the macros ">" and "<" symbols to their Equivalents ">" and "<".

I have edited the first post with the correct symbols and it will work fine now.

Enjoy
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

Merlin
a lesser mummy
a lesser mummy
Posts: 69
Joined: Tue Oct 26, 2004 2:33 am

Post by Merlin » Sat May 21, 2005 6:16 pm

how hard would be be to make a macro similiar to this what would keep casting a spell like yaulp every time it fades?

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Sat May 21, 2005 6:27 pm

Merlin wrote:how hard would be be to make a macro similiar to this what would keep casting a spell like yaulp every time it fades?
It can be as simple as (Untested)

Code: Select all

|Yaulp.mac

#include spell_routines.inc
sub main
   
:main
     /if (${Me.PctMana}<10) /echo "No Mana to cast Yaulp"
     /if (!${Me.Buff[Yaulp].ID}) {
     /call cast "Yaulp" 
     }
     /delay 1s
     /goto :main
     /return
Or harder with lots of checks and variables for diferent spells
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

Fammaman
decaying skeleton
decaying skeleton
Posts: 2
Joined: Sun Jul 03, 2005 5:03 pm
Location: Norway
Contact:

Post by Fammaman » Wed Aug 17, 2005 2:08 pm

Very nice spell training macro, and I'm very happy with the ability to delete summoned items with the .ini file!

This is my very first message on this board, though I've been a lurker for awhile - and my programming skill is basic at best.

I had been using practice.mac by JP5, but it seems that spelltrain.mac does a bit more of what I need.

I would, however, like to add the following from the other mac, to let me know my progress when I'm done -

Code: Select all

#event SkillUp "You have become better at #1#! (#2#)" 
#event ESC "You no longer have a target."

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
So... my own fiddling ends up making the mac look like this, and I'd like your opinion if this works (can't check it myself atm), or if you could modify your mac a little more accurately then I can to do the same thing:

Code: Select all

|**
 trainspell.mac 
 Written by Fuergrissa V2.0 
 HandleItem routine "Borrowed" from bootyjuice, Thank You. 
 Ini File: trainspell.ini 
 
 0 = Destroy 
 1 = Keep 
 
 Any summoned items are added to the ini file automatically 
 first time around and are kept by default.
**|

#Define ArcaneMax 235 
#include spellcast.inc
#event SkillUp "You have become better at #1#! (#2#)" 
#event ESC "You no longer have a target." 

Sub Main 
   /declare ArcaneLevel int outer 
   /declare SpellName string outer 
   /declare GemNumber int outer 
   /declare WhatSkill string outer 
   /declare Maxxed int outer 
   /varcalc ArcaneLevel ${Me.Level}*5+5 
   /echo Your Spell Cap is ${ArcaneLevel} 
   /if (${ArcaneLevel}>ArcaneMax) /varset ArcaneLevel ArcaneMax 
   /echo Your Current Spell Cap is ${ArcaneLevel} 
   /varset GemNumber 0 
   /varset Maxxed 0 
   /varset SpellName "" 
   /varset WhatSkill "" 
 :TrainingLoop 
   /if (${Me.PctMana}<10) /goto :SitDown 
   /if (${Cursor.ID}) /call SummonedItem 
   /goto :CastSpell 

 :SitDown 
   /echo Mana at ${Me.PctMana}% Medding till over 99% 
 :MedLoop 
   /if (${Me.State.Equal[STAND]}) /sit 
   /if (${Me.PctMana}>99) /goto :FullMana 
   /goto :MedLoop 
   /return 
 :FullMana 
   /echo Mana at ${Me.PctMana}% Starting to cast again... 
   /if (${Me.State.Equal[SIT]}) /stand 
 :CastSpell 
   /Varcalc GemNumber ${GemNumber}+1 
   /if (${GemNumber}>8) /varset GemNumber 1 
   /varset SpellName ${Me.Gem[${GemNumber}]} 
   /if (!${Me.Gem[${SpellName}]}) /goto :TrainingLoop 
   /goto :TestSkill 
 :StartCasting 
   /target myself 
   /echo Casting ${SpellName} from GemSlot ${GemNumber} of Type ${Spell[${SpellName}].Skill} (${Me.Skill[${Spell[${SpellName}].Skill}]}) 
   /varset Maxxed 0 
   /call cast "${SpellName}" 
   /goto :TrainingLoop 
   /return 
 :TestSkill 
   /if (${Me.Skill[${Spell[${SpellName}].Skill}]}==${ArcaneLevel}) /goto :TooHigh 
   /goto :StartCasting 
   /return 
 :TooHigh 
   /varset WhatSkill ${Spell[${SpellName}].Skill} 
   /varcalc Maxxed ${Maxxed}+1 
   /echo You cannot Increase ${WhatSkill} anymore. 
   /if (${Maxxed}==8) /goto :Finished 
   /goto :TrainingLoop 
   /return 
 :Finished 
   /echo Ending 
   /call Results
     
 Sub SummonedItem 
  
    /declare ItemSetting int local 
    /declare NotFound int local 
    /varset NotFound -1 
 | Look up this item in trainspell.ini 
    /varset ItemSetting ${Ini[trainspell.ini,ItemList,${Cursor.Name},${NotFound}]} 
    /delay 5 
 | If the item isn't in the .ini file then add it. 
    /if (${ItemSetting}==${NotFound}) { 
    /ini "trainspell.ini" "ItemList" "${Cursor.Name}" "1" 
    /varset ItemSetting 1 
    } 
 | If we're keeping this item then bag it. 
 | Otherwise, just destroy it. 
    /if (${ItemSetting}==1) { 
  :BagIt 
    /autoinventory 
    /delay 5 
    /if (${Cursor.ID}) /goto :BagIt 
      } else { 
     /destroy 
    } 
    /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 this session! 
/echo Total other skillups (not ${Spell[${Me.Gem[${GemNumber}]}].Skill}) -- ${SecSkillUp}. 
/endmacro 

/return

Glacier
orc pawn
orc pawn
Posts: 22
Joined: Mon Oct 11, 2004 12:07 pm

Post by Glacier » Wed Sep 07, 2005 5:32 pm

I can't thank you enough for writing such a simple and functional mac.

This definitely has made life much easier for my n00blet Ranger.

B_rizzleB
orc pawn
orc pawn
Posts: 10
Joined: Mon Sep 26, 2005 10:15 am
Location: Mq centrel

helpzor

Post by B_rizzleB » Mon Sep 26, 2005 9:14 pm

ok i've done all the stuff and put the stuff in the directory and when i go /macro trainspell it feeds back trainspell.mac@47 (main): /call cast "${SpellName} the current macro has ended. im wandering if u can helpz me? btw im using spell_routine.inc

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Re: helpzor

Post by Fuergrissa » Tue Sep 27, 2005 3:05 am

B_rizzleB wrote:ok i've done all the stuff and put the stuff in the directory and when i go /macro trainspell it feeds back trainspell.mac@47 (main): /call cast "${SpellName} the current macro has ended. im wandering if u can helpz me? btw im using spell_routine.inc
change this

Code: Select all

#include spellcast.inc 
to this

Code: Select all

#include spell_routines..inc 
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

vanemon
a lesser mummy
a lesser mummy
Posts: 58
Joined: Fri Aug 20, 2004 7:22 am

Post by vanemon » Sun Aug 19, 2007 7:48 am

is there any undead npc with low dps where you can try evocation (undead nukes, call for blood) for necros?

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Sun Aug 19, 2007 2:26 pm

nektulos forest?