Jump to content

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


Recommended Posts

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

know1 knows :whistle:

---╔╦═╗╔╗'''╔╗╔═╦═╗╔╦═╗---╝╠═╣╝║'''║╝╝''''''╝╝║'''......''''''''''''''''''''''''''''''---╔╩═╩═╩═╩═══╩═╦═╩═╩══╦══════╗''''╔╩════════════╩══╗╔══╩══╗╔══╝ ''''''''''''''''''''''''''''''''''''''''''''''''''''║║'''''''''''''''║║ ''''''''''''''''''''''''''''''''''''''''''''''╔══╝╚══╗''''''║║''''''''''''''''''''''''''''''''''''''''''''''╚══════╝''''''╚╝
Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...