Advertisement
EzFlow997

on/off loop example

Mar 2nd, 2024 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. Persistent
  2. SendMode Input
  3.  
  4. Start: // this line is never being used
  5.  
  6. p::
  7. Toggle := !Toggle
  8. if Toggle {
  9. SetTimer, CheckCondition, 100
  10. }
  11.  
  12. else{
  13. SetTimer, CheckCondition, Off
  14. }
  15. return
  16.  
  17. CheckCondition:
  18. FileReadLine, FileContent, rotation.txt, 1
  19. if (Toggle){
  20. Loop, Parse, FileContent, %A_SPACE%{
  21. if (!Toggle){
  22. Break
  23. Goto, Start // this will never execute because you are breaking out of the loop before this step
  24. }
  25. else (A_LoopField = "{Tab}"){
  26. Send %A_LoopField%
  27. Sleep 500
  28. }
  29. }
  30. }
  31. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement