Need a short little helper macro converted for me.

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

skysurf
a lesser mummy
a lesser mummy
Posts: 52
Joined: Fri Aug 15, 2003 1:54 am

Need a short little helper macro converted for me.

Post by skysurf » Wed Oct 15, 2003 2:18 am

I found this spell casting macro along time ago and I have used it in ALOT of scripts and I love it cause its so reliable. I couldn't seem to get it converted to the new format though. I did try for like a week to do it though, but since its so short I decided I would just put it here and let one of the pro's fix it since its so short and should only take a minte.

Thanks TONS :)

Sky


| - SpellSub.mac -
| Spell Casting Sub routine - Usage "/call SpellSub <gem> <delay *actual cast time plus recast*>"
| Will return $v99 = 999 if you go oom.
|
| Modified by GD to work with the 7-4-2002 Release
|
#Event SkillUp "You have become better at "
#Event CastFizzle "Your spell fizzles!"
#Event CastStart "You begin casting"
#Event CastInterrupt "Your spell is interrupted."
#Event CastResist "Your target resisted "

Sub SpellSub
/varset v98 $p0
/varset v99 $p1
:ReCast
/varset v1 0
/cast $v98
/delay 1s
/doevents
/if n $v1>1 /goto :ReCast
/if n $v1==0 /goto :SpellSubGetMana
/return

:SpellSubGetMana
/varset v99 999
/delay 5
/return

Sub Event_SkillUp
/varset v1 1
/return

Sub Event_CastStart
/varset v1 1
/delay $v99s
/return

Sub Event_CastFizzle
/varset v1 2
/return

Sub Event_CastInterrupt
/varset v1 3
/return

Sub Event_CastResist
/varset v1 4
/return

P.S. Whats the syntax for code brackets on the board?

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Wed Oct 15, 2003 3:04 am

I'm not at home but I use something like this. It was originaly derived from the code you posted. The main difference is that it will load spells if they are not memed, cast them, and then re-mem a default spell set. Another difference is how it is called. Usage on this is as follows:
/call SpellSub "Name of spell"

It should find the gem, mem it if not found to gem 2, cast the spell, and last remem whatever list you have defined as DefaultSpellList.


Code: Select all

#Event Collapse "Your gate is too unstable, and collapses."
#Event NoLOS "You cannot see your target."
#Event CastStart "You begin casting"
#Event CastFizzle "Your spell fizzles!"
#Event CastInterrupt "Your spell is interrupted."
#Event CastNoMana "Insufficient Mana to cast this spell"
#Event CastTooFar "Your target is out of range, get closer!"
#Event Recovered "You haven't recovered yet..."
#Event CastResist "Your target resisted "
#Event Distracted "You are too distracted to cast a spell now!"
#Event NoTarget "You must first select a target for this spell!"
#Event Sitting "You must be standing to cast a spell."
#Event NoMem "You do not seem to have that spell memorized."
#Event Stunned "You can't cast spells while stunned!"

#define DefaultSpellSet default

|SpellSub
|Used to handle all spell casting.  Auto mems spells and handles fizzles.
|Will want to set the DefaultSpellSet var to your default spell set
|if you plan to have it auto load spells.
|
|Usage /call SpellSub "spellname"
|
Sub SpellSub
   /if $defined(Fail)==FALSE /call SpellSubVars
   /if $char(state)==SIT {
      /stand
   }
   /varset Remem 0
   /varset Fail 0
   /varset SpellName "@Param0"
   :MemWait
   /doevents
   /if n @Fail==1 {
      /varset Fail 0
      /if n @Remem==1 {
         /memspellset DefaultSpellSet
         :loadsploop
         /delay 5
         /if $char(spellbook)=="TRUE" /goto :loadsploop
      }
      /return
   }   
   /varset SpellSlot $char(gem,"@SpellName")
   /if n @SpellSlot<0 {
      /delay 1s
      /goto :MemWait
   }
   /if n @SpellSlot==0 {
      /memspell 2 "@Param0"
      /varset SpellSlot 2
      /varset Remem 1
      :refreshwait
      /doevents
      /if n @Fail==1 {
         /varset Fail 0
         /if n @Remem==1 {
            /memspellset DefaultSpellSet
            :loadsploop
            /delay 5
            /if $char(spellbook)=="TRUE" /goto :loadsploop
         }
         /return
      }   
      /delay 5
      /if n $char(gem,"@SpellName")<=0 /goto :refreshwait
   }
   /varset CastTime "$spell("@SpellName",casttime)"
   /varadd CastTime 1
   :BeginCast
   /varset Fail 0
   /varset DoAgain 0
   /varset StartCast 0
   /call WaitForStart
   :TimerLoop
   /doevents
   /if n @DoAgain==1 /goto :BeginCast
   /if n @Fail==1 {
      /varset Fail 0
      /if n @Remem==1 {
         /memspellset DefaultSpellSet
         :loadsploop
         /delay 5
         /if $char(spellbook)=="TRUE" /goto :loadsploop
      }   
      /return
   }
   /if n @CTimer>0 /goto :TimerLoop
   /delay 2
   /doevents
   /if n @DoAgain==1 /goto :BeginCast
   /if n @Remem==1 {
      /memspellset default
      :loadsploop
      /delay 5
      /if $char(spellbook)=="TRUE" /goto :loadsploop
   }   
/return

|WaitForStart
|Used by SpellSub to determine when to start spell countdown.
Sub WaitForStart
   /cast @SpellSlot
   :StartLoop
   /doevents
   /if n @Fail==1 /return
   /if n @DoAgain==1 /return
   /if n @StartCast==0 {
      /goto :StartLoop
   }
   /varset CTimer "@CastTime"s
/return

Sub SpellSubVars
   /declare Fail global
   /declare DoAgain global
   /declare SpellName global
   /declare Remem global
   /declare SpellSlot global
   /declare StartCast global
   /declare CastTime global
   /declare CTimer timer
   /declare OOMtimer timer
/return

Sub Event_CastStart
   /varset StartCast 1
/return

Sub Event_CastFizzle
   /delay 2
   /varset DoAgain 1
/return

Sub Event_CastInterrupt
   /delay 2
   /if n @Fail==1 /return
   /varset DoAgain 1
/return

Sub Event_Sitting
   /stand
   /delay 2
   /varset DoAgain 1
/return

Sub Event_CastTooFar
   /varset Fail 1
   /varset CTimer 0
/return

Sub Event_Distracted
   /varset Fail 1
   /varset CTimer 0
/return

Sub Event_NoTarget
   /varset Fail 1
   /varset CTimer 0
/return

Sub Event_NoMem
   /varset Fail 1
   /varset CTimer 0
/return

Sub Event_CastNoMana
   /varset DoAgain 1
   /if $char(state)==STAND /sit on
   /varset OOMtimer 130
   :medingwait
   /delay 1
   /doevents
   /if n @OOMtimer>0 /goto :medingwait
   /sit off
/return

Sub Event_Stunned
   /delay 3s
   /varset DoAgain 1
/return

Sub Event_Recovered
   /delay 2s
   /varset DoAgain 1
/return

Sub Event_CastResist
   /tell @MasterName Resisted.
   /varset Fail 1
/return

Sub Event_Collapse
   /varset DoAgain 1
/return

Sub Event_NoLOS
   /varset Fail 1
   /varset CTimer 0
/return 
Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

skysurf
a lesser mummy
a lesser mummy
Posts: 52
Joined: Fri Aug 15, 2003 1:54 am

Post by skysurf » Wed Oct 15, 2003 5:24 am

Just curious, but how do you set your "default" spellset. I was looking through the macro and couldn't find a /varset Defaultspellset so that leads me to believe there is a way in game to set your default spell set.

So I guess my question is is the default spell set set in the script or in game?

Thanks

Sky

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Wed Oct 15, 2003 5:31 am

skysurf wrote:Just curious, but how do you set your "default" spellset. I was looking through the macro and couldn't find a /varset Defaultspellset so that leads me to believe there is a way in game to set your default spell set.

So I guess my question is is the default spell set set in the script or in game?

Thanks

Sky
It's one of the new features in EQ.

1. Memorize a set of spells you want to have as default spells
2. Right click on the spellbook icon in the spell gems window
3. Select Save
4. Enter Default as the Spell Set name

You can save up to 10 different spell set if I am not mistaken. I have 5-6 saved. Group Buffs, Single Buffs, Solo, Raid, and a few other ones I use for specific grooup types.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Wed Oct 15, 2003 6:28 am

skysurf wrote:Just curious, but how do you set your "default" spellset. I was looking through the macro and couldn't find a /varset Defaultspellset so that leads me to believe there is a way in game to set your default spell set.

So I guess my question is is the default spell set set in the script or in game?

Thanks

Sky
#define DefaultSpellSet default

Change that to #define DefaultSpellSet nameofset

or just make one named default

Thanks
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

[40oz]
a hill giant
a hill giant
Posts: 156
Joined: Tue Nov 12, 2002 12:14 pm

/memspell????

Post by [40oz] » Wed Oct 15, 2003 1:47 pm

Code: Select all

      /memspell 2 "@Param0" 
how does that work? is that a new feature in mq/eq slash commands that i missed?

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Wed Oct 15, 2003 3:31 pm

yes you missed it. :wink:
Last edited by EqMule on Thu Oct 16, 2003 9:00 pm, edited 1 time in total.
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

skysurf
a lesser mummy
a lesser mummy
Posts: 52
Joined: Fri Aug 15, 2003 1:54 am

Post by skysurf » Thu Oct 16, 2003 7:50 pm

The macro that grimjack gave to replace the old SpellSub.mac is choking on Clarity and I don't know why.

I have tried everything, and I even used the same macro where I used /call SpellSub "Voice of Quellious" and it worked fine.

For some reason it chokes on /call SpellSub "Clarity" and I don't know why.

Please help.


Sky