toothyXdip Posted February 24, 2007 Share Posted February 24, 2007 im trying to make it where you press f10 it will get the mouse pos and if that spot or pos changes colors it will send a key (a, b, c, d) all i know how to do is make it where you press f10 it gets teh pos of the mouse any ideas? THanks!, toothy my script: #include <GuiConstants.au3> HotKeySet("{F10}", "getpos") GuiCreate("MyGUI", 374, 168,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GUISetBkColor(0x000000) $lable = GUICtrlCreateLabel("press F10 and it will get pos", 125, 30) GUICtrlSetBkColor($lable, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor($lable, 0xffffff) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit Func getpos() $pos = MouseGetPos() MsgBox(0, "Mouse x,y:", $pos[0] & "," & $pos[1]) EndFunc ---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝'''║'''╝╝║'''║......║'''║'''║'''║'''''''''║'''''''''║'''║---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''╝''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝ Link to comment Share on other sites More sharing options...
toothyXdip Posted February 24, 2007 Author Share Posted February 24, 2007 know1 knows ---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝'''║'''╝╝║'''║......║'''║'''║'''║'''''''''║'''''''''║'''║---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''╝''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝ Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted February 24, 2007 Share Posted February 24, 2007 quick simple example #include <GuiConstants.au3> HotKeySet("{F10}", "getpos") GuiCreate("MyGUI", 374, 168,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) GUISetBkColor(0x000000) $lable = GUICtrlCreateLabel("press F10 and it will get pos", 125, 30) GUICtrlSetBkColor($lable, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor($lable, 0xffffff) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit Func getpos() $pos = MouseGetPos() $color = PixelGetColor($pos[0],$pos[1]) While PixelGetColor($pos[0],$pos[1]) = $color Sleep(100) WEnd Send("abcd") 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