ScriptUO

Official ScriptUO EasyUO Scripts => Script Snippets => Topic started by: Cerveza on April 07, 2011, 06:38:36 AM

Title: Pixel Scanning for Icons
Post by: Cerveza on April 07, 2011, 06:38:36 AM
Here's a couple of subs to ease the pain of pixel scanning to see changes (or lack of change) for icons. Could be used for other things also... not sure what.

SETUP
Code: [Select]
; ***** sub set_pixel *****
; %1 - pixel number
; %2 - name
; %3 - event macro 1
; %4 - event macro 2
; gosub set_pixel 1 LightningStrike 15 149 ; lightning strike

sub set_pixel
event macro %3 %4
display ok Move mouse to your %2 Button.$You have 2 seconds
wait 2s
savePix #cursorX #cursorY %1
wait 5
display ok Pixel saved as # %1 $Do NOT move that icon!
return

CHECK - returns #true if pixel matches and #false if it doesn't
Code: [Select]
; ***** sub check_pixel *****
; %1 - pixel number
; %2 - t/f true or false
; gosub check_pixel 1 f

sub check_pixel
cmppix %1 %2
  return #true
return #false
Title: Re: Pixel Scanning for Icons
Post by: Endless Night on April 07, 2011, 07:27:03 AM
This is one of the things OpenEUO would have greatly improved upon.  This its commands to quickly scan and identify gumps from a list  you would always be able to find the right spell/speacil gump and chack its status without worries of it moving or being covered.
Title: Re: Pixel Scanning for Icons
Post by: TrailMyx on April 07, 2011, 07:33:18 AM
Definitely.  With EUO, you are limited to the fixed parse speed, but running native Lua and what is probably nearly raw GDI calls, you can expect that code to run at near native-speed.