1. #1

    Lightbulb Request/Help needed with a very simple addon:

    I searched the web and couldn't find an addon that does the following:

    Say in battleground/arena chat "selected target" by pressing certain key.
    (because it's a lot easier for me to do that for target's coordination in BG/Arena with non-headphones partners)


    It's a really simple feature, but i dont know nothing about lua development.
    I'm a senior java developer but trainee in lua

    Can you help with some code/advice?

    Thanks a lot

  2. #2
    Deleted
    Do you really need an addon for that? Seems like a lot of overhead to me.
    Why don't you just macro it?
    Code:
    /run local u,i,t="target",IsInInstance()if i and ((t=="arena")or(t=="pvp"))and UnitExists(u)and UnitIsEnemy("player",u)and (bit.band(UnitGUID(u),"0x00F")==0) then SendChatMessage(("Selected target: %s"):format(GetUnitName(u)),"BATTLEGROUND") end
    Could be made a lot shorter, but does the job.

    If you really want an addon, you'd have to use CreateFrame to create a button, then SetScript its OnClick (or PreClick/PostClick) script to what you want to run (likely something akin to the above), then use SetBindingClick to bind a key to simulate a click on your button.
    Last edited by mmocba105e19de; 2012-10-25 at 08:53 AM.

  3. #3
    Quote Originally Posted by Treeston View Post
    Do you really need an addon for that? Seems like a lot of overhead to me.
    Why don't you just macro it?
    Lol i miss that.
    Thanks!
    I'll test it tonight

  4. #4
    Deleted
    Just out of curiosity, as I've rarely dabbled in "type to chat" style macros, would something as simple as "/bg %t" work?

  5. #5
    Deleted
    Yeah, but that would also possibly occur for non-enemy or non-player targets.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •