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

- Posts: 52
- Joined: Fri Aug 15, 2003 1:54 am
Post
by skysurf » Thu Dec 04, 2003 12:56 pm
All I want to do is to be able to make my 63 shaman cast some spells by getting tells from my 13 ranger.
I have the castsub routine. So spellcasting is fine.
I just need to know the syntax to basically say this...
Are you the ranger? If you are, then if you had "heal" in your message
/call Cast_Heal
if you had "haste" in your tell then
/call Cast_haste
If you had "regen" in the tell then
/call Cast_Regen
Once again, the king flounder beats his head against the wall for 3 hours!
Thanks to all the kind souls who respond.
Sky
P.S. I REALLY do try to make this stuff work on my own before coming here for help =/
-
skysurf
- a lesser mummy

- Posts: 52
- Joined: Fri Aug 15, 2003 1:54 am
Post
by skysurf » Thu Dec 04, 2003 1:02 pm
I guess I should give you what I got so you know what to smack me about.................
Code: Select all
#chat tell
#chat say
#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
Sub Main
:Loop
/doevents
/delay 10
/goto :Loop
/return
|================================================================================
Sub Event_Chat
/if "@Param0"=="tell"{
/if "@Param1"=="XXXXXXXX"
{
/if "@Param2"~~"heal" /call Cast_Heal
/return
}
/return
}
/return
|================================================================================
Sub Cast_Haste
/stand
/target XXXXXXXX
/delay 2
/call Spellsub "Alacrity"
/sit
/return
|================================================================================
Sub Cast_Heal
/stand
/target XXXXXXXX
/delay 2
/call Spellsub "Chloroblast"
/sit
/return
|=================================================================================
|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",mycasttime)"
/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
P.S. Sorry, I dont know how to put it in a code box =/
Edit by Eqmule...
-
skysurf
- a lesser mummy

- Posts: 52
- Joined: Fri Aug 15, 2003 1:54 am
Post
by skysurf » Thu Dec 04, 2003 6:56 pm
I GOT IT WORKING YAY!
Ill post a super duper macro soon for remote spell casting :)
Sky
P.S. Thanks for the code box on my last post, I have asked how to do it before but no one has ever told me =/