WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Search/Requests (https://www.wowinterface.com/forums/forumdisplay.php?f=6)
-   -   Can this be automated? (https://www.wowinterface.com/forums/showthread.php?t=58806)

phage 06-24-21 03:11 AM

Can this be automated?
 


I need an addon that will select the first option to recruit more troops. Am I allowed to automate that with an addon?

Xrystal 06-24-21 06:10 AM

Others may know for sure one way or another .. but I would suspect that it wouldn't be allowed as any action needs a hardware event .. so if you were to have that autoclicked it would mean clicking the mouse or pressing the keyboard .. which is the same as selecting the item in question and thus may as well leave it as is. But like I said, others may know with a better level of knowledge on the subject.

Kanegasi 06-24-21 03:20 PM

Lua Code:
  1. local f=CreateFrame("frame")
  2. f:RegisterEvent("GOSSIP_SHOW")
  3. f:SetScript("OnEvent",function()
  4.  
  5.     -- get the npc id from its guid
  6.     local _,_,_,_,_,npc=strsplit("-",(UnitGUID("npc")) or "")
  7.  
  8.     -- its a string because it just came from a string
  9.     if npc=="135614" then -- wowhead.com/npc=135614
  10.  
  11.         -- first argument is the ordered number of the gossip window
  12.         -- in this case, 2 would select "stay awhile and listen"
  13.         -- second argument is when a gossip option pops up a box
  14.         -- that needs input, currently only used to interact with
  15.         -- the Tyrael's Hilt npc or Landro Longshot
  16.         -- third argument skips any possible confirmation dialog
  17.         -- that the gossip option may generate
  18.         C_GossipInfo.SelectOption(1,"",true)
  19.  
  20.     end
  21. end)


All times are GMT -6. The time now is 11:41 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI