spell_routines.inc - need help testing

PeteSampras

Your UI is fucking you. Stop using it.
Joined
Dec 12, 2007
Messages
3,956
Reaction score
49
Points
38
*** This file will be use for any macro that uses spell_routines.inc. Back up your old copy in case this doesnt work as intended!!

I don't have EQ, so I cant test this. If anyone can run it through the wickets and see if it works, it would be much appreciated.

Changes from spell_routines.inc v2.4:
- Added support for spell and disc rank 2/3 auto detection
- Items will use /itemnotify unless they are Must Equip
- Added support for /discs + rank detection: /call Cast "Disc Name" disc
- Added support for abilities: /call Cast "Ability Name" ability
- You will not /dismount if on a horse uness DismountToInterrupt=TRUE
-----Added castReturn: Macro.Return.Equal[MOUNTED]
- Detection and usage of project illusion
- Added invulnerable castReturn: Macro.Return.Equal[CAST_INVULNERABLE]
- Added announce options in Sub SpellRoutinesLoad section.
----Options will default to the INI defined: #define MyIni ${Me.CleanName}_${Me.Class}.ini
----You can manually change these or change them in whatever INI you define
-------If AnnounceSpellRoutinesChannel=cecho , then you will use colors designated in your call:
---------Example channels: echo, cecho, bc, group, chat, bct PeteSampras
---------/call Cast "Spell Name" gem3 Orange CheckHP 5
---------That will announce your spell in orange /cecho
---------/call Cast "Spell Name2" gem1 DarkBlue
---------That will announce your spell in DarkBlue /cecho
-----------A full list of available colors is listed below in: /declare SpellRoutinesColorList
If you use my bot.mac (no real need to use announce here if you did, i just want it available to all macros), you can change the announce settings per character in your INI.
Bot.mac example:
[Settings]
DismountToInterrupt=TRUE
AnnounceSpellRoutines=TRUE
AnnounceSpellRoutinesChannel=cecho

For everyone else, you can either use an INI of your choice, or just hardcode it. It doesnt matter if you have an INI or not, it is just there for ease of use to my consumer base.

If you want to use an INI, change the following line to whatever your INI is:
Code:
#define MyIni ${Me.CleanName}_${Me.Class}.ini
What needs tested are the above mentioned features. In order to test the dismount, announce, and color echo portions, you have to change a couple settings in the Sub SpellRoutinesLoad:

Code:
Sub SpellRoutinesLoad
/declare spell_routines_loaded int outer 1
/if (${Plugin[mq2cecho].Name.NotEqual[mq2cecho]}) /squelch /plugin mq2cecho
/if (!${Defined[DismountToInterrupt]}) /declare DismountToInterrupt bool outer ${Ini[MyIni,Settings,DismountToInterrupt,[COLOR=Yellow]FALSE[/COLOR]]}
/if (!${Defined[AnnounceSpellRoutines]}) /declare AnnounceSpellRoutines bool outer ${Ini[MyIni,Settings,AnnounceSpellRoutines,[COLOR=Yellow]FALSE[/COLOR]]}
/if (!${Defined[AnnounceSpellRoutinesChannel]}) /declare AnnounceSpellRoutinesChannel string outer ${Ini[MyIni,Settings,AnnounceSpellRoutinesChannel,[COLOR=Lime]cecho[/COLOR]]}
/if (!${Defined[SpellRoutinesColorList]}) string outer |Black|Blue|Brown|Cyan|Gray|Green|Maroon|Orange|Purple|Red|Teal|White|Yellow|DarkGreen|DarkMaroon|DarkPurple|DarkRed|DarkCyan|DarkBlue|DarkYellow|
/if (!${Defined[SpellRoutinesColorCode]}) string outer |\ab|\au|\a-o|\at|\a-w|\ag|\am|\ao|\ap|\ar|\at|\aw|\ay|\a-b|\a-m|\a-p|\a-r|\a-t|\a-u|\a-y|
/return
You can modify an exist macro that has a /call Cast line in it to fit the formats shown above. ie if your macro line was:
/call Cast "${NukeSpell}" ${NukeGem}
To /cecho that in purple, you would change that to:
/call Cast "${NukeSpell}" ${NukeGem} Purple

Testing conditions:
1. Test as is first time through.
2. Change Yellow variables to TRUE to see if you dismount correctly, and if announces are done correctly.
3. Test /call Cast "disc name" disc
4. Test /call Cast "ability name" ability
5. Try using rank 1 versions of spells to /call Cast even though you have rank 2/3
6. Test to make sure items are NOT swapping into inventory slots unless they are must equip.

Thank you for any help anyone can provide.

Bug Reporting:
*If you have a crash, it should look something like this:
(use /plugin mq2log to capture crashes, or a screenshot)

Subroutine LootNPCs not found.

bot.mac@93(Rest): /if (${LootNPCs}) /call LootNPCs
/call Cast "French Toast" gem1 Blue
/echo ${Group.Member[1].CoolnessLevel}


All I really need is the line number and actual error message , but the first line of code is useful so i dont have to guess.

Colors mean:
The actual error
The macro name
The line number
The subroutine it's in
The actual line of code
Filler code that I don't need
 

Attachments

  • Spell_routines.inc
    28 KB · Views: 11
Last edited:
crashd when trying to load Several errors...is there a debug for this or need to collect data another way?
 
Here ya go pete


Code:
[2012/11/05 15:34:08] DoCommand - Couldn't parse 'string outer |Black|Blue|Brown|Cyan|Gray|Green|Maroon|Orange|Purple|Red|Teal|White|Yellow|DarkGreen|DarkMaroon|DarkPurple|DarkRed|DarkCyan|DarkBlue|DarkYellow|'
[2012/11/05 15:34:08] spell_routines.inc@171 (SpellRoutinesLoad): /if (!${Defined[SpellRoutinesColorList]}) string outer |Black|Blue|Brown|Cyan|Gray|Green|Maroon|Orange|Purple|Red|Teal|White|Yellow|DarkGreen|DarkMaroon|DarkPurple|DarkRed|DarkCyan|DarkBlue|DarkYellow|
[2012/11/05 15:34:08] spell_routines.inc@176 (Cast(spellName,spellType,giveUpValue,mySub,int ResistTotal)): /if (!${Defined[spell_routines_loaded]}) /call SpellRoutinesLoad
[2012/11/05 15:34:08] Bot.mac@3818 (SelfBuff): /if (${Me.Class.ShortName.NotEqual[BRD]}) /call Cast "${${CurrentSub}SpellName${i}}" ${${CurrentSub}SpellGem${i}} 0 CheckStuff
[2012/11/05 15:34:08] Bot.mac@179 (Rest): /if (${Me.CurrentMana}) /call SelfBuff
[2012/11/05 15:34:08] Bot.mac@74 (Main): /if (${Me.CombatState.NotEqual[Combat]}||${NeedLoad}) /call Rest
[2012/11/05 15:34:08] DoCommand - Couldn't parse 'string outer |\ab|\au|\a-o|\at|\a-w|\ag|\am|\ao|\ap|\ar|\at|\aw|\ay|\a-b|\a-m|\a-p|\a-r|\a-t|\a-u|\a-y|'
[2012/11/05 15:34:08] spell_routines.inc@172 (SpellRoutinesLoad): /if (!${Defined[SpellRoutinesColorCode]}) string outer |\ab|\au|\a-o|\at|\a-w|\ag|\am|\ao|\ap|\ar|\at|\aw|\ay|\a-b|\a-m|\a-p|\a-r|\a-t|\a-u|\a-y|
[2012/11/05 15:34:08] spell_routines.inc@176 (Cast(spellName,spellType,giveUpValue,mySub,int ResistTotal)): /if (!${Defined[spell_routines_loaded]}) /call SpellRoutinesLoad
[2012/11/05 15:34:08] Bot.mac@3818 (SelfBuff): /if (${Me.Class.ShortName.NotEqual[BRD]}) /call Cast "${${CurrentSub}SpellName${i}}" ${${CurrentSub}SpellGem${i}} 0 CheckStuff
[2012/11/05 15:34:08] Bot.mac@179 (Rest): /if (${Me.CurrentMana}) /call SelfBuff
[2012/11/05 15:34:08] Bot.mac@74 (Main): /if (${Me.CombatState.NotEqual[Combat]}||${NeedLoad}) /call Rest
[2012/11/05 15:34:09] Unparsable in Calculation: ']'
[2012/11/05 15:34:09] spell_routines.inc@262 (Cast(spellName,spellType,giveUpValue,mySub,int ResistTotal)): /if (${AnnounceSpellRoutines}) /docommand /${AnnounceSpellRoutinesChannel} ${colorChoice} ${spellName} ${If[${Target.ID} && ${Spell[${spellName}].SpellType.Equal[detrimental]}],--> ${Target.CleanName},]}
[2012/11/05 15:34:09] Bot.mac@3818 (SelfBuff): /if (${Me.Class.ShortName.NotEqual[BRD]}) /call Cast "${${CurrentSub}SpellName${i}}" ${${CurrentSub}SpellGem${i}} 0 CheckStuff
[2012/11/05 15:34:09] Bot.mac@179 (Rest): /if (${Me.CurrentMana}) /call SelfBuff
[2012/11/05 15:34:09] Bot.mac@74 (Main): /if (${Me.CombatState.NotEqual[Combat]}||${NeedLoad}) /call Rest
[2012/11/05 15:34:09] The current macro has ended.
 
Great, thanks. Fixed that and reposted. That should at least let it load without any error messages, which should take care of Test condition 1. If you, or anyone else can test the other things, that would be awesome! Thank you again.