Sign in to follow this  
Followers 0
Puckhead

PixelSearch

8 posts in this topic

#1 ·  Posted (edited)

Hi,

I have done a small script to find a pixel with pixelsearch and sometimes it finds it and sometime it don't. When it search for the pixel the mouse is a timeglass. Is that a problem?

And is it also possible to search in a rectangle that is in a dirconal angle?

br

Kenneth

Edited by Puckhead

Share this post


Link to post
Share on other sites



No, idea what he just said.


The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

I use pixelsearch to find a pixel. My mousepointer is a timeglass at the moment I need to search for the pixel. The pixel I'm trying to find is active for about 4-5 seconds. Sometime pixelsearch find the pixel and sometime it dosen't find it. Any idea why that dosen't compute?

Pixelsearch search in rectangle with 2 coordinates. Is it possible to search in diagonal rectangle? You knoe from lower left corner to upper right corner?

br

Kenneth

Share this post


Link to post
Share on other sites

Well, as for the coordinates, it has to be a rectangle. I don't believe it matters if the mouse is a timeglass and it might not find the pixel by the time its gone. Could you post the script?


The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

HotKeySet("^+e","vExit") ;hotkey to stop the script

Const $FileName = 'c:\temp\PixelFinder.txt'

$StrPOS = ''

$file = FileOpen($FileName, 9)

; Check if file opened for reading OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

Sleep(10000)

FileWrite($file, @CRLF)

FileWrite($file, "DATO: " & @MDAY & '-' & @MON & '-' & @YEAR & " STARTTIME: " & @HOUR & ":" & @MIN & ":" & @SEC & CRLF)

$begin = TimerInit()

Do

Send("{SPACE}")

$POSCoord = PixelSearch( 125,30, 781,488, 600988 )

If Not @error Then

FileWrite($file, $POSCoord[0] & ',' & $POSCoord[1] & @CRLF)

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

EndIf

$RDMSleep = Random(1,5,1)

$RDMSleep = $RDMSleep & '000'

Sleep($RDMSleep)

$dif = TimerDiff($begin)

Until $dif >= 1800000

FileWrite($file, "DATO: " & @MDAY & '-' & @MON & '-' & @YEAR & " ENDTIME: " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF)

FileClose($file)

Func vExit()

FileWrite($file, $Text & @CRLF)

FileWrite($file, $Bet & @CRLF)

FileWrite($file, $Gevinst & @CRLF)

FileWrite($file, @ScriptLineNumber & @CRLF)

FileWrite($file, "DATO: " & @MDAY & '-' & @MON & '-' & @YEAR & " ENDTIME: " & @HOUR & ":" & @MIN & ":" & @SEC & @CRLF)

FileClose($file)

Exit 0

EndFunc

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

I think it might be how you wrote you color to search, I think it needs to be written in hex (reads helpfile) hex or decimal so uhhh it might just not be searching for the pixel until its gone sense you said its only there for 4-5 seconds. and if thats from the start of the script you have a sleep for 10 seconds. I didn't really read much except the pixelsearch because its not in tags

Edited by Infinitex0

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Share this post


Link to post
Share on other sites

I think it might be how you wrote you color to search, I think it needs to be written in hex (reads helpfile) hex or decimal so uhhh it might just not be searching for the pixel until its gone sense you said its only there for 4-5 seconds. and if thats from the start of the script you have a sleep for 10 seconds. I didn't really read much except the pixelsearch because its not in tags

I'm not sure what you mean by "I think it needs to be written in hex". Is it just the color that should be in hex?

Share this post


Link to post
Share on other sites

well, it can be written in hex or decimal......so either one, I just didn't remember if it was hex specific and went on a long talk without really paying attention to the problem because I sometimes type what I think.......<.< but no, the color should be good as long as its value it either hex or decimal.


The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

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