Esempio n. 1
0
    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"
Esempio n. 2
0
    def get_breakdowns(self):
        """Go to stat breakdowns and fetch the necessary stats."""
        Navigation.stat_breakdown()
        Inputs.click(*coords.BREAKDOWN_E)
        time.sleep(userset.MEDIUM_SLEEP)
        print("OCR is scanning a large area, this might take a few seconds")
        e_list = self.fix_text(Inputs.ocr(*coords.OCR_BREAKDOWN))
        Inputs.click(*coords.BREAKDOWN_M)
        time.sleep(userset.MEDIUM_SLEEP)
        m_list = self.fix_text(Inputs.ocr(*coords.OCR_BREAKDOWN))
        Inputs.click(*coords.BREAKDOWN_R)
        time.sleep(userset.MEDIUM_SLEEP)
        r_list = self.fix_text(Inputs.ocr(*coords.OCR_BREAKDOWN))
        Inputs.click(*coords.BREAKDOWN_MISC)
        time.sleep(userset.MEDIUM_SLEEP)
        Inputs.click_drag(*coords.BREAKDOWN_MISC_SCROLL_DRAG_START,
                          *coords.BREAKDOWN_MISC_SCROLL_DRAG_END)
        misc_list = self.fix_text(Inputs.ocr(*coords.OCR_BREAKDOWN))

        fields = [
            "total energy power:", "total magic power:", "total r power:",
            "total wish speed:"
        ]

        try:
            for e in e_list:
                if e[0].lower() in fields:
                    self.epow = float(e[1])
        except ValueError:
            print("couldn't fetch energy power")
            self.epow = 1
        try:
            for e in m_list:
                if e[0].lower() in fields:
                    self.mpow = float(e[1])
        except ValueError:
            print("couldn't fetch magic power")
            self.mpow = 1

        try:
            for e in r_list:
                if e[0].lower() in fields:
                    self.rpow = float(e[1])
        except ValueError:
            print("couldn't fetch R3 power")
            self.rpow = 1
        try:
            for e in misc_list:
                if e[0].lower() in fields:
                    self.wish_speed = int(e[1]) / 100

        except ValueError:
            print("Couldn't fetch wish speed, defaulting to 100%")
            self.wish_speed = 1

        if not self.wish_speed:
            print("Couldn't get wish speed")
            self.wish_speed = 1
        if not self.epow:
            print("Couldn't get epow")
            self.epow = 1
        if not self.mpow:
            print("Couldn't get mpow")
            self.mpow = 1
        if not self.rpow:
            print("Couldn't get rpow")
            self.rpow = 1

        self.get_caps()
Esempio n. 3
0
    def start_challenge(challenge: int) -> None:
        """Start the selected challenge.
        
        Keyword arguments
        challenge -- The index of the challenge, starting at 1 for Basic challenge,
                     ending at 11 for No TM challenge
        """

        BloodMagic.toggle_auto_spells(drop=False)
        Navigation.rebirth()
        Inputs.click(*coords.CHALLENGE_BUTTON)

        chall = Rebirth.check_challenge(getNum=True)
        if chall:
            text = Inputs.ocr(*coords.OCR_CHALLENGE_NAME)
            print("A challenge is already active: " + text)
            if "basic" in text.lower():
                print("Starting basic challenge script")
                Basic.start()

            elif "24 hour" in text.lower():
                print("Starting 24 hour challenge script")
                try:
                    x = coords.CHALLENGE.x
                    y = coords.CHALLENGE.y + challenge * coords.CHALLENGEOFFSET
                    Inputs.click(x, y, button="right")
                    time.sleep(userset.LONG_SLEEP)
                    target = Inputs.ocr(*coords.OCR_CHALLENGE_24HC_TARGET)
                    target = int(Inputs.remove_letters(target))
                    print(f"Found target boss: {target}")
                    Basic.start()
                except ValueError:
                    print("Couldn't detect the target level of 24HC")
                    Discord.send_message(
                        "Couldn't detect the" + " target level of 24HC",
                        Discord.ERROR)

            elif "100 level" in text.lower():
                print("Starting 100 level challenge script")
                print("IMPORTANT")
                print(
                    "Set target level for energy buster to 67 and charge shot to 33."
                )
                print("Disable 'Advance Energy' in Augmentation")
                print("Disable beards if you cap ultra fast.")
                Level.start()

            elif "blind" in text.lower():
                print("Starting blind challenge script")
                Blind.start()

            elif "laser" in text.lower():
                print("Starting laser sword challenge script")
                Laser.start()

            elif "rebirth" in text.lower():
                print("Starting no rebirth challenge script")
                RebirthCh.rebirth_challenge()
            elif "augs" in text.lower():
                print("Starting no augs challenge script")
                Augment.start()
            elif "equipment" in text.lower():
                print("Starting no equipment challenge script")
                Equipment.start()
            elif "time machine" in text.lower():
                print("Starting no time machine challenge script")
                Timemachine.start()
            elif "ngu" in text.lower():
                print("Starting no NGU challenge script")
                NGU.start()
            else:
                print("Couldn't determine which script to start from the OCR",
                      "input")

        else:
            x = coords.CHALLENGE.x
            y = coords.CHALLENGE.y + challenge * coords.CHALLENGEOFFSET

            if challenge == 1:
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                Basic.start()

            elif challenge == 2:
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                Augment.start()

            elif challenge == 3:
                try:
                    Inputs.click(x, y, button="right")
                    time.sleep(userset.LONG_SLEEP)
                    target = Inputs.ocr(*coords.OCR_CHALLENGE_24HC_TARGET)
                    target = int(Inputs.remove_letters(target))
                    print(f"Found target boss: {target}")
                    Inputs.click(x, y)
                    time.sleep(userset.LONG_SLEEP)
                    Navigation.confirm()
                    time.sleep(userset.LONG_SLEEP)
                    Basic.start()
                except ValueError:
                    print("couldn't detect the target level of 24HC")
                    Discord.send_message(
                        "Couldn't detect the" + "target level of 24HC",
                        Discord.ERROR)

            elif challenge == 4:
                print("IMPORTANT")
                print(
                    "Set target Level for energy buster to 67 and charge shot to 33."
                )
                print("Disable 'Advance Energy' in Augmentation")
                print("Disable beards if you cap ultra fast.")
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                Level.start()

            elif challenge == 5:
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                Equipment.start()

            elif challenge == 6:
                print("Nah fam. Do it yourself")
                while True:
                    Window.shake()

            elif challenge == 7:
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                RebirthCh.rebirth_challenge()

            elif challenge == 8:
                print(
                    "LSC doesn't reset your number, make sure your number is high enough to make laser swords."
                )
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                Laser.start()

            elif challenge == 9:
                print("Starting blind challenge")
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                Blind.start()

            elif challenge == 10:
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                NGU.start()

            elif challenge == 11:
                Inputs.click(x, y)
                time.sleep(userset.LONG_SLEEP)
                Navigation.confirm()
                Timemachine.start()

            else:
                print(f"invalid challenge: {challenge}")