Joseph Posted October 11, 2008 Share Posted October 11, 2008 here is something i made that if the pixel is there then it shows a message box saying that the pixel is found and then moves the mouse there, and if the pixel is not there it says nope.. but that only works one time and if u click the button again it does nothing, is that because of the while 1 i'm using or what? heres what the script is #include <guiconstants.au3> $GUI = GUICreate("If Pixel Clicker", 200,20,-1,-1,-1) $Exit = GUICtrlCreateButton("Exit",0,0,20,20) $Search = GUICtrlCreateButton("Pixel Search",20,0,180,20) GUISetState(@SW_SHOW) WinSetOnTop($GUI, "", 1) While 1 $msg = GUIGetMsg() Select Case $msg= $Exit GUIDelete() Exit Case $msg= $search searcher() EndSelect WEnd Func searcher() $search=PixelSearch(50,50,200,200,0x63CEFF,50) if IsArray($search) then MsgBox(0,"","found that colour at X" &$search[0]&" Y"&$search[1],0) MouseMove($search[0],$search[1]) Else MsgBox(0,"Pixel Not There","nope",0) EndIf EndFunc http://runecrue.awardspace.comhttp://demopros.awardspace.com Link to comment Share on other sites More sharing options...
martin Posted October 11, 2008 Share Posted October 11, 2008 here is something i made that if the pixel is there then it shows a message box saying that the pixel is found and then moves the mouse there, and if the pixel is not there it says nope.. but that only works one time and if u click the button again it does nothing, is that because of the while 1 i'm using or what? heres what the script is #include <guiconstants.au3> $GUI = GUICreate("If Pixel Clicker", 200,20,-1,-1,-1) $Exit = GUICtrlCreateButton("Exit",0,0,20,20) $Search = GUICtrlCreateButton("Pixel Search",20,0,180,20) GUISetState(@SW_SHOW) WinSetOnTop($GUI, "", 1) While 1 $msg = GUIGetMsg() Select Case $msg= $Exit GUIDelete() Exit Case $msg= $search searcher() EndSelect WEnd Func searcher() $search=PixelSearch(50,50,200,200,0x63CEFF,50) if IsArray($search) then MsgBox(0,"","found that colour at X" &$search[0]&" Y"&$search[1],0) MouseMove($search[0],$search[1]) Else MsgBox(0,"Pixel Not There","nope",0) EndIf EndFuncIn your function searcher you have a variable $search used for the return from PixelSearch. But that name was previously used for the button! Use a different name for the PixelSearch result otherwise you destroy the reference to the button. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
FaT3oYCG Posted October 11, 2008 Share Posted October 11, 2008 (edited) #include <guiconstants.au3> $GUI = GUICreate("If Pixel Clicker", 220, 20, -1, -1, -1) $Exit = GUICtrlCreateButton("Exit", 0, 0, 40, 20) $Search = GUICtrlCreateButton("Pixel Search", 40, 0, 180, 20) GUISetState(@SW_SHOW) WinSetOnTop($GUI, "", 1) Func searcher() $pixel_search = PixelSearch(50, 50, 200, 200, 0x63CEFF, 50) if IsArray($pixel_search) then MsgBox(0, "", "found that colour at X" & $pixel_search[0] & " Y" & $pixel_search[1], 0) MouseMove($pixel_search[0], $pixel_search[1]) Else MsgBox(0, "Pixel Not There", "nope", 0) EndIf EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $Exit GUIDelete() Exit Case $msg = $search searcher() EndSelect WEnd EDIT 1: didnt see the above reply this works fully and is more readable EDIT 2: the searcher always finds that colour as it is in the containing box around the pixel searcher form. Edited October 11, 2008 by FaT3oYCG Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right. Link to comment Share on other sites More sharing options...
Joseph Posted October 11, 2008 Author Share Posted October 11, 2008 #include <guiconstants.au3> $GUI = GUICreate("If Pixel Clicker", 220, 20, -1, -1, -1) $Exit = GUICtrlCreateButton("Exit", 0, 0, 40, 20) $Search = GUICtrlCreateButton("Pixel Search", 40, 0, 180, 20) GUISetState(@SW_SHOW) WinSetOnTop($GUI, "", 1) Func searcher() $pixel_search = PixelSearch(50, 50, 200, 200, 0x63CEFF, 50) if IsArray($pixel_search) then MsgBox(0, "", "found that colour at X" & $pixel_search[0] & " Y" & $pixel_search[1], 0) MouseMove($pixel_search[0], $pixel_search[1]) Else MsgBox(0, "Pixel Not There", "nope", 0) EndIf EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $Exit GUIDelete() Exit Case $msg = $search searcher() EndSelect WEnd EDIT 1: didnt see the above reply this works fully and is more readable EDIT 2: the searcher always finds that colour as it is in the containing box around the pixel searcher form. ok i see that now thanks for the help http://runecrue.awardspace.comhttp://demopros.awardspace.com 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