You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
713 B

7 years ago
7 years ago
  1. SetBatchLines -1 ; Ensures maximum effectiveness of this method.
  2. CoordMode, Mouse, Screen
  3. fname := A_ScriptDir . "\on"
  4. SendMode Input
  5. cont := true
  6. val = %1%
  7. d := Round(1000 / val)
  8. If (!FileExist(fname)) {
  9. FileAppend,,%fname%
  10. }
  11. SendEvent {Tab}
  12. TimePeriod = 1
  13. SleepDuration = 1
  14. Sleep 1000
  15. DllCall("Winmm\timeBeginPeriod", UInt, TimePeriod)
  16. while cont
  17. {
  18. GetKeyState, finished,Space,P
  19. if finished = D
  20. {
  21. cont := false
  22. ExitApp 0
  23. }
  24. else
  25. {
  26. DllCall("Sleep", UInt, d)
  27. Click
  28. }
  29. }
  30. DllCall("Winmm\timeEndPeriod", UInt, TimePeriod)
  31. Tab::
  32. If (FileExist(fname)) {
  33. FileDelete,%fname%
  34. }
  35. else {
  36. FileAppend,,%fname%
  37. }
  38. Pause,Toggle,1