Jump to content

Recommended Posts

Posted

I want to set up a part of a script to run after I click my mouse down. And then stop when I release. Any ideas?

Posted (edited)

Pffft, who needs scripts that actually work? Not me, I'll tell you.

lol, dont worry, neither of em work. Might be somethin Im doin wrong lol

#include <Misc.au3>
HotKeySet("{esc}", "Quit")
$IniFile = @ScriptDir & "\Test.ini"
$mouse = MouseGetPos()
$x = 1
$y = 1
While 1
    If _IsPressed(01) Then
        While _IsPressed(01)
            Do
                IniWrite (@ScriptDir & "\MousePos.ini","Coords","x" & $x,$mouse[0])
                IniWrite (@ScriptDir & "\MousePos.ini","Coords","y" & $y,$mouse[1])
                $x = $x + 1
                $y = $y + 1
            Until  _IsPressed(01) = 0
        Wend
    EndIf
WEnd
Func Quit()
    Exit
EndFunc
Edited by verto
Posted

#include <Misc.au3>
HotKeySet("{esc}", "Quit")
$IniFile = @ScriptDir & "\Test.ini"
$mouse = MouseGetPos()
$x = 1
$y = 1
While 1
    If _IsPressed(01) Then
        While _IsPressed(01)
                IniWrite (@ScriptDir & "\MousePos.ini","Coords","x" & $x,$mouse[0])
                IniWrite (@ScriptDir & "\MousePos.ini","Coords","y" & $y,$mouse[1])
                $x = $x + 1
                $y = $y + 1
        Wend
    EndIf
WEnd
Func Quit()
    Exit
EndFunc

Posted

#include <Misc.au3>
HotKeySet("{esc}", "Quit")
$IniFile = @ScriptDir & "\Test.ini"
$mouse = MouseGetPos()
$x = 1
$y = 1
While 1
    If _IsPressed(01) Then
        While _IsPressed(01)
                IniWrite (@ScriptDir & "\MousePos.ini","Coords","x" & $x,$mouse[0])
                IniWrite (@ScriptDir & "\MousePos.ini","Coords","y" & $y,$mouse[1])
                $x = $x + 1
                $y = $y + 1
        Wend
    EndIf
WEnd
Func Quit()
    Exit
EndFunc
That still doesnt work the way I Need it to, I need it so that when I release the left click, then it will end that. Its part of a much bigger script and having esc. bound like that wont work for me, thats just there cause it was freakin out earlier and I needed a way out of it.
Posted

That still doesnt work the way I Need it to, I need it so that when I release the left click, then it will end that. Its part of a much bigger script and having esc. bound like that wont work for me, thats just there cause it was freakin out earlier and I needed a way out of it.

Like this?

#include <Misc.au3>
HotKeySet("{esc}", "Quit")
$IniFile = @ScriptDir & "\Test.ini"
$mouse = MouseGetPos()
$x = 1
$y = 1
While 1
    If _IsPressed(01) Then
                IniWrite (@ScriptDir & "\MousePos.ini","Coords","x" & $x,$mouse[0])
                IniWrite (@ScriptDir & "\MousePos.ini","Coords","y" & $y,$mouse[1])
                $x = $x + 1
                $y = $y + 1
    EndIf
WEnd
Func Quit()
    Exit
EndFunc
Posted

What exactly do you need this for? You know, instead of making people guess? Could you describe the "much bigger script"?

That will record the path of the mouse, as in the entire path, not just start/end point. And it will send it to a .ini to be read later. That is the purpose of it. And from there all kinds of junk will be done with the coordinates given to me by this bit.

The

$y = $y+1

$x = $x=1

part makes it so that the resulting file will have something along the lines of

mousex1 = coord

mousey1 = coord

mousex2 = coord

mousey2 = coord

mousex3 = coord

mousey3 = coord

and so on, for the entire length of the script.

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
×
×
  • Create New...