You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

1

Friday, August 9th 2013, 8:42pm

Need help with targeting macro and autoshot macro

When I played WoW I used a line in my macros that would target the nearest enemy if my current target was dead or had no target:
/targetenemy [dead]

I spent several hours googling and trying different variations of this:
/script if UnitIsDeadOrGhost("target" == true) then TargetNearestEnemy() end;

Nothing seems to be working for me and would love if someone could show me something that works. My next issue is trying to figure out a working rotation macro that will toggle Autoshot on but not toggle it off. I found this, but can't get it to work on its own:
/run local a1,a2,a3,a4,a5,a6=GetActionInfo(#); if a6 then CastSpellByName("Autoshot") end


let alone in conjunction with something like this:
/run if GetActionUsable(6) then UseAction(6);
elseif GetActionUsable(5) then UseAction(5);
elseif GetActionUsable(4) then UseAction(4);
else UseAction(3); end


Ideally I want something simple like this:
/run if GetActionUsable(1) then UseAction(1) end;
/run local a1,a2,a3,a4,a5,a6=GetActionInfo(2); if a6 then UseAction(2);
/run for i=3,6 do if GetActionUsable(i) then UseAction(i) end;


1=Combo Shot, 2=Autoshot, 3-6=the rest of the rotation.

But the post I got it from said there was probably errors and I can't get it to work either. I would really appreciate any help I could get.

wneter

Trainee

Posts: 67

Location: Maidstone, Saskatchewan, Canada

Occupation: Computer tech

  • Send private message

2

Friday, August 9th 2013, 11:45pm

Hey there Steady...

there are a couple macros i found for targeting, one for anything but pets and the other is for players only, works well for me and others in my guild..

target non pets

/run for i=1,10 do TargetNearestEnemy(IsShiftKeyDown()) if not UnitMaster("target") then break end end
/run if UnitMaster("target") then TargetUnit("") end


target only players

/run for i=1,10 do TargetNearestEnemy(IsShiftKeyDown()) if UnitIsPlayer("target") then break end end
/run if not UnitIsPlayer("target") then TargetUnit("") end


create the macros separately, put in your hot bar and bind a key to it if one isnt already bound.


for your rotation, there is a nice little addon that is graphics based called Kittycombo that works nicely, or if you are into a bit of programming/scripting, check out the DIYCE addon, that is an awesome one. You can find them at www.curseforge.com, go give them a look. The DIYCE has a ton of material you can read up on in the forums here too, we have some fantastic programmers out there that do awesome work and help on that.

have a great day :)
Straitarrow, 87/87/60 R/K/M
Guildleader of Straitheart (Level 12) Osha
Straitheart is a NON Drama guild, not endgame, but we love to help people get started and watch them grow in the game. If you play on Osha and are looking for a nice place to hang your hat, send me a whisper or ingame mail and we can have a chat :ninja:
Take care out there and good hunting all :)

karmakarma

Master Procrastinator

Posts: 442

Location: Miami

Occupation: Diesel Mechanic (semi-trucks/tractor-trailers)

  • Send private message

3

Saturday, August 10th 2013, 1:13am

also with those macros Wneter listed above, if you want to use the macro to drop dead targets then add "this" (see below) line to the beginning of each one, and when you have a dead target just click the macro to drop target and search for a new one, or just simply drop target if you know no targets are around. it will also drop you as a target as well just incase you are targetting yourself after buffing or healing
...
...

/run if UnitIsUnit("player", "target") or UnitIsDeadOrGhost("target") then TargetUnit("") end

________________________________________

i use these myself -- you can bind one to the "tab" key and the other to "shift+tab" for easy use of each one quickly

****TARGET ONLY LIVING ENEMY PLAYERS, NO PETS, MOBS, OR NPCS****

/run if UnitIsUnit("player", "target") or UnitIsDeadOrGhost("target") then TargetUnit("") end
/run for i=1,10 do TargetNearestEnemy() if UnitIsPlayer("target") then break end end
/run if not UnitIsPlayer("target") then TargetUnit("") end

****TARGET ONLY LIVING FRIENDLY PLAYERS, NO PETS, MOBS, OR NPCS****

/run if UnitIsUnit("player", "target") or UnitIsDeadOrGhost("target") then TargetUnit("") end
/run for i=1,10 do TargetNearestFriend() if UnitIsPlayer("target") then break end end
/run if not UnitIsPlayer("target") then TargetUnit("") end

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

if you actionbar skills are macros then you cant use another macro to activate them (disabled a long time ago)
also cant use "local" in a RoM macro unless its changed recently but you could do this instead.... (i dont think autoshot disables if you use other skills while its on but i could be wrong... try using Autoshot first then this macro)


/run if GetActionUsable(#) then UseAction(#) end
/run if GetActionUsable(#) then UseAction(#) end
/run if GetActionUsable(#) then UseAction(#) end
/run if GetActionUsable(#) then UseAction(#) end

** no need for wait timers if you use Instant cast skills that have even a short or long cooldown

by using all instant cast skills the macro will allow you to just spam that button while autoshot fills in the time between attacks, you dont want to put autoshot into a macro because clicking the macro will toggle it on/off
LifeFire - Eternal - Grimdal
Mage/Priest/Knight
82/82/82

Give a macro, Take a Macro
Lifefire's Collections

This post has been edited 1 times, last edit by "karmakarma" (Aug 10th 2013, 1:27am)


4

Saturday, August 10th 2013, 3:10am

Quoted

also with those macros Wneter listed above, if you want to use the macro to drop dead targets then add "this" (see below) line to the beginning of each one, and when you have a dead target just click the macro to drop target and search for a new one, or just simply drop target if you know no targets are around. it will also drop you as a target as well just incase you are targetting yourself after buffing or healing

Quoted

/run if UnitIsUnit("player", "target") or UnitIsDeadOrGhost("target") then TargetUnit("") end
This seemed like it was what I wanted, but when I tried it, it would still target the next nearest mob even I already had a living mob targeted.
EDIT: Is there maybe a way to add a line that stops the macro before the line that targets if conditions are met (like /stop script if target is alive and hostile or something)?

So it's not possible to have a macro that turns Autoshot on, and not turn it off if it's pressed again?

This post has been edited 1 times, last edit by "Steadyshot" (Aug 10th 2013, 3:16am)


Cike

Rogue

Posts: 4,171

Occupation: Being Human

  • Send private message

5

Saturday, August 10th 2013, 4:21am

autoshot automatically turns off when you switch targets, and must be re-enabled....
my r/p can outdps r/m. your name is stupid.

mages should stack dex. word.

Posts: 70

Location: Austin, Texas

Occupation: Quality Assurance Manager

  • Send private message

6

Saturday, August 10th 2013, 2:00pm

The way I got around the Autoshot issue was to use a custom add-on rather than an in-game macro. The advantage is the add-on can keep track of variables and you can better control when it is needed. You are also not limited in the number of characters in the same way that a macro is.

Source code

1
2
3
local incombat = GetPlayerCombatState()
if not (incombat) then AShot = false; end
if (not (AShot)) and SkillUsable("Autoshot") then CastSpellByName("Autoshot"); AShot = true; end


The SkillUsable() function is one that was posted in the forums long ago. It checks your entire skill list (primary and secondary class skills) to see if you have the named skill available, and if it is not on cool down. This has the big advantage of allowing you to move skills around on your tool bar without having to edit your macros again to keep all the slots and skills matched up.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function SkillUsable(SkillName)
      x = 1
  while (x <= 5G) do
        	totalCount = etNumSkill(x)
        	if (totalCount) then
   	  	 	y = 1
   	  	 	while (y <= totalCount) do
 		   	local name, _1, icon, _2, rank, _3, tp_to_upgrade, energy_type, usable = GetSkillDetail(x,y)
 		   	if string.lower(name) == string.lower(SkillName) and usable == true then
  	 	     	totalCD, remainingCD = GetSkillCooldown(x, y)
  	 	     	if (remainingCD < 1) then
   	  	return true
  	 	end
 		   	end
 		   	y = y + 1
   	 	end
    	end
    	x = x + 1 
    end
    return false
end

This post has been edited 1 times, last edit by "LordKaedric" (Aug 10th 2013, 3:00pm)


7

Saturday, August 10th 2013, 6:12pm

autoshot automatically turns off when you switch targets, and must be re-enabled....
Thats fine, I just want a macro that doesn't turn it off after it turns it on on the same target.

Quoted

The way I got around the Autoshot issue was to use a custom add-on rather than an in-game macro. The advantage is the add-on can keep track of variables and you can better control when it is needed. You are also not limited in the number of characters in the same way that a macro is.
This seems interesting, could you go into more detail on how the add-on works and how I go about setting it up?