dersiniar Posted March 26, 2019 Share Posted March 26, 2019 (edited) Hello, Can any1 help my fix my code. What code have to do is. If i mouseclick some location, it have to save location cordinates and its clolor and use it later on-. It would be better if it is able to find pixel colour cordinates +-10 pixels and +-10 color difference PixelSearch($TestBlock[0], $TestBlock[1], $TestBlock[0] 10, $TestBlock[1] 10, $iColor, 10) If i use code GUICtrlSetData($info, " Color code is " & $iColor & " Cordinates are " & $TestBlock) it does not show any of cordinate or pixel color Func _DC() PixelSearch($TestBlock[0], $TestBlock[1], $TestBlock[0], $TestBlock[1], $iColor) If Not @error Then Sleep(10) Else MsgBox(52, "error", $iColor & "Block not found") EndIf EndFunc Func _TestBlock() GUICtrlSetColor($info, $COLOR_BLUE) If Not _IsPressed("01") Then Sleep(10) GUICtrlSetData($info, "Select Controll Block") GUICtrlSetColor($info, $COLOR_RED) GUICtrlSetFont($info, 18) _TestBlock() Else Sleep(200) $iColor = PixelGetColor $TestBlock = MouseGetPos() Sleep(50) GUICtrlSetData($info, "Block Selected") Sleep(50) EndIf EndFunc Edited March 26, 2019 by dersiniar Link to comment Share on other sites More sharing options...
dersiniar Posted March 26, 2019 Author Share Posted March 26, 2019 1 hour ago, dersiniar said: Hello, Can any1 help my fix my code. What code have to do is. If i mouseclick some location, it have to save location cordinates and its clolor and use it later on-. It would be better if it is able to find pixel colour cordinates +-10 pixels and +-10 color difference PixelSearch($TestBlock[0], $TestBlock[1], $TestBlock[0] 10, $TestBlock[1] 10, $iColor, 10) If i use code GUICtrlSetData($info, " Color code is " & $iColor & " Cordinates are " & $TestBlock) it does not show any of cordinate or pixel color Func _DC() PixelSearch($TestBlock[0], $TestBlock[1], $TestBlock[0], $TestBlock[1], $iColor) If Not @error Then Sleep(10) Else MsgBox(52, "error", $iColor & "Block not found") EndIf EndFunc Func _TestBlock() GUICtrlSetColor($info, $COLOR_BLUE) If Not _IsPressed("01") Then Sleep(10) GUICtrlSetData($info, "Select Controll Block") GUICtrlSetColor($info, $COLOR_RED) GUICtrlSetFont($info, 18) _TestBlock() Else Sleep(200) $iColor = PixelGetColor $TestBlock = MouseGetPos() Sleep(50) GUICtrlSetData($info, "Block Selected") Sleep(50) EndIf EndFunc I figured out with help of google. Ill paste my code that works, maybe it will help someone in future Func _DC() PixelSearch($TestBlock[1], $TestBlock[0], $TestBlock[1]+10, $TestBlock[0]+10, $iColor, 10) If Not @error Then GUICtrlSetData($info, " Color code is " & $iColor & " Cordinates are " & $TestBlock) Sleep(10) Else MsgBox(52, "error", $iColor & "Block not found") EndIf EndFunc Func _TestBlock() GUICtrlSetColor($info, $COLOR_BLUE) If Not _IsPressed("01") Then Sleep(10) GUICtrlSetData($info, "Select Controll Block") GUICtrlSetColor($info, $COLOR_RED) GUICtrlSetFont($info, 18) _TestBlock() Else Sleep(200) $TestBlock = MouseGetPos() $iColor = PixelGetColor($TestBlock[0], $TestBlock[1]) Sleep(50) GUICtrlSetData($info, "Block Selected") Sleep(50) EndIf EndFunc 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