Originally Posted by
hjalplos
local MyFrame = CreateFrame("Frame")
local Box = CreateFrame("Frame", nil, UIParent)
Box:SetFrameStrata("FULLSCREEN_DIALOG")
Box:SetSize(1, 1)
Box:SetPoint("TOPLEFT", 0, 0)
Box.Texture = Box:CreateTexture(nil, "BACKGROUND")
Box.Texture:SetAllPoints(true)
local combat = false
MyFrame:RegisterEvent("PLAYER_REGEN_DISABLED")
MyFrame:RegisterEvent("PLAYER_REGEN_ENABLED")
MyFrame.elapsed = 0.125
MyFrame:SetScript("OnUpdate", function(self, elapsed)
self.elapsed = self.elapsed - elapsed
if self.elapsed > 0 then return end
self.elapsed = 0.01
local r = 1
local g = 1
local b = 1
if combat then r = 255 end
if UnitCastingInfo("player") ~= nil or UnitChannelInfo("player") ~= nil then g = 255 end
if UnitGUID('target') ~= nil then b = 255 end
Box.Texture:SetColorTexture(r/255,g/255,b/255,1);
)
MyFrame:SetScript("OnEvent",function(self,event,msg,msg2,msg3,msg4,...)
if event=="PLAYER_REGEN_DISABLED" then
combat = true
elseif event=="PLAYER_REGEN_ENABLED" then
combat = false
end
end
)
like this you could easily make a rotation bot for example...
extract what keybind HeroRotation suggest and code it into a pixel and then read it with some python code and press the correct bind.
Thank you very much!
So yeah, one pixel is working fine, but if I create more than one pixel, its gonna be difficult, because I dont have the exact position or WoW isnt that pixel correct
Like
Code:
local TestPixel = createSquare()
TestPixel:SetPoint("TOPLEFT",0,0,0)
local PlayerLevel = createSquare()
PlayerLevel:SetPoint("LEFT",TestPixel,"RIGHT",0,0)
local PlayerHealth = createSquare()
PlayerHealth:SetPoint("LEFT",PlayerLevel,"RIGHT",0,0)
local PlayerMaxHealth = createSquare()
PlayerMaxHealth:SetPoint("LEFT",PlayerHealth,"RIGHT",0,0)
It is not 1 pixel anymore. Even if I change the resolution from 4k to 1080p, it is not predictable