Got a cool macro idea? Wanna request a macro? Here is the place for you!
Moderator: MacroQuest Developers
-
stigmatine
- a lesser mummy

- Posts: 50
- Joined: Wed Oct 02, 2002 2:52 pm
Post
by stigmatine » Thu Mar 25, 2004 3:01 pm
I searched, and found this macro, but it won't work. All i want is something to watch my target, heal him when i specify , and sit back down lol . Here's the macro i found and am trying to use, it makes my cleric stand up, but then neve casts or sit's back down or anything else lol.
Code: Select all
| healwatch.mac
|
| When running will watch whatever you target and if it drops below whatever percent
| Is specified it will cast whatever spell is specified.
|
| Usage: /macro healwatch.mac percent spellname
| Example /macro healwatch.mac 41 Complete Heal
|
| Version 2
| Date: 10/3/2003 02:18
#event Collapse "Your gate is too unstable, and collapses."
#event FollowOff "You are no longer auto-following"
#event RootOff "Your Immobilize spell has worn off."
#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!"
Sub Main
/declare HealSpell global
/declare HealPct global
/declare Fail global
/declare DoAgain global
/declare StartCast global
/declare Remem global
/declare CastTime global
/declare SpellSlot global
/declare SpellName global
/declare CTimer timer
/declare OOMtimer timer
/if $defined(Param1)==FALSE {
/echo Usage: /macro healwatch.mac Percent Healspell
/echo Example: /macro healwatch.mac 41 Complete Heal
/end
}
/if $defined(Param2)==FALSE {
/varset HealSpell "@Param1"
} else /if $defined(Param3)==FALSE {
/varset HealSpell "@Param1 @Param2"
} else /if $defined(Param4)==FALSE {
/varset HealSpell "@Param1 @Param2 @Param3"
} else {
/varset HealSpell "@Param1 @Param2 @Param3 @Param4"
}
/varset HealPct @Param0
:HealWatchLoop
/delay 1
/if "$target()"=="TRUE" {
/if n $target(hp,pct)<=@HealPct {
/call SpellSub "@HealSpell"
}
}
/goto :HealWatchLoop
/return
Sub SpellSub
/stand
/varset Remem 0
/varset Fail 0
/varset SpellName "@Param0"
:MemWait
/doevents
/if n @Fail==1 {
/varset Fail 0
/if n @Remem==1 {
/memspellset default
: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 "@p0"
/varset SpellSlot 2
/varset Remem 1
:refreshwait
/doevents
/if n @Fail==1 {
/varset Fail 0
/if n @Remem==1 {
/memspellset default
: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 default
: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
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 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_FollowOff
/press esc
/press esc
/delay 5
/tell $target(name) Auto Follow Off.
/return
Sub Event_Sitting
/stand
/delay 2
/varset DoAgain 1
/return
Sub Event_CastTooFar
/varset Fail 1
/tell $target(name) Too far away.
/varset CTimer 0
/return
Sub Event_Distracted
/tell $target(name) I can't cast. I'm too distracted.
/varset Fail 1
/varset CTimer 0
/return
Sub Event_NoTarget
/varset Fail 1
/tell $target(name) I have no target to cast on.
/varset CTimer 0
/return
Sub Event_NoMem
/tell $target(name) That spell is not memed.
/varset Fail 1
/varset CTimer 0
/return
Sub Event_RootOff
/tell $target(name) Root has worn off.
/return
Sub Event_CastNoMana
/if @OOMtimer<=0 {
/tell $target(name) I am OOM!
/varset OOMtimer 100
/return
}
/tell $target(name) OOM. Medding 13 seconds and trying again.
/varset DoAgain 1
/sit off
/sit on
/varset OOMtimer 130
:medingwait
/delay 1
/doevents
/if n @OOMtimer>0 /goto :medingwait
/sit off
/return
Sub Event_Stunned
/tell $target(name) Stunned waiting 3 seconds to try again.
/delay 3s
/varset DoAgain 1
/return
Sub Event_Recovered
/delay 2s
/varset DoAgain 1
/return
Sub Event_CastResist
/tell $target(name) Resisted. Trying again.
/varset DoAgain 1
/return
Sub Event_Collapse
/varset DoAgain 1
/return
Sub Event_NoLOS
/tell $target(name) I can't see my target.
/varset Fail 1
/varset CTimer 0
/return
-
MrSmallie
- a hill giant

- Posts: 167
- Joined: Fri Oct 11, 2002 11:18 am
Post
by MrSmallie » Thu Mar 25, 2004 3:18 pm
I'm assuming you're starting it correctly...
/mac healwatch % "Spell Name" ??
Try changing this line:
To:
Also make sure that you have default spellset setup in case you don't have that spell memmed.
There may be more screwy with the macro...I only glanced at it.
Me
[img]http://home.comcast.net/~mrsmallie/ches.JPG[/img]
-
Fuergrissa
- a grimling bloodguard

- Posts: 607
- Joined: Mon Dec 08, 2003 3:46 pm
- Location: UK
Post
by Fuergrissa » Thu Mar 25, 2004 4:06 pm
I use this to heal my warrior , i just stopped it from following as i allways pull back to my cleric. I use /macro healme 40 "Complete Healing" to set it off and target my warrior, when whatever is targetted drops to 40% health it will cast Complete Healing. I sit my cleric on a drog so i never run out of mana
Code: Select all
| healme.mac
|
| When running will watch whatever you target and if it drops below whatever percent
| Is specified it will cast whatever spell is specified.
|
| Usage: /macro healwatch.mac percent spellname
| Example /macro healwatch.mac 41 "Complete Heal"
|
| Version 2
| Date: 10/3/2003 02:18
|
| ------------------------------------------------------------------------------------
| Modified by: Kaitain Heavy Industries
| Date: 10/27/2003 14:30
|
| Added following and sitting to meditate when not casting
| Follow code was stolen shamlessly from another script grimjack script, Hunter
| I replaced the spell casting sub with Plazmic's SpellCast (and changed it to an include)
|
|
#include SpellCast.inc
#event Collapse "Your gate is too unstable, and collapses."
#event FollowOff "You are no longer auto-following"
#event RootOff "Your Immobilize spell has worn off."
#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!"
Sub Main
/declare HealSpell global
/declare HealPct global
/declare Fail global
/declare DoAgain global
/declare StartCast global
/declare Remem global
/declare CastTime global
/declare SpellSlot global
/declare SpellName global
/declare CTimer timer
/declare OOMtimer timer
/declare hadToMove global
/declare didntMoveCounter global
/declare ObstCount global
/declare MyXLOC global
/declare MyYLOC global
/declare RangeMax global
/declare RangeMin global
/declare FastRange global
/varset RangeMax 25
/varset RangeMin 12
/varset FastRange 30
/if $defined(Param1)==FALSE {
/echo Usage: /macro healwatch.mac Percent Healspell
/echo Example: /macro healwatch.mac 41 Complete Heal
/end
}
/if $defined(Param2)==FALSE {
/varset HealSpell "@Param1"
} else /if $defined(Param3)==FALSE {
/varset HealSpell "@Param1 @Param2"
} else /if $defined(Param4)==FALSE {
/varset HealSpell "@Param1 @Param2 @Param3"
} else {
/varset HealSpell "@Param1 @Param2 @Param3 @Param4"
}
/varset HealPct @Param0
/varset hadToMove 0
/varset didntMoveCounter 0
:HealWatchLoop
/if "$target()"=="TRUE" {
| Move to target
|/call MoveToMob
| Heal if we need to
:HealAction
/if n $target(hp,pct)<=@HealPct {
/echo Healing...
/call Cast "@HealSpell"
/delay 1
/goto :HealWatchLoop
}
| Allows us to wait a moment before sitting down when we are following
| Stops annoying sitdown/stand ups
/if n @hadToMove==1 {
/if n @didntMoveCounter<100 /goto :HealWatchLoop
}
| Reset move info
/varset hadToMove 0
/varset didntMoveCounter 0
| Sit and meditate
:MedLoop
| Break out of med if target moves or gets hurt
| /echo Meditating...
/if n $target(distance)>=@FastRange /goto :HealWatchLoop
/if n $target(hp,pct)<=@HealPct /goto :HealWatchLoop
/if $char(state)!=SIT /sit
/delay 5
/goto :MedLoop
}
/goto :HealWatchLoop
/return
Sub MoveToMob
/if $char(state)==SIT /stand
/varadd didntMoveCounter 1
/varset hadToMove 0
:MovingToMob
/face fast
/if n $target(distance)>=@FastRange /call Fastmove
/if n $target(distance)>@RangeMax {
| reset didn't move counter so we wait
/varset didntMoveCounter 0
/varset hadToMove 1
/press up
/goto :MovingToMob
}
/if n $target(distance)<@RangeMin {
| reset didn't move counter so we wait
/varset didntMoveCounter 0
/varset hadToMove 1
/press down
/goto :MovingToMob
}
/return
Sub Fastmove
/varset hadToMove 1
/varset didntMoveCounter 0
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
:fastmoveloop
/if $target()=="FALSE" {
/sendkey up up
/if $combat=="TRUE" {
/attack off
/return
}
}
/face fast
/if n $target(distance)>@FastRange {
/sendkey down up
}
/if n $target(distance)<=@FastRange {
/sendkey up up
/return
}
/varadd ObstCount 1
/if n @ObstCount>=3 {
/call CheckObst
}
/goto :fastmoveloop
/return
sub CheckObst
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObst 5
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
/return
sub HitObst
/sendkey up up
/sendkey down down
/if n $rand(99)>50 {
/delay 3s
/sendkey up down
/sendkey down Right
/delay @Param0
/sendkey up Right
/sendkey down up
/delay 3s
/sendkey up up
} else {
/delay 3s
/sendkey up down
/sendkey down left
/delay @Param0
/sendkey up left
/sendkey down up
/delay 3s
/sendkey up up
}
/sendkey up down
/sendkey up Right
/sendkey up Left
/sendkey down up
/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_FollowOff
/press esc
/press esc
/delay 5
/tell $target(name) Auto Follow Off.
/return
Sub Event_Sitting
/stand
/delay 2
/varset DoAgain 1
/return
Sub Event_CastTooFar
/varset Fail 1
/tell $target(name) Too far away.
/varset CTimer 0
/return
Sub Event_Distracted
/tell $target(name) I can't cast. I'm too distracted.
/varset Fail 1
/varset CTimer 0
/return
Sub Event_NoTarget
/varset Fail 1
/tell $target(name) I have no target to cast on.
/varset CTimer 0
/return
Sub Event_NoMem
/tell $target(name) That spell is not memed.
/varset Fail 1
/varset CTimer 0
/return
Sub Event_RootOff
/tell $target(name) Root has worn off.
/return
Sub Event_CastNoMana
/if @OOMtimer<=0 {
/tell $target(name) I am OOM!
/varset OOMtimer 100
/return
}
/tell $target(name) OOM. Medding 13 seconds and trying again.
/varset DoAgain 1
/sit off
/sit on
/varset OOMtimer 130
:medingwait
/delay 1
/doevents
/if n @OOMtimer>0 /goto :medingwait
/sit off
/return
Sub Event_Stunned
/tell $target(name) Stunned waiting 3 seconds to try again.
/delay 3s
/varset DoAgain 1
/return
Sub Event_Recovered
/delay 2s
/varset DoAgain 1
/return
Sub Event_CastResist
/tell $target(name) Resisted. Trying again.
/varset DoAgain 1
/return
Sub Event_Collapse
/varset DoAgain 1
/return
Sub Event_NoLOS
/tell $target(name) I can't see my target.
/varset Fail 1
/varset CTimer 0
/return
-
Bad Karma
- a snow griffon

- Posts: 346
- Joined: Sat Nov 22, 2003 9:34 pm
-
Contact:
Post
by Bad Karma » Sat Mar 27, 2004 6:56 am
You might want to delete all that duplicate code from SpellCast.inc....
[b]- Bad Karma
________________________________________[/b]
In our own quest for excellence, we should strive to take the time to help those who help themselves.
All others should [b]RTFM[/b]!!!!!!!!!