Danjen Posted September 21, 2007 Share Posted September 21, 2007 Basically what I want this to do is start a loop, and pause until the user clicks a mouse button. When that happens, the script will see where the mouse is, what button was pressed, and how long between the last click it was. Essentially, this is so that a user can record a macro, but it's not quite working correctly. Local $MousePos[10][4] Local $TimeSinceLast Func GetTime() $TimeSinceLast = TimerInit() EndFunc Func GetMouse($num) $MousePos[$num][0] = MouseGetPos(0) $MousePos[$num][1] = MouseGetPos(1) If MouseUp("left") then $MousePos[$num][2] = "left" If MouseUp("right") then $MousePos[$num][2] = "right" $MousePos[$num][3] = TimerDiff() GetTime() EndFunc For $rep = 0 to 9 While MouseDown("") Sleep(100) WEnd GetMouse($num) Next Link to comment Share on other sites More sharing options...
Bert Posted September 21, 2007 Share Posted September 21, 2007 Umm, there is a macro recorder in the SciTe suite. That does what you need. Otherwise, this looks like a keylogger, which is a nono in our book. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Nahuel Posted September 21, 2007 Share Posted September 21, 2007 Something like this? expandcollapse popup#include <Misc.au3> Local $TimeSinceLast=0 Local $PressedButton Local $MousePos Func GetTime() $TimeSinceLast = TimerInit() EndFunc Func ShowInfo() If $TimeSinceLast=0 Then $TimeSinceLastPressed=0 Else $TimeSinceLastPressed=TimerDiff($TimeSinceLast)/1000; just use $TimeSinceLast if you want it in milliseconds EndIf MsgBox(64,"","Button Pressed: " &$PressedButton& @CRLF & "Time Since Last Button Pressed: " &$TimeSinceLastPressed& " seconds"&@CRLF&"Mouse Position: ("&$MousePos[0]&","&$MousePos[1]&")") GetTime() EndFunc While 1 Sleep(15) If _IsPressed(01) Then $PressedButton="Left" $MousePos=MouseGetPos() ShowInfo() EndIf If _IsPressed(02) Then $PressedButton="Right" $MousePos=MouseGetPos() ShowInfo() EndIf If _IsPressed(04) Then $PressedButton="Middle" $MousePos=MouseGetPos() ShowInfo() EndIf WEnd Link to comment Share on other sites More sharing options...
Danjen Posted September 21, 2007 Author Share Posted September 21, 2007 @Volly: Nope wasn't aware SciTe had a macro recorder ... is it an .exe or is it through the script? And no, it's not a keylogger, it's to be a programmable macro for RuneScape. @Nahuel: Yes, that is exactly what I needed. Link to comment Share on other sites More sharing options...
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