verto Posted March 1, 2007 Posted March 1, 2007 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?
lod3n Posted March 2, 2007 Posted March 2, 2007 while _IsPressed("01") ;do stuff wend [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
Paulie Posted March 2, 2007 Posted March 2, 2007 (edited) while _IsPressed("01") ;do stuff wendOr, to make it work. #Include <Misc.au3> While 1 Tooltip("") If _IsPressed(01) Then While _IsPressed(01) Tooltip("You're Holding the Mouse!") ;Do whatever Wend EndIf WEnd Edited March 2, 2007 by Paulie
lod3n Posted March 2, 2007 Posted March 2, 2007 Pffft, who needs scripts that actually work? Not me, I'll tell you. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
verto Posted March 2, 2007 Author Posted March 2, 2007 (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 March 2, 2007 by verto
NELyon Posted March 2, 2007 Posted March 2, 2007 #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
verto Posted March 2, 2007 Author Posted March 2, 2007 #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 EndFuncThat 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.
NELyon Posted March 2, 2007 Posted March 2, 2007 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
lod3n Posted March 2, 2007 Posted March 2, 2007 What exactly do you need this for? You know, instead of making people guess? Could you describe the "much bigger script"? [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
verto Posted March 3, 2007 Author Posted March 3, 2007 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=1part makes it so that the resulting file will have something along the lines ofmousex1 = coordmousey1 = coordmousex2 = coordmousey2 = coordmousex3 = coordmousey3 = coordand so on, for the entire length of the script.
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