Jump to content


Photo

Script for Rapidly Marking Targets


  • Please log in to reply
31 replies to this topic

#1 Astrylian

Astrylian

    Rawr

  • Members
  • 3,604 posts

Posted 26 November 2007 - 06:18 PM

I looked around and couldn't find an addon that satisfied my needs in marking targets, so I wrote a script for it myself. I figure that more people may be interested in this, so here it is... It probably wouldn't be too hard to turn it into a decent addon, with the mark order graphically customizable, and a feature to use a modifier to reset it or something... But whatever, that's up to you, anyone is free to make an addon from this, just credit me on it, and let me know if you do.


I've got a small addon that I toss scripts in, so it's in that, but you could add it to any addon's .lua file:

lastMark = 0;
currentMarkIndex = 0;
AstrylMarks = {8, 4, 3, 6, 0}; --My guild's normal kill order is skull, triangle, diamond, and square is the normal sheep target
function Astryl_Mark()
  if (UnitExists('mouseover')) then
    if ((GetTime() > lastMark + 5) or (currentMarkIndex >= table.getn(AstrylMarks))) then
      currentMarkIndex = 0;
    end
    lastMark = GetTime();
    currentMarkIndex = currentMarkIndex + 1;
    SetRaidTarget('mouseover', AstrylMarks[currentMarkIndex]);
  end
end

You can change the contents of AstrylMarks at runtime during the instance to whatever marks you will typically be using. In my default case, my guild typically kills Skull, then Triangle, then Diamond, then Square (sheeped). So, my defauly AstrylMarks is {8, 4, 3, 6, 0}, the numbers associated with each of those marks (and 0 is no mark), but I can change AstrylMarks at any time, usually at the beginning of a run to match what tank targets I'll need, and what CCs I have available.

Anyway, how it works: Make a macro, /script Astryl_Mark(), and drop that on a bar somewhere, or use some other addon to bind that to a key, or whatever. Somehow, make it activate that macro via a keypress. I use the ` key. Then, when you come to a pack of mobs, hover your cursor over the first mob (no need to target it), hit the key, move to the 2nd mob, hit the key, etc. Just move your cursor over the mobs in the order you want to mark them, and tap the key. It'll cycle through the marks in AstrylMarks, and then start over. It'll also start over if you haven't marked anything within 5 sec (ie, for the next pack of mobs).

It's not perfect, but figured someone could make use of it. Enjoy.

#2 Erzy

Erzy

    Von Kaiser

  • Members
  • 31 posts

Posted 26 November 2007 - 06:52 PM

Looks really nice. Although I'm not a raidleader myself, I could always suggest this to my raidleaders and see if they want it.

#3 Modhne

Modhne

    Von Kaiser

  • Guild Members
  • 151 posts
  • LocationMinneapolis

Posted 26 November 2007 - 07:33 PM

I'm not sure if this is a discussion on how to speed up marking targets or just a macro you made, so if my post is useless go ahead and delete it, but I've been using Simple Raid Target Icons found here: WoWInterface Downloads : Simple Raid Target Icons
Double click brings up a circular portrait of the mob with the 8 raid icons surrounding it. Click on one and it gets marked. There are other triggers but I haven't customized it further since it already made my marking time in SSC go down substantially.

#4 Astrylian

Astrylian

    Rawr

  • Members
  • 3,604 posts

Posted 26 November 2007 - 07:43 PM

Right, and that takes a double click, a mouse movement, and a click, for each mob, a total of 8 mouse movements and 12 clicks to mark 4 mobs, whereas my solution takes 4 mouse movements and 4 keypresses.

#5 Endahl

Endahl

    Piston Honda

  • Members
  • 108 posts

Posted 26 November 2007 - 07:51 PM

If you're just interested in the amount of user interface actions, yes. But the solutions aren't really mutually exclusive. Your script solution is faster for repetitive and mechanical marking of mob packs, but the mod allows some flexibility for re-marking and changing things on the fly. No real reason you couldn't use both.

As an aside, SRTI doesn't require a double click to bring up the menu ring. You can use a modified click or a keybinding. I have my mouse button 5 set to it.

#6 Astrylian

Astrylian

    Rawr

  • Members
  • 3,604 posts

Posted 26 November 2007 - 08:18 PM

Aye, quite true. I found that 90% of my marking was the same symbols over and over, in the same/similar sequence, so made this script to automate that 90%.

#7 Baloril

Baloril

    Von Kaiser

  • Members
  • 86 posts

Posted 26 November 2007 - 08:49 PM

I just bound the various raid target icons to my F1-F8 keys, because I don't need them for anything else, which makes it easy to assign arbitrary targets in the middle of a fight or in other situations where targets need to be marked quickly. It works quite well.

#8 Astrylian

Astrylian

    Rawr

  • Members
  • 3,604 posts

Posted 26 November 2007 - 08:58 PM

Aye, that works quite well for those who have 8 spare keybindings.

#9 Modhne

Modhne

    Von Kaiser

  • Guild Members
  • 151 posts
  • LocationMinneapolis

Posted 26 November 2007 - 09:20 PM

Right, and that takes a double click, a mouse movement, and a click, for each mob, a total of 8 mouse movements and 12 clicks to mark 4 mobs, whereas my solution takes 4 mouse movements and 4 keypresses.


True, but I know for a fact that I'll mismark at least once every 3-4 pulls on one mob which makes me have to go back and use the normal marking features or reset the macro. With STRI I can just remark the one mob, not the entire pack. The packs of Broken in SSC are horrible to mark, especially the first group after Lurker near the console.

And to the people who have 8 extra keybindings laying around, I am jealous.

#10 chase

chase

    Piston Honda

  • Members
  • 204 posts

Posted 26 November 2007 - 09:43 PM

And to the people who have 8 extra keybindings laying around, I am jealous.


At least 104 keys on your keyboard. You have shift/alt/ctrl modifers.

The only keybindings I "run out of" are ones that are easy/comfortable to reach. This is for something done out of combat with no real rush, so it does not really need to be comfortable or in easy reach.

Doesn't take away from the utility of the script. Personally I'm used to using my numpad to mark targets and that can all be done in the standard keybinding menu.

#11 mutagen

mutagen

    Don Flamenco

  • Members
  • 395 posts

Posted 26 November 2007 - 10:09 PM

And to the people who have 8 extra keybindings laying around, I am jealous.


I bound mine to CTRL-Numpad 1-8 (9 clears the raid mark). This was easier when I could extend the tab range and just tab through and hotkey the marks up on the mobs but even now it isn't hard to put them up.

#12 Axelrod

Axelrod

    Von Kaiser

  • Members
  • 45 posts

Posted 27 November 2007 - 04:53 AM

There was an addon I used to use (forget what it was called) pre-BC where I'd hit one key, then slide my mouse over the mobs one by one and it would mark them sequentially. If we were in the middle of a fight and some marking needed to be done, I'd hit the same key and just scribble my mouse all over the screen and it would mark them all. It was my favorite raid marking addon because it was so quick and easy (especially in AQ and Naxx where mobs all stood in a line), but you'd have to have patience in sliding your mouse in the correct order if you want to mark them in a certain order.

#13 Revv

Revv

    Glass Joe

  • Members
  • 10 posts

Posted 27 November 2007 - 04:59 PM

Being a non-healer, I also bind my raid symbols to F2-F9 (F1 was already doing something else before Blizzard gave us raid symbols).

I wrote my own mod to mouse over and paint multiple targets. Here it is for those interested. (Note, it's part of a small group of tools I use, and I pulled only the target painting code out of the mod, my apologies if this doesn't work out of the box.)

/pt begins or toggles the painting of targets. After 7 seconds, it stops checking for new targets.

RaidTools = AceLibrary("AceAddon-2.0"):new("AceConsole-2.0", "AceEvent-2.0")

local paintRaidSymbolId = 1

function RaidTools:OnInitialize()
    -- Paint targets with raid icons; /pt
    self:RegisterChatCommand({"/pt"}, {
        type = "execute",
        name = "paint targets with raid icons",
        desc = "Mouse over enemy mobs, and place a raid target on each.",
        func = "paintTargets",
    })
end

function RaidTools:UPDATE_MOUSEOVER_UNIT()
    -- Handle painting.
    if self:IsEventScheduled("Stop Painting") == true then
        if (not UnitExists("mouseover")) or (not UnitIsEnemy("player", "mouseover")) or
          UnitIsCorpse("mouseover") or UnitPlayerControlled("mouseover") then
            return      -- Not a valid target to paint.
        end

        local raidIconId = GetRaidTargetIndex("mouseover")

        if raidIconId and (raidIconId > 0) then
            return      -- Target has a raid icon set already.
        end

        SetRaidTarget("mouseover", paintRaidSymbolId)

        paintRaidSymbolId = paintRaidSymbolId + 1

        if paintRaidSymbolId > 8 then
            paintRaidSymbolId = 1
        end
    end

    return
end

function RaidTools:stopPainting()
    RaidTools:UnregisterEvent("UPDATE_MOUSEOVER_UNIT")

    UIErrorsFrame:AddMessage("--- Done Painting Targets ---", 1, 1, 1, 1, UIERRORS_HOLD_TIME)

    return
end

function RaidTools:paintTargets()
    if RaidTools:IsEventScheduled("Stop Painting") == true then
        -- Turn off painting.
        RaidTools:CancelScheduledEvent("Stop Painting")
        RaidTools:stopPainting()
        return
    end

    paintRaidSymbolId = 1

    -- Register the mouseover event, if we haven't already.
    if RaidTools:IsEventRegistered("UPDATE_MOUSEOVER_UNIT") == false then
        RaidTools:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
    end

    UIErrorsFrame:AddMessage("--- Begin Painting Targets ---", 1, 1, 1, 1, UIERRORS_HOLD_TIME)

    -- Start the timer to end the painting.  (7 seconds)
    RaidTools:ScheduleEvent("Stop Painting", RaidTools.stopPainting, 7)

    return
end


#14 Calantus

Calantus

    Custom User Title

  • Members
  • 804 posts

Posted 30 November 2007 - 04:55 AM

nvm

#15 Tehehe

Tehehe

    Von Kaiser

  • Members
  • 95 posts

Posted 30 November 2007 - 11:32 AM

The following macro has been invaluable to me over the past couple months of raid leading, it really speeds things up.

/script local ri = 8; if GetRaidTargetIndex("mouseover") ~= ri then SetRaidTarget("mouseover",ri) else SetRaidTarget("mouseover",0) end


It will place a skull on the mouseover target, if there is already a skull, it will remove it. I have 8 of these macros, one for each icon.

#16 Eylirria

Eylirria

    Piston Honda

  • Members
  • 245 posts

Posted 08 December 2007 - 12:29 AM

I'll be trying that out, but I'm not sure how much I would value it over my current setup:

On the numpad:

1 - Skull, 2 - X, 3 - Diamond, 4 - Square, 5 - Triangle, 6 - Moon, 7 - Star, 8 - Circle.
0 - Clears current target's symbol.


I have the numpad bindings arranged so that it follows usual kill order: 1 - 2 - 3 - 4 - 5 is the Assist-train, 7-8-9-6 are the usual CC targets. Other than freeing up keybinds I already have no use for, and saving me some centimeters worth of finger movement, I can't see much use for it.

#17 valex

valex

    Glass Joe

  • Members
  • 6 posts

Posted 15 December 2007 - 01:37 AM

OP: I would love to get that script working, from the directions posted I have no clue how to do it, I have tried multiple things... I love the idea of how incredibly quickly and efficiently you could mark targets with this script which is why I am now posting. I started looking at the code that addons use and trying to adapt the script into it with no luck.

But... one of the people that posted the macro:

/script local ri = 8; if GetRaidTargetIndex("mouseover") ~= ri then SetRaidTarget("mouseover",ri) else SetRaidTarget("mouseover",0) end


It would seem that to get that macro do do exactly the same thing all that it would require is the ability to increment a value... Which, also seems possible just by looking at the complexity of the macro in the first place. Ideally the finishing touch would be a timer that once you waited 5 seconds inbetween marks, it would default back to the skull again and you could remark if something messed up.

As a raid leader and a priest, a buffing class, AND a CCing class, it is essential that everything be keybound and as quick and easy to get to as possible.

Val

#18 Vranx

Vranx

    Von Kaiser

  • Members
  • 31 posts

Posted 15 December 2007 - 02:13 PM

JasonTag will put a box with the icons on your screen when you are a party or raid leader. You just drag the icon to the mob you want it on.
World of Warcraft Addons - WowAce.com

#19 Noraj

Noraj

    Don Flamenco

  • Members
  • 406 posts

Posted 15 December 2007 - 11:39 PM

I believe BanaBar (Available on WoWAce) has auto-mark functionality as well. Beyond that, the mod features drag-and-drop marking.
"The question is not how far we are going to take it... the question is, do you possess the constitution to go as far as needed?" - Il Duce

#20 Tehehe

Tehehe

    Von Kaiser

  • Members
  • 95 posts

Posted 17 December 2007 - 01:24 PM

It would seem that to get that macro do do exactly the same thing all that it would require is the ability to increment a value... Which, also seems possible just by looking at the complexity of the macro in the first place. Ideally the finishing touch would be a timer that once you waited 5 seconds inbetween marks, it would default back to the skull again and you could remark if something messed up.

Yes, that would be pretty easy to do, you don't need a mod, just a macro. Let me get this straight, though:

1. On press, put icon on mouseover target (e.g., star).
2. On next press, put the "next" icon on mouseover target (e.g., circle).
3. If it has been 5 or more seconds since lass press, reset to the first icon.

This should do it:
/script if iconid==nil or iconid>8 or (time()-lasticontime)>5 then iconid=1 end SetRaidTarget("mouseover",iconid); lasticontime=time(); iconid=iconid+1;





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users