Sign in to follow this  
Followers 0
Brightview

Pixel Search Using keyboard

8 posts in this topic

So I'm making a code that will find a pixel and when it does, the keyboard will stop moving. Unfortunately It's not working, anyhelp?

Here:

$coord = PixelSearch(402,44,506,109, 0x4B52FF, 10)
    If Not @error Then
        Send("{DOWN 1}")
    Elseif @error Then
        Send("{DOWN 1}")
    EndIf

I want it to stop if it find the pixel I'm looking for.Thanks and regards.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

keyboard will stop moving

What does it mean do you want it to get blocked

one more thing both the execution for your if statements are the same

$coord = PixelSearch(402,44,506,109, 0x4B52FF, 10)
    If Not @error Then
        Send("{DOWN 1}")
    Elseif @error Then
        Send("{DOWN 1}")
    EndIf

Why not try

If Not @error Or @error Then Send("{DOWN 1}")

I even dont understand if error too u are executing the same statement & when no error then too the same??

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I mean the program will stop the keyboard from hitting the arrow keys.

I've made it to work by using two different codes and running them at the same time, but it makes the computer slow.

The problem is, I want to push the keyboard simultaneously until the right pixel came out.

sorry for my bad english

Edited by Brightview

Share this post


Link to post
Share on other sites

Blockinput()


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

what do you mean?

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I mean the program will stop the keyboard from hitting the arrow keys.

For the above try this code:
HotKeySet('{DOWN}','_Pressed')
HotKeySet('{UP}','_Pressed')
HotKeySet('{RIGHT}','_Pressed')
HotKeySet('{LEFT}','_Pressed')
While 1
Sleep(20000)
WEnd
Func _Pressed()
;ConsoleWrite('Hotkey Pressed:'&@HotKeyPressed&@CRLF)
EndFunc

I want to push the keyboard simultaneously until the right pixel came out.

For this try this code:
Local $coord
While 1
$coord = PixelSearch(402,44,506,109, 0x4B52FF, 10)
If Not @error Then ExitLoop
If @error Then Send("{DOWN 1}")
WEnd
MsgBox(64,"Information","Pixel Found at ("&$coord[0]&','&$coord[1]&')')

Note: when the pixel is not found {Down 1} is send , so {Down 1} should do something with your Computer so that the Color under the Pixel Coordinate Should change orelse it will trigger a infinite loop and u wont get a successful result

If u still dont get your successful result then please give more information regarding the program u r interacting with and also the total code u r using right now

Regards

Phoenix XL

Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
Share on other sites

What application do you try to automate?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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  
Followers 0