Add dry-run argument

This commit is contained in:
2025-01-30 14:36:35 -06:00
parent 82b4c101c1
commit ec3c6a373b

View File

@@ -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)