Jump to content
Sign in to follow this  
----

Input boxes

Recommended Posts

----

I have a script that uses pixelsearch to find a color in a very small space on the screen... Is it possible to use an input box so that I could change the dimensions for the pixelsearch everytime it starts by making the inputs into a variables to plug into the script and become the pixelsearch dimensions?

Share this post


Link to post
Share on other sites
BatMan22
1 hour ago, ---- said:

I have a script that uses pixelsearch to find a color in a very small space on the screen... Is it possible to use an input box so that I could change the dimensions for the pixelsearch everytime it starts by making the inputs into a variables to plug into the script and become the pixelsearch dimensions?

If I am understanding your question correctly.. It's very easy to do.. Start below.

#include <Array.au3>

Example()

Func Example()
    ; Places the input box in the top left corner displaying the characters as they
    ; are typed.
    Local $sX = InputBox("Enter X Start Coordinates", "Enter X Start Coordinates", "0")
    Local $sX2 = InputBox("Enter X End Coordinates", "Enter X End Coordinates", "1000")
    Local $sY = InputBox("Enter Y Start Coordinates", "Enter Y Start Coordinates", "0")
    Local $sY2 = InputBox("Enter Y End Coordinates", "Enter Y End Coordinates", "1000")
    Local $where = PixelSearch($sX, $sY, $sX2, $sY2, 0xFF0000) ; Searches for red in the coordinates you give it.
    _ArrayDisplay($where)
EndFunc

 

Share this post


Link to post
Share on other sites
----

Thanks!

It worked perfectly

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×