Thread Tools Display Modes
10-15-17, 03:10 AM   #1
Mandraxon
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 21
Can this be Turnd to ingame script.

hey People.
i am trying to figure out if i can make a code be used as a macro ingame.

this is the code

Lua Code:
  1. local frame = CreateFrame("FRAME")
  2. frame:RegisterEvent("UNIT_AURA")
  3.  
  4. frame:SetScript("OnEvent", function(self, event, ...)
  5. local unitid = ... if unitid ~= "player" then return end
  6.  
  7. if UnitBuff("player", "Nightfall") then
  8. SpellActivationOverlay_ShowOverlay(SpellActivationOverlayFrame, 248814, "TEXTURES\\SPELLACTIVATIONOVERLAYS\\GENERICTOP_01.BLP", "TOP", 1.2, 139, 65, 239, false, false)
  9. else
  10. SpellActivationOverlay_HideOverlays(SpellActivationOverlayFrame, 248814)
  11. end
  12. end)

can i make a ingame macro of it?

/M
  Reply With Quote
10-15-17, 09:02 AM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
When you say macro, do you mean something that can be toggled on and off?

If you meant you want this code and don't have it, why a macro? You can go to http://addon.bool.no and make a small standalone addon for the code to run.
  Reply With Quote
10-15-17, 10:29 AM   #3
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
Only way you could make this into a macro is if you downloaded 1 of those macro extender addons.

Also, if you're only going to be monitoring your own auras you can get rid of your 1st player check line and change your UNIT_AURA registering to frame:RegisterEvent("UNIT_AURA", "player")

Recommendation for your code though is doing what Kanegasi said and that is go to http://addon.bool.no/ then input all the data to create your own addon with your code.

Here's the changed stuff from what I mentioned about UNIT_AURA

Code:
local f = CreateFrame("Frame")
f:RegisterEvent("UNIT_AURA", "player")
f:SetScript("OnEvent", function(self, event, ...)
   if UnitBuff("player", "Nightfall") then
      SpellActivationOverlay_ShowOverlay(SpellActivationOverlayFrame, 248814, "TEXTURES\\SPELLACTIVATIONOVERLAYS\\GENERICTOP_01.BLP", "TOP", 1.2, 139, 65, 239, false, false)
   else
      SpellActivationOverlay_HideOverlays(SpellActivationOverlayFrame, 248814)
   end
end)
  Reply With Quote
10-15-17, 10:35 AM   #4
Mandraxon
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 21
I just want something i can use without addons, that does what this code does if its possibel..
Nightfall has the same sound as geting a soulshard so i wanted to script a visual of the Nightfall proc that i can run ingame with no need for addons.
  Reply With Quote
10-15-17, 12:40 PM   #5
Tim
A Rage Talon Dragon Guard
 
Tim's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 308
If you don't want your own addon for this then you will have to download a macro extension addon. Even with shortening the variable names it still exceeds the character limit for standard macros.
  Reply With Quote
10-15-17, 01:33 PM   #6
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
Originally Posted by Tim View Post
Also, if you're only going to be monitoring your own auras you can get rid of your 1st player check line and change your UNIT_AURA registering to frame:RegisterEvent("UNIT_AURA", "player")
You forgot to replace RegisterEvent with RegisterUnitEvent, RegisterEvent doesn't take additional arguments.

Code:
local f = CreateFrame("Frame")
f:RegisterUnitEvent("UNIT_AURA", "player")
f:SetScript("OnEvent", function(self, event, ...)
   if UnitBuff("player", "Nightfall") then
      SpellActivationOverlay_ShowOverlay(SpellActivationOverlayFrame, 248814, "TEXTURES\\SPELLACTIVATIONOVERLAYS\\GENERICTOP_01.BLP", "TOP", 1.2, 139, 65, 239, false, false)
   else
      SpellActivationOverlay_HideOverlays(SpellActivationOverlayFrame, 248814)
   end
end)
  Reply With Quote
10-15-17, 04:03 PM   #7
Mandraxon
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jul 2009
Posts: 21
Ok i get whats down then.
i am working on a project and have included this script to make it work.
Thanks people.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Can this be Turnd to ingame script.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off