Get correct scaling of pixels menu

User Tag List

Results 1 to 6 of 6
  1. #1
    Cashless's Avatar Member
    Reputation
    3
    Join Date
    Oct 2018
    Posts
    17
    Thanks G/R
    9/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get correct scaling of pixels

    Hi,

    I am also trying to program a pixelbot, but it fails to read the pixels correctly.

    I create the pixels using an addon.
    Code:
    local uiScale = UIParent:GetEffectiveScale()
    print("UI Scale: " .. uiScale)
    local squareSize = 5*uiScale
    local function createSquare(xOffset)
        local square = CreateFrame("Frame", nil, UIParent)
        square:SetSize(squareSize, squareSize)
        square:SetPoint("TOPLEFT", xOffset, 0)
        square.texture = square:CreateTexture(nil, "BACKGROUND")
        square.texture:SetAllPoints(true)
        square.texture:SetColorTexture(1.0, 1.0, 1.0, 1.0)
        return square
    end
    
    local TestPixel = createSquare(squareSize)
    What I expect now: Pixel extends from pixel 6-10 in the WoW window.
    What it actually is: from pixel 6 to 16 or they overlap. It is kind of messy

    How do I calculate the actual positions of the pixels?

    Get correct scaling of pixels
  2. #2
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    when I did a pixelbot I wanted to have 1 pixel just per box so I didn't use ui scaling, it was possible to get 1:1 ratio with scaling turned off I think. might be easier, then your bot can screengrab a small poortion , just what it needs, I mean a few pixels can be enough for a simple grind bot

    for example writing the wow addon so it puts the pixels in top-left corner, then screengrab and zoom in and see if it's correct

  3. #3
    Cashless's Avatar Member
    Reputation
    3
    Join Date
    Oct 2018
    Posts
    17
    Thanks G/R
    9/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hjalplos View Post
    when I did a pixelbot I wanted to have 1 pixel just per box so I didn't use ui scaling, it was possible to get 1:1 ratio with scaling turned off I think. might be easier, then your bot can screengrab a small poortion , just what it needs, I mean a few pixels can be enough for a simple grind bot

    for example writing the wow addon so it puts the pixels in top-left corner, then screengrab and zoom in and see if it's correct
    But how did you created just 1pixel?

  4. #4
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Last edited by hjalplos; 11-06-2023 at 10:00 AM.

  5. #5
    Cashless's Avatar Member
    Reputation
    3
    Join Date
    Oct 2018
    Posts
    17
    Thanks G/R
    9/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by hjalplos View Post
    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)
    Code:
    Box:SetSize(1, 1)
    It is not 1 pixel anymore. Even if I change the resolution from 4k to 1080p, it is not predictable

  6. #6
    hjalplos's Avatar Member
    Reputation
    6
    Join Date
    Dec 2019
    Posts
    37
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well my code works.. I don't know what your createSquare() looks like.. I see you fully haven't undestood this anyways.
    Why are you creating more squares and setting them to the same location? Good luck.

Similar Threads

  1. Get exalted with Scale of Sand + a lot of epix (fast and safe ^^)
    By raghathol in forum World of Warcraft Exploits
    Replies: 6
    Last Post: 10-18-2007, 03:22 PM
  2. Get on top of Anvilmar
    By Ced in forum World of Warcraft Exploits
    Replies: 7
    Last Post: 09-27-2006, 11:01 PM
  3. Get on top of Gadgetzan Inn
    By rock in forum World of Warcraft Exploits
    Replies: 12
    Last Post: 08-09-2006, 12:31 AM
  4. Get on top of Redridge, Lakeshire Inn + Another SW thingy.
    By Ced in forum World of Warcraft Exploits
    Replies: 4
    Last Post: 07-21-2006, 10:52 AM
  5. Getting on top of the Forlorn Ridge 1.9
    By Matt in forum World of Warcraft Guides
    Replies: 7
    Last Post: 05-07-2006, 07:50 AM
All times are GMT -5. The time now is 11:50 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search