jaberwacky Posted December 15, 2008 Posted December 15, 2008 This seems to work just fine for me... While $x=true Do If _IsPressed("01") Then $timer=TimerInit() $pos=MouseGetPos() tooltip( $timer & " " & $pos[ 0 ] & " " & $pos[ 1 ] ) $tick += 1 IniWrite( "Coords.ini" , "Coords" , "x: " & $tick , $pos[ 0 ] ) IniWrite( "Coords.ini" , "Coords" , "y: " & $tick , $pos[ 1 ] ) $kill=TimerDiff($timer) IniWrite( "Coords.ini" , "Coords" , "time: " & $tick , $kill ) EndIf Do ;nothing Until NOT _isPressed("01") Until _IsPressed("53") Wend Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
UnknownWarrior Posted December 16, 2008 Author Posted December 16, 2008 This seems to work just fine for me... While $x=true Do If _IsPressed("01") Then $timer=TimerInit() $pos=MouseGetPos() tooltip( $timer & " " & $pos[ 0 ] & " " & $pos[ 1 ] ) $tick += 1 IniWrite( "Coords.ini" , "Coords" , "x: " & $tick , $pos[ 0 ] ) IniWrite( "Coords.ini" , "Coords" , "y: " & $tick , $pos[ 1 ] ) $kill=TimerDiff($timer) IniWrite( "Coords.ini" , "Coords" , "time: " & $tick , $kill ) EndIf Do ;nothing Until NOT _isPressed("01") Until _IsPressed("53") Wend What that will do is when Left click is pressed it will get the coords and write them down... And right after that (a few milliseconds) it stops the timer and writes down the time... there is no room in there for the timer to actually let the user to record there time, its just plain stopping it... Anyone else?
UnknownWarrior Posted December 16, 2008 Author Posted December 16, 2008 Come on, why is everyone ignoring me... What did I ever do to deserve this? -.-
sandin Posted December 17, 2008 Posted December 17, 2008 is this what u want? expandcollapse popup#include <misc.au3> HotKeySet("{F11}", "start_recording") HotKeySet("{F10}", "stop_recording") HotKeySet("{F9}", "display_recorded") HotKeySet("{ESC}", "_quit") Global $recording = 0, $tick = 0, $time, $timer, $text = "", $temp_text = "", $Display_time TrayTip("", "Press F11 for start recording," & @CRLF & "then Mouse Left click to detect" & @CRLF _ & "Press F10 to stop recording" & @CRLF & "Press F9 to see recorded" & @CRLF & "press ESC to quit", 30) While 1 if $recording Then if _IsPressed("01") then $time = TimerDiff($timer) $pos=MouseGetPos() $tick += 1 $Display_time = Round(TimerDiff($timer), 2) $temp_text = ">==========" & @CRLF & "Section: Coords" & @CRLF & "key: x" & $tick & " = " & $pos[0] _ & @CRLF & "key: y" & $tick & " = " & $pos[1] _ & @CRLF & "key: time" & $tick & " = " & $Display_time & @CRLF & ">==========" & @CRLF $text &= ">==========" & @CRLF & "Section: Coords" & @CRLF & "key: x" & $tick & " = " & $pos[0] _ & @CRLF & "key: y" & $tick & " = " & $pos[1] _ & @CRLF & "key: time" & $tick & " = " & $Display_time & @CRLF & ">==========" & @CRLF ConsoleWrite($temp_text) Do ;put this Do Until bellow _IsPressed (line 11) if you wanna detect when user release the Until NOT _IsPressed("01") ;left click, or let it stay here if you wanna detect the moment user hit the left click EndIf EndIf WEnd func display_recorded() MsgBox(0, "recorded text:", $text) EndFunc func start_recording() if NOT $recording Then $timer=TimerInit() $recording = 1 ConsoleWrite(">=====" & @CRLF & "Recording Started" & @CRLF & ">=====" & @CRLF) EndIf EndFunc func stop_recording() if $recording Then $recording = 0 ConsoleWrite(">=====" & @CRLF & "Recording Stopped" & @CRLF & ">=====" & @CRLF) EndIf EndFunc func _quit() Exit EndFunc Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll
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