From ec3c6a373b273e547e5080ff381b0786262a1845 Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Thu, 30 Jan 2025 14:36:35 -0600 Subject: [PATCH] Add dry-run argument --- autopon.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autopon.py b/autopon.py index 7856bf5..e7cd7b9 100755 --- a/autopon.py +++ b/autopon.py @@ -59,6 +59,7 @@ def main(): ) parser.add_argument('song',default="R-R-L-R-",nargs="+",choices=songs,help="The song to play. Defaults to Aria of Attack. When expressing a song, use eighth notes, dashes, and cardinal directions to designate the drums. For example, party would be \"L-R-D-U-\", and djinn would be \"D-DD-DD-\"") parser.add_argument('--bpm',type=float,default=1,help="Multiplier for the BPM. Change if you're running the game at a higher speed") + parser.add_argument('--dry-run',action='store_true',help="Don't call out to ydotool, just pretend to") parser.add_argument('--iterations',type=int,default=10000,help="Number of iterations of the sequence to run. Defaults to 10,000") parser.add_argument('--key-delay',type=int,default=60,help="Number of milliseconds to hold each key down for. Defaults to 100. Tune if you're getting dropped inputs or if the program can't keep up") parser.add_argument('--startup-delay',type=int,default=0,help="Number of milliseconds by which we should \"start early\". Adjust this value if, despite syncing on-beat, the program is late. The program will never be early -- if it feels like it is, it's just WAY late") @@ -100,7 +101,8 @@ def main(): lastbeat += beat_interval button = keymapping.get(key, '-') if button != '-': - ydotool(key=button, delay=args.key_delay, multiplier=args.bpm) + if not args.dry_run: + ydotool(key=button, delay=args.key_delay, multiplier=args.bpm) print(drummapping.get(key, '-'), end="", flush=True) else: print(" ", end="", flush=True)