Thread Tools Display Modes
11-09-19, 12:27 AM   #1
V1X0
A Deviate Faerie Dragon
Join Date: Mar 2009
Posts: 10
Taint from script to move the arena frames (retail)

I got a self made addon (just scripts) to move the default arena frames and do some more stuff (will post down below).

Every time I enter arena I get: "Interface failed because of addon." in the chat (yellow text) (my selfmade addon is called "^Arenaframes").

In my taint log I get this error code:
Code:
11/9 05:12:07.005  UnitFrameHealthBar_Update()
11/9 05:12:07.005  An action was blocked in combat because of taint from ^Arenaframes - ArenaEnemyFrames:Show()
11/9 05:12:07.005      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:94 ArenaEnemyFrames_UpdateVisible()
11/9 05:12:07.005      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:185 ArenaEnemyFrame_UpdatePlayer()
11/9 05:12:07.005      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:224
11/9 05:12:07.005  UnitFrameHealthBar_Update()
11/9 05:12:07.005  An action was blocked in combat because of taint from ^Arenaframes - ArenaEnemyFrame2PetFrame:Hide()
11/9 05:12:07.005      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:314 ArenaEnemyFrame_UpdatePet()
11/9 05:12:07.005      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:234
11/9 05:12:49.301  UnitFrameHealthBar_Update()
11/9 05:12:49.301  An action was blocked in combat because of taint from ^Arenaframes - ArenaEnemyFrames:Show()
11/9 05:12:49.301      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:94 ArenaEnemyFrames_UpdateVisible()
11/9 05:12:49.301      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:185 ArenaEnemyFrame_UpdatePlayer()
11/9 05:12:49.301      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:224
11/9 05:12:49.301  UnitFrameHealthBar_Update()
11/9 05:12:49.301  An action was blocked in combat because of taint from ^Arenaframes - ArenaEnemyFrame1PetFrame:Hide()
11/9 05:12:49.301      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:314 ArenaEnemyFrame_UpdatePet()
11/9 05:12:49.301      Interface\AddOns\Blizzard_ArenaUI\Blizzard_ArenaUI.lua:234
________

Heres the script (put into addon) I'm running that causing the problem. Any suggestion what's causing the taint and how to optimize the coding?

Code:
LoadAddOn("Blizzard_ArenaUI")

for i=1, 5 do
        _G["ArenaEnemyFrame"..i]:SetScale(1.5)
        _G["ArenaEnemyFrame"..i.."CastingBar"]:SetScale(1.5)
        _G["ArenaEnemyFrame"..i.."Name"]:Hide()
        _G["ArenaEnemyFrame"..i].specBorder:SetAlpha(0)
        _G["ArenaEnemyFrame"..i].specPortrait:SetAlpha(0)
end

ArenaEnemyFrame1:ClearAllPoints()
ArenaEnemyFrame2:ClearAllPoints()
ArenaEnemyFrame3:ClearAllPoints()
ArenaEnemyFrame4:ClearAllPoints()
ArenaEnemyFrame5:ClearAllPoints()

ArenaEnemyFrame1:SetPoint("CENTER",UIParent,"CENTER",343,44)
ArenaEnemyFrame2:SetPoint("CENTER",UIParent,"CENTER",343,18)
ArenaEnemyFrame3:SetPoint("CENTER",UIParent,"CENTER",343,-8)
ArenaEnemyFrame4:SetPoint("CENTER",UIParent,"CENTER",343,-34)
ArenaEnemyFrame5:SetPoint("CENTER",UIParent,"CENTER",343,-60)

ArenaEnemyFrame1.SetPoint = function() end
ArenaEnemyFrame2.SetPoint = function() end
ArenaEnemyFrame3.SetPoint = function() end
ArenaEnemyFrame4.SetPoint = function() end
ArenaEnemyFrame5.SetPoint = function() end
Makes the arenaframes look like this:

  Reply With Quote
11-09-19, 05:12 AM   #2
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
The last 5 lines of your script taints those Arena Frames. Why do you need to disable that function?
  Reply With Quote
11-09-19, 10:49 AM   #3
V1X0
A Deviate Faerie Dragon
Join Date: Mar 2009
Posts: 10
Originally Posted by LBXZero View Post
The last 5 lines of your script taints those Arena Frames. Why do you need to disable that function?
I removed the bottom five lines, it fixes the taint(?). But the arenaframes keep resetting, even mid game if there's a stealther.

How would you fix that? I need to lock them in place!
  Reply With Quote
11-09-19, 11:17 AM   #4
d87
A Chromatic Dragonspawn
 
d87's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 163
Find where it gets reset, probably here:
https://github.com/Gethe/wow-ui-sour...rd_ArenaUI.lua
https://github.com/Gethe/wow-ui-sour...rent.lua#L3125

Use hooksecurefunc and move it back where you want
  Reply With Quote
11-10-19, 02:25 AM   #5
V1X0
A Deviate Faerie Dragon
Join Date: Mar 2009
Posts: 10
Originally Posted by d87 View Post
Find where it gets reset, probably here:
https://github.com/Gethe/wow-ui-sour...rd_ArenaUI.lua
https://github.com/Gethe/wow-ui-sour...rent.lua#L3125

Use hooksecurefunc and move it back where you want
Can you provide me with the code? I'm not good with this, mainly been "stealing" the codes. :P

I got this for arena numbers on nameplates (arena numbers instead of lvl number), maybe that coding can be similar for moving and keeping the arenaframes in place? It uses the "hooksecurefunc" like you mentioned.
Code:
-- Arena1-2-3 on nameplates --
local U=UnitIsUnit hooksecurefunc("CompactUnitFrame_UpdateName",function(F)if IsActiveBattlefieldArena()and F.unit:find("nameplate")then for i=1,5 do if U(F.unit,"arena"..i)then F.name:SetText(i)F.name:SetTextColor(1,1,0)break end end end end)
  Reply With Quote
11-10-19, 07:16 AM   #6
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
Looking at the code, the point where the individual ArenaEnemyFrame items are being modified is when "ArenaEnemyFrame_UpdatePlayer" gets called.

Move the lines that clear and set the points for the ArenaEnemyFrame 1 through 5 into its own function. Have the code run that on load, and then use hooksecurefunc to have that function run when ArenaEnemyFrame_UpdatePlayer" runs.

I have not tested this code, but...

Code:
function relocateArenaEnemyFrames()
        ArenaEnemyFrame1:ClearAllPoints();
        ArenaEnemyFrame2:ClearAllPoints();
        ArenaEnemyFrame3:ClearAllPoints();
        ArenaEnemyFrame4:ClearAllPoints();
        ArenaEnemyFrame5:ClearAllPoints();

        ArenaEnemyFrame1:SetPoint("CENTER",UIParent,"CENTER",343,44);
        ArenaEnemyFrame2:SetPoint("CENTER",UIParent,"CENTER",343,18);
        ArenaEnemyFrame3:SetPoint("CENTER",UIParent,"CENTER",343,-8);
        ArenaEnemyFrame4:SetPoint("CENTER",UIParent,"CENTER",343,-34);
        ArenaEnemyFrame5:SetPoint("CENTER",UIParent,"CENTER",343,-60);
end

hooksecurefunc("ArenaEnemyFrame_UpdatePlayer", relocateArenaEnemyFrames);
  Reply With Quote
11-11-19, 04:40 AM   #7
V1X0
A Deviate Faerie Dragon
Join Date: Mar 2009
Posts: 10
Originally Posted by LBXZero View Post
Looking at the code, the point where the individual ArenaEnemyFrame items are being modified is when "ArenaEnemyFrame_UpdatePlayer" gets called.

Move the lines that clear and set the points for the ArenaEnemyFrame 1 through 5 into its own function. Have the code run that on load, and then use hooksecurefunc to have that function run when ArenaEnemyFrame_UpdatePlayer" runs.

I have not tested this code, but...

Code:
function relocateArenaEnemyFrames()
        ArenaEnemyFrame1:ClearAllPoints();
        ArenaEnemyFrame2:ClearAllPoints();
        ArenaEnemyFrame3:ClearAllPoints();
        ArenaEnemyFrame4:ClearAllPoints();
        ArenaEnemyFrame5:ClearAllPoints();

        ArenaEnemyFrame1:SetPoint("CENTER",UIParent,"CENTER",343,44);
        ArenaEnemyFrame2:SetPoint("CENTER",UIParent,"CENTER",343,18);
        ArenaEnemyFrame3:SetPoint("CENTER",UIParent,"CENTER",343,-8);
        ArenaEnemyFrame4:SetPoint("CENTER",UIParent,"CENTER",343,-34);
        ArenaEnemyFrame5:SetPoint("CENTER",UIParent,"CENTER",343,-60);
end

hooksecurefunc("ArenaEnemyFrame_UpdatePlayer", relocateArenaEnemyFrames);
That keeps moving the arenaframes if theres a stealther. Same issue as with the skipping of using "ArenaEnemyFrame1.SetPoint = function() end".

Like everytime someone stealthes the arenaframes keep updating and resetting.
And if I use the "ArenaEnemyFrame1.SetPoint = function() end" they get locked in place - but I get taint everytime someone stealthes I think.

Btw the arena preparation frames are always top right. Then when the game starts, they get in the position. Maybe theres a way to change the arena preparation frames position(?).
(Hard to explain what I mean.)
  Reply With Quote
11-11-19, 01:40 PM   #8
Terenna
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jun 2016
Posts: 105
You could try
Lua Code:
  1. hooksecurefunc(ArenaEnemyFrame1, 'SetPoint', function(self)
  2.     local a, b, c, d, e = self:GetPoint()
  3.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= 44) then
  4.         ArenaEnemyFrame1:ClearAllPoints()
  5.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, 44)
  6.     end
  7. end)
  8.  
  9. hooksecurefunc(ArenaEnemyFrame2, 'SetPoint', function(self)
  10.     local a, b, c, d, e = self:GetPoint()
  11.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= 18) then
  12.         ArenaEnemyFrame2:ClearAllPoints()
  13.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, 18)
  14.     end
  15. end)
  16.  
  17. hooksecurefunc(ArenaEnemyFrame3, 'SetPoint', function(self)
  18.     local a, b, c, d, e = self:GetPoint()
  19.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= -8) then
  20.         ArenaEnemyFrame3:ClearAllPoints()
  21.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, -8)
  22.     end
  23. end)
  24.  
  25. hooksecurefunc(ArenaEnemyFrame4, 'SetPoint', function(self)
  26.     local a, b, c, d, e = self:GetPoint()
  27.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= -34) then
  28.         ArenaEnemyFrame4:ClearAllPoints()
  29.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, -34)
  30.     end
  31. end)
  32.  
  33. hooksecurefunc(ArenaEnemyFrame5, 'SetPoint', function(self)
  34.     local a, b, c, d, e = self:GetPoint()
  35.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= -60) then
  36.         ArenaEnemyFrame5:ClearAllPoints()
  37.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, -60)
  38.     end
  39. end)

Last edited by Terenna : 11-11-19 at 04:53 PM.
  Reply With Quote
11-12-19, 05:37 PM   #9
V1X0
A Deviate Faerie Dragon
Join Date: Mar 2009
Posts: 10
Originally Posted by Terenna View Post
You could try
Lua Code:
  1. hooksecurefunc(ArenaEnemyFrame1, 'SetPoint', function(self)
  2.     local a, b, c, d, e = self:GetPoint()
  3.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= 44) then
  4.         ArenaEnemyFrame1:ClearAllPoints()
  5.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, 44)
  6.     end
  7. end)
  8.  
  9. hooksecurefunc(ArenaEnemyFrame2, 'SetPoint', function(self)
  10.     local a, b, c, d, e = self:GetPoint()
  11.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= 18) then
  12.         ArenaEnemyFrame2:ClearAllPoints()
  13.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, 18)
  14.     end
  15. end)
  16.  
  17. hooksecurefunc(ArenaEnemyFrame3, 'SetPoint', function(self)
  18.     local a, b, c, d, e = self:GetPoint()
  19.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= -8) then
  20.         ArenaEnemyFrame3:ClearAllPoints()
  21.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, -8)
  22.     end
  23. end)
  24.  
  25. hooksecurefunc(ArenaEnemyFrame4, 'SetPoint', function(self)
  26.     local a, b, c, d, e = self:GetPoint()
  27.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= -34) then
  28.         ArenaEnemyFrame4:ClearAllPoints()
  29.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, -34)
  30.     end
  31. end)
  32.  
  33. hooksecurefunc(ArenaEnemyFrame5, 'SetPoint', function(self)
  34.     local a, b, c, d, e = self:GetPoint()
  35.     if (a ~= 'CENTER' or c ~= 'CENTER' or d ~= 343 or e ~= -60) then
  36.         ArenaEnemyFrame5:ClearAllPoints()
  37.         self:SetPoint('CENTER', UIParent, 'CENTER', 343, -60)
  38.     end
  39. end)
I appreciate the try but unfortunately it didn't work (positions reset to top right (default) when updating from stealther/invis, plus gave me C stack overflow lua error).

It's something with stealthers, invisibility. When the arena frames "update" after it, they reset or give me taint.
__

If anyone wanna keep experimenting/trying, can do 3v3 skirmishes and try there, see how it behaves when they update mid game cus of stealth or invisibility.
  Reply With Quote
11-13-19, 05:52 AM   #10
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
Originally Posted by V1X0 View Post
I appreciate the try but unfortunately it didn't work (positions reset to top right (default) when updating from stealther/invis, plus gave me C stack overflow lua error).

It's something with stealthers, invisibility. When the arena frames "update" after it, they reset or give me taint.
__

If anyone wanna keep experimenting/trying, can do 3v3 skirmishes and try there, see how it behaves when they update mid game cus of stealth or invisibility.
I think the problem is not our code. The problem may be that you need to add an xml file and create a base frame for your addon so you can make use of the "OnLoad" and "OnEvent" scripts. Certain instructions don't work if they are called too early.

Last edited by LBXZero : 11-13-19 at 06:21 AM.
  Reply With Quote
11-13-19, 06:17 AM   #11
V1X0
A Deviate Faerie Dragon
Join Date: Mar 2009
Posts: 10
Originally Posted by LBXZero View Post
I think the problem is not our code. The problem is that you need to add an xml file and create a base frame for your addon so you can make use of the "OnLoad" and "OnEvent" scripts. Certain instructions don't work if they are called too early.
I see. That's way to advanced for me(?) so I probably just stick with my old script. Even if it causes taint. What is taint even? Can it affect my performance, fps- and input lag wise?

I found this old thread, with exactly same problem:
https://www.wowinterface.com/forums/...ad.php?t=46675

He found solution in bottom, but I don't understand the post - I think he used MoveAnything addon and changed some code in that addon. Seems like he used "ArenaPrepFrame1" and not "ArenaEnemyFrame1".
Maybe it's a solution, to use ArenaPrepFrame instead of ArenaEnemyFrame?
__

Btw I know there's an addon called "sArena" that is basically default arenaframes with some options. But it's missing some options that I want.
  Reply With Quote
11-14-19, 06:55 AM   #12
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
For taint, some reading material.

https://wow.gamepedia.com/Secure_Execution_and_Tainting
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Taint from script to move the arena frames (retail)

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