Jump to content
Sign in to follow this  
tp9191

Console Write and _IsPressed help

Recommended Posts

tp9191

Basically I'm just trying to get coordinates, and when I find the coord I need, I want to click (or press some other key) and have it append it to the console. I would append to a file, but that requires even more time for me to learn it.

Thanks!

I'm pretty stupid with this stuff, so please bear with it.

HotKeySet("{F1}", "f1")
HotKeySet("{F11}", "Terminate")

#include <Misc.au3>

While 1
   Sleep (50)
WEnd

Func Terminate()
    Exit 0
 EndFunc


Func f1()
Opt("MouseCoordMode", 1) ;1=ab,0=re,2=cl


While 1

$pos = mousegetpos()

Traytip("Mouse Pos","X:"&$pos[0]&" Y:"&$pos[1],"")

Wend

If _IsPressed (01) Then
    ConsoleWrite ($pos [0] & $pos [1] & @CRLF)
EndIf

EndFunc

Share this post


Link to post
Share on other sites
Damein

So the main problem with your script is that your Tooltip is overriding any ability to move onto a new function or action.

IE: Even when you press something, your While function updating your Tooltip isn't passing it through.

Why not just do it like this?

Func f1()
    Opt("MouseCoordMode", 1) ;1=ab,0=re,2=cl
    $pos = MouseGetPos()
    TrayTip("Mouse Pos", "X:" & $pos[0] & " Y:" & $pos[1], "")
EndFunc   ;==>f1

You don't get a 24/7 update, but each time you press F1 you see the coordinates. 


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites
reb

Your Modified code

HotKeySet("{F1}", "f1")
HotKeySet("{F11}", "Terminate")

#include <Misc.au3>
Local $hDLL = DllOpen("user32.dll")
While 1

   Sleep (200)
WEnd

Func Terminate()
    DllClose($hDLL)
    Exit 0
 EndFunc


Func f1()
Opt("MouseCoordMode", 1) ;1=ab,0=re,2=cl


While 1

$pos = mousegetpos()
If _IsPressed (01) Then
     While _IsPressed("01", $hDLL)
            Sleep(250)
        WEnd
     Traytip("Mouse Pos","X:"&$pos[0]&" Y:"&$pos[1],"")

    ConsoleWrite ($pos [0] & "    " & $pos [1] & @CRLF)
EndIf

;~ Traytip("Mouse Pos","X:"&$pos[0]&" Y:"&$pos[1],"")
Sleep(200)
Wend


EndFunc

REB

Edited by reb

MEASURE TWICE - CUT ONCE

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  

×