def run_challenge(challenge: int, cont: bool = False) -> None: """Run the selected challenge. Keyword arguments challenge -- The index of the challenge, starting at 1 for Basic challenge, ending at 11 for No TM challenge cont -- Whether the challenge is already running. """ global ChList Navigation.challenges() if cont: pass else: x = coords.CHALLENGE.x y = coords.CHALLENGE.y + challenge * coords.CHALLENGEOFFSET Inputs.click(x, y) time.sleep(userset.LONG_SLEEP) Navigation.confirm() chall = ChList[challenge - 1] print(f"Starting {chall.name} Challenge script.") for x in chall.extra: if callable(x): print(x()) else: print(x) chall.script()
def get24boss(): try: x = coords.CHALLENGE.x y = coords.CHALLENGE.y + 3 * coords.CHALLENGEOFFSET Navigation.challenges() Inputs.click(x, y, button="right") time.sleep(userset.LONG_SLEEP) target = Inputs.ocr(*coords.OCR_CHALLENGE_24HC_TARGET) target = Inputs.get_numbers(target)[0] return f"Target boss: {target}" except ValueError: Discord.send_message("Couldn't detect the target level of 24HC", Discord.ERROR) return "Couldn't detect the target level of 24HC"