Skip to content

Commit

Permalink
Wrap to known type
Browse files Browse the repository at this point in the history
  • Loading branch information
outsidepro-arts committed Apr 6, 2024
1 parent cab50ec commit 187b2a8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion MagicKeys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,19 @@ function screen.isPixelColor(coords, Color)
end

function screen.searchImage(imgPath, window)
return MagicKeys.ImageSearch(imgPath, window)
local retval = MagicKeys.ImageSearch(imgPath, window)
local pos = nil
if retval[0] == 1 then
pos = {
x = retval[1],
y = retval[2],
w = retval[3],
h = retval[4],
cx = retval[5],
cy = retval[6]
}
end
return retval[1] == 1, pos
end

function screen.searchImageAt(imgPath, position, variant)
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Lua/Toontrack EZKeys/Lua/EZkeys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mouse.timeUp = 10

-- Loader
sleep(100)
if screen.searchImage("Browse")[0] == 0 then
if not screen.searchImage("Browse") then
vui.load("Browse")
end

Expand Down

0 comments on commit 187b2a8

Please sign in to comment.