I wanted to know how to move onto the next line of code after X time since this code is within a function. Currently if the code can't find the round number it continuously presses f resulting in the script getting stuck.
if self.round in ("2-5"):
"""Levels to 5 at 2-5"""
while arena_functions.get_level() < 5:
self.arena.buy_xp_round() #presses f key
print(f"\n[LEVEL UP] Lvl. {arena_functions.get_level()}")
self.arena.fix_bench_state() #next line of code
I've tried many things but it usually results in the f key being pressed once then moving on to the next line. I want the script to keep pressings F in round 2-5 until the condition is met. If it can't meet the condition within the time limit then move onto the next line of code