Sign in to follow this  
Followers 0
toothyXdip

?¿{{}} setting mouse pos {{}}?¿

3 posts in this topic

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

---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites



know1 knows :whistle:


---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝

Share this post


Link to post
Share on other sites

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

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