01 April 2010

Runes of Magic self cast Macro

Is it possible to write a macro that does a self cast of Regenerate for when my Mage is getting his butt kicked by some mob?

yeahhh...

here the trick:

Everything I've seen here makes you drop your current target in favor of targeting yourself, then casting a heal/buff/whatever. Sometimes you can just hit tab to do a TargetNearestEnemy thing after, but if there's multiple baddies etc., re-targeting gets problematic.

I have, however, found the solution. (My macro skills are subpar, so the following example may not be optimal, but it's the latter function that matters):

/script cast Regenerate;
/script SpellTargetUnit("player");


Not only will this cast Regen on yourself, but it won't change your target. Keep in mind, this is only so long as your currently targeting something hostile or nothing at all. If you're targeting an ally or friendly NPC, it'll cast it on them instead.

The 'SpellTargetUnit()' function appears to take whatever spell is currently held in cursor, ready to be clicked on someone, and cast it for you without all that messy clicking.

I play an S/P, so finding this (by just trying promising sounding functions from http://www.theromwiki.com/index.php/List_of_Functions) was vital. Too often I'd have AutoShot active and try to Regen myself while maintaining my target. If AutoShot went off while my cursor was in cast mode, I'd lose the spell before clicking on my portrait. End result being having targeted myself, not getting healed, and having to start all over.

It can be also done with simpler macro commands, but I am using this script in another routine, so I have it in this form. You can replace Regenerate with whatrever spell or skill you want to use

Code:


/script FocusUnit(1,"target");TargetUnit("player");CastSpellByName("Regenerate");TargetUnit("focus1");FocusUnit(1,"");

What this script does is saves your current target in your focus, targets you, casts whatever you told it to cast, then reacquires your previous target and clears your focus. You will see your focus interface show for a split second and disappear.

I hope I didn't make any typos when reqriting it, I am playing on another computer
yeah i got sick of having to self-target for things like wave armor and soul bond so.. pretty much the same thing but in easily macroable /slash command form:

Code:

--[[ Self-Cast Slash Wrapper

$skillName Name of the skill to cast on yourself
$returns Nothing
]]
SLASH_SELFCAST1 = "/CastMe"
SlashCmdList["SELFCAST"] = pgAddon_SlashSelfCast
pgAddon_SlashSelfCast = function(editBox, msg)
pgAddon_CastAt("player", msg)
end

--[[ Casts a spell on the target regardless of your current target.

$castTarget Target to cast the spell at.
$skillName Name of the skill to cast.
$returns Nothing.
]]
pgAddon_CastAt = function(castTarget, skillName)
FocusUnit(12, "target") -- store current target
TargetUnit(castTarget) -- new target
CastSpellByName(skillName) -- cast spell
TargetUnit("focus12") -- reselect previous target
FocusUnit(12, "") -- clear focus window.
end


which would be used by

/CastMe Regenerate
/CastMe Wave Armor

---Update---
Download and install this add on.
http://rom.curse.com/downloads/rom-a...self-heal.aspx

If you dont know how check out this website to install an add-on.

http://theromwiki.com/index.php/Addon_Tutorial

Enjoy!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.