Jump to content

How does pixelsearch work?


Bamse
 Share

Recommended Posts

  • Developers

Ok... BACK to the helpfile:

which part of this extensive part of the helpfile code did you NOT implement?

; Find a pure red pixel in the range 0,0-20,300
Local $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000)
If Not @error Then
    MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
EndIf

... and WHY is that so damn important?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Why this is so damn important?
When i am learning something i want to know everything, explore the language and create as many possibilities as possible for me to use the language that i am learning.
Pixelsearch have for a long time been a huge problem for me.

Link to comment
Share on other sites

  • Developers
Just now, Bamse said:

Why this is so damn important?

Because it is the answer to your question and to be as blunt as you: What about you kick you brains into gear and start thinking for a bit in stead of constantly asking for cookies ?

So what is it going to be? Answer my last question or being defensive because I am hurting your feeling?
(Which I am not, just trying to sort it issues out yourself in stead of  actually giving those cookies  ;) )

Jos  

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

 

I rewrote the code to get in to my own words of code

Global $left,$top,$right,$bottom,$color
$left = 2384
$top = 613
$right = 2453
$bottom = 700
$color = 0xEDBF27

Global $pix = PixelSearch($left, $top, $right, $bottom, $color, 10)

MouseMove($pix[0], $pix[1])

I have also tested the example code but with no luck.
Getting the same error as before.

 

; Find a pure red pixel in the range 0,0-20,300
Local $aCoord = PixelSearch(2379, 610, 2458, 697, 0xE1B118)
If Not @error Then
    MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
EndIf

I am getting no erros from the ex code 
">Exit code: 0    Time: 0.4913"
But i am not getting an msgbox so it must be some sort of error

 

Edited by Bamse
Link to comment
Share on other sites

if you don't include that au3 you wont get message box

#include <MsgBoxConstants.au3>

; Find a pure red pixel in the range 0,0-20,300
Local $aCoord = PixelSearch(0, 0, 20, 300, 0xFF0000)
If Not @error Then
    MsgBox($MB_SYSTEMMODAL, "", "X and Y are: " & $aCoord[0] & "," & $aCoord[1])
EndIf

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Nice, but did you understand it? Do you understand the need for the error checking? Do you understand why it was giving an error?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

  • Developers
4 minutes ago, Bamse said:

I got it to work, thanks all for your support!

Great and all of that without the @error checking ...    wish you all the luck you can get and hope that pixel is found each time or you will be  screwed.
I was fun to deal with you and rest assured I will not bother you any further and leave you the code slaves that are willing to help people that fail to think for themselves.

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Well, the text in the msgbox of the screenshot he posted is in accordance with the example that has error checking,

so im not sure he didn't use it, im just unsure he understands it.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

17 minutes ago, Jos said:

Great and all of that without the @error checking ...    wish you all the luck you can get and hope that pixel is found each time or you will be  screwed.
I was fun to deal with you and rest assured I will not bother you any further and leave you the code slaves that are willing to help people that fail to think for themselves.

Jos

It's nice to see people helping other out like you guys are doing. Why are you calling them slaves?

 

Link to comment
Share on other sites

  • Developers
1 minute ago, Bamse said:

It's nice to see people helping other out like you guys are doing. Why are you calling them slaves?

Funny to see you even interpret that statement as if it is about the others and not about you asking for cookies like a child.  :)

Over and out.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

24 minutes ago, careca said:

Nice, but did you understand it? Do you understand the need for the error checking? Do you understand why it was giving an error?

The error happen because it couldn't find the right color. I needed to use shades.
Error checking is used because we know where the error came from.

Link to comment
Share on other sites

3 minutes ago, Jos said:

Funny to see you even interpret that statement as if it is about the others and not about you asking for cookies like a child.  :)

Over and out.

You are a funny person, good luck!

Link to comment
Share on other sites

4 minutes ago, Bamse said:

The error happen because it couldn't find the right color. I needed to use shades.
Error checking is used because we know where the error came from.

That wasn't quite the answer i was looking for, something more in the lines of:

The error checking prevents a "critical" error if a pixel is not found, because without it, it's gonna crash trying to read a non existing variable.

But i think you got that.

 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...