EwfwrTtrr Posted June 7, 2013 Share Posted June 7, 2013 I have this script: expandcollapse popup#region HotKeySet HotKeySet("{F4}","PIXELREAD") HotKeySet("{F2}","PIXELFIND") HotKeySet("{f3}","ExitProg") #ENDREGION #region variables dim $pos[2] dim $color Global $counter=0 Global $searchfor = 12059395 Global $on=0 #ENDREGION Func ExitProg() Exit EndFunc #region Functions Func PIXELREAD() $pos = MouseGetPos() $color = PixelGetColor($pos[0],$pos[1]) MsgBox(0,"Color",$color&@CRLF&$pos[0]&","&$pos[1]) EndFunc Func PIXELFIND() $on=1 While $on=1 $pos = PixelSearch(133,231,1155,936,$searchfor) if not @error Then MouseMove($pos[0],$pos[1],0) Sleep(500) MouseDown("left") EndIf If @error Then $counter=$counter+1 EndIf if $counter>5 Then $on=0 EndIf WEnd MouseUp("left") MsgBox(0,"It's Colored","We colored it.") EndFunc #ENDREGION While 1 Sleep(100) WEnd when i press F2 it search for pixel color and left click on it. Works fine. I want to search pixels in a small area in the center of the screen (200 x 200 px) If no pixel find then make area larger and larger until pixel is find and left click on it, then sleep 4 sec and make area small again instant (200 x 200 px) thank you Link to comment Share on other sites More sharing options...
careca Posted June 7, 2013 Share Posted June 7, 2013 I would grab the screen size, and then would increase the coords to search in percentage, each time pixelsearch gives out 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 More sharing options...
EwfwrTtrr Posted June 7, 2013 Author Share Posted June 7, 2013 how to make pixel search to start from center? Link to comment Share on other sites More sharing options...
HeavenlyDemon Posted June 7, 2013 Share Posted June 7, 2013 is center a must be ? $w = 0 $h = 0 start from top left ($w, $h) and every time you get an error $w+1, $h+1 Link to comment Share on other sites More sharing options...
FireFox Posted June 7, 2013 Share Posted June 7, 2013 What do you need this script for ? Link to comment Share on other sites More sharing options...
EwfwrTtrr Posted June 7, 2013 Author Share Posted June 7, 2013 What do you need this script for ? school project Link to comment Share on other sites More sharing options...
FireFox Posted June 7, 2013 Share Posted June 7, 2013 I won't pick on you with my questions. I let the mods decide about your topic. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 7, 2013 Moderators Share Posted June 7, 2013 I think what FireFox is getting at is, what is the name of the application you're trying to manipulate - or how about a more detailed description of what you're trying to accomplish? 90% of the time there is an easier way to do what you want without having to resort to things like pixelsearch. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
EwfwrTtrr Posted June 7, 2013 Author Share Posted June 7, 2013 It is the same program like this Link to comment Share on other sites More sharing options...
FireFox Posted June 7, 2013 Share Posted June 7, 2013 You are not answering JLogan3o13's question (about the program you're trying to manipulate).I hoped that this video was dated, but it's not (2013) and he's still using the Dim keyword and some other bad stuff. Ewwww. Link to comment Share on other sites More sharing options...
EwfwrTtrr Posted June 7, 2013 Author Share Posted June 7, 2013 $Area = 200 $X = @DesktopWidth/2-$Area/2 $Y = @DesktopHeight/2-$Area/2 $ToX = @DesktopWidth/2+$Area/2 $ToY = @DesktopHeight/2+$Area/2 With this code I get the 4 cords I need for PixelSearch. Now I can increase or decrease $Area each loop. Â Can someone help me introducing this in my code? Link to comment Share on other sites More sharing options...
kaotkbliss Posted June 7, 2013 Share Posted June 7, 2013 Something like this I think While $on=1 $pos = PixelSearch($x,$y,$tox,$toy,$searchfor) if not @error Then MouseMove($pos[0],$pos[1],0) Sleep(500) MouseDown("left") ElseIf @error Then $x = $x - $area $y = $y - $area $tox = $tox + $area $toy = $toy + $area $counter=$counter+1 EndIf if $counter>5 Then $on=0 EndIf WEnd But don't forget to add your variables to the top of the script 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
EwfwrTtrr Posted June 7, 2013 Author Share Posted June 7, 2013 Func PIXELFIND() $on = 1 $Area = 200 While $on = 1 $X = @DesktopWidth / 2 - $Area / 2 $Y = @DesktopHeight / 2 - $Area / 2 $ToX = @DesktopWidth / 2 + $Area / 2 $ToY = @DesktopHeight / 2 + $Area / 2 $pos = PixelSearch($X, $Y, $ToX, $ToY, $searchfor) If Not @error Then MouseMove($pos[0], $pos[1], 0) Sleep(500) MouseClick("left") Sleep(4000) $Area = 200 EndIf If @error Then $counter = $counter + 1 $Area = +200 EndIf If $counter > 5 Then $on = 0 EndIf WEnd MouseUp("left") MsgBox(0, "It's Colored", "We colored it.") EndFunc i think this code is good too. Link to comment Share on other sites More sharing options...
kaotkbliss Posted June 7, 2013 Share Posted June 7, 2013 Â $Area = +200 should be $Area += 200 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now