Beispiel #1
0
def purpleQuest():
    playActions("questWindow.json")
    clickCenter('purpleQuest', 0.9)
    clickCenter('acceptQuest', 0.9)
    time.sleep(3)
    clickCenter('complete', 0.9)
    pressButton("space")
Beispiel #2
0
def bot(box):
    while pyautogui.locateOnScreen(
            'images/stop.png', confidence=0.99, region=box) is None:
        emptyHpBar = pyautogui.locateOnScreen('images/enemyHp.png',
                                              confidence=0.9,
                                              region=box)
        if emptyHpBar:
            pressButton("0")
            for x in range(5):
                pressButton("X")
            time.sleep(1)
            pressButton("F10")
        else:
            pressButton('SPACE')
            playActions("basicAttack.json")
Beispiel #3
0
def tourney(characters):
    box = gameWindow()
    try:
        for x in range(characters):

            runs = getMaterials(box)
            playActions("leaveSeria.json")
            playActions("toSiran.json")
            time.sleep(1)
            #purpleQuest()
            playActions("siranToJun.json")
            #glowQuest()
            buyTourney(runs)
            playActions("junToTourney.json")

            bot(box)
            exitTourney()
            changeCharacter()
    except KeyboardInterrupt:
        sys.exit()
def docking_with_station():

    #Check if the player is at the station every 60 seconds
    #If the player is in space, dock with the nearest station
    #If it is not possible to determine the position of the player three times, the program ends
    repeat_number = 1
    while True:
        spaceship_position = get_spaceship_position()
        if spaceship_position[0]:
            print("Player is on station.")
            repeat_number = 1
            sleep(60)
        elif spaceship_position[1]:
            print("Player is in space. Docking with the nearest station.")
            if spaceship_position[1][1] == 257:
                playActions('select_station_from_list_1.json')
            elif spaceship_position[1][1] == 276:
                playActions('select_station_from_list_2.json')
            elif spaceship_position[1][1] == 295:
                playActions('select_station_from_list_3.json')
            else:
                print("Unable to select station.")
            sleep(3)
            playActions('docking_with_station.json')
            repeat_number = 1
            sleep(60)
        else:
            if repeat_number < 4:
                print("Unable to determine the position of the player.")
                print(
                    "Re-determining the position of player number {}.".format(
                        repeat_number))
                repeat_number += 1
                sleep(20)
            else:
                print("Failed to determine the position of the player.")
                break
Beispiel #5
0
def glowQuest():
    playActions("questWindow.json")
    clickCenter('glowQuest', 0.9)
    playActions("questChat.json")
    playActions("finishQuest.json")
def main():

    initializePyAutoGUI()
    countdownTimer()

    # This trade loop begins by docking at Loki Station
    LOOP_REPITITIONS = 3
    for i in range(0, LOOP_REPITITIONS):

        if i > 0:
            # Wait for station to load
            sleep(10.00)

        # Start docked at Loki Station, get to our universal starting position
        # get_starting_pos() should return an integer that corresponds with which
        # recorded action script should be played
        starting_pos = get_starting_pos("loki")
        try:
            action_filename = "lokistation_start_{}.json".format(starting_pos)
            playActions(action_filename)
        except FileNotFoundError as e:
            if not starting_pos:
                print("Starting position not recognized in Loki")
            else:
                print(
                    "No recorded actions for position {}".format(starting_pos))
            exit(0)
        else:
            print("Played starting actions {}".format(action_filename))
        sleep(2.00)

        # Confirm we're at the correct starting position
        confirmPosition("lokistation_starting_pos")

        # Playback those four steps to go to the trader, do the buying/selling,
        # go back to the ship, fly to Earth Station
        playActions("lokistation_goto_trader.json")
        sleep(2.00)
        playActions("lokistation_do_trading.json")
        sleep(2.00)
        confirmPosition("lokistation_done_trading")
        playActions("lokistation_goto_ship.json")
        sleep(10.00)  # allow time for loading screen when exiting station
        playActions("lokistation_goto_earthstation.json")

        # Wait for station to load
        sleep(10.00)

        # Now docked at Earth Station, get to that starting position
        # get_starting_pos() should return an integer that corresponds with which
        # recorded action script should be played
        starting_pos = get_starting_pos("earth")
        try:
            action_filename = "earthstation_start_{}.json".format(starting_pos)
            playActions(action_filename)
        except FileNotFoundError as e:
            if not starting_pos:
                print("Starting position not recognized in Earth")
            else:
                print(
                    "No recorded actions for position {}".format(starting_pos))
            exit(0)
        else:
            print("Played starting actions {}".format(action_filename))
        sleep(2.00)

        # Playback four steps to go to the trader, do the buying/selling,
        # go back to the ship, fly to Loki Station
        playActions("earthstation_goto_trader.json")
        sleep(2.00)
        playActions("earthstation_do_trading.json")
        sleep(2.00)
        playActions("earthstation_goto_ship.json")
        sleep(10.00)  # allow time for loading screen when exiting station
        playActions("earthstation_goto_lokistation.json")

        # Completed loop
        print("Completed loop")

    print("Done")