Ejemplo n.º 1
0
def unloadItem(item):
    print '--> unload item ' + item

    x, y = image.findImgR(panel.Inventory, 'img/ship.bmp', 0.2)
    if x > 0:
        mouse.moveTo(x, y)
        mouse.leftClick()
        time.sleep(1.5)

    x = -1
    x, y = image.findImgR(panel.Inventory, item)
    while x < 0:
        mouse.moveToP(panel.middle(panel.Inventory))
        mouse.leftClick()
        mouse.wheel(-12)
        mouse.move(300, 0)
        x, y = image.findImgR(panel.Inventory, item)

    mouse.moveTo(x, y)
    mouse.leftDown()
    x, y = image.findImgR(panel.Inventory, 'img/item_hangar.bmp', 0.2)
    if x < 0:
        mouse.leftUp()
        return False
    mouse.moveTo(x, y)
    mouse.leftUp()
    time.sleep(1)

    print '<-- unload item ' + item + '\n'
    return True
Ejemplo n.º 2
0
def declineMission():
    print '--> decline mission'

    x, y = image.findImgR(panel.MissionRight, 'img/decline.bmp')
    mouse.moveTo(x, y)
    mouse.leftClick()

    time.sleep(5)
    x, y = image.findImgR(panel.Full, 'img/yes.bmp')
    if x > 0:
        mouse.moveTo(x, y)
        mouse.leftClick()

    print 'wait until decline'

    while not findRequestMission():
        time.sleep(0.5)
    mouse.leftClick()

    while not findX():
        time.sleep(0.2)
    mouse.leftClick()

    time.sleep(1)

    print '<-- decline mission\n'
    return True
Ejemplo n.º 3
0
def autopilot():
    print '--> autopilot'

    arrived = False
    while not arrived:
        print 'try to find target stargate or station'
        finded = ''
        for retry in range(7):
            mouse.moveToP(panel.middle(panel.Full))
            print 'try: ' + str(retry + 1)
            if findTargetStation():
                finded = 'station'
                break
            elif findTargetStarGate():
                finded = 'stargate'
                break
            else:
                x, y = panel.middle(panel.Overview)
                y += random.random() * 200 - 100
                mouse.leftClickAt(x, y)
                mouse.wheel(-12)

        if finded == '':
            print "can't find any waypoint"
            arrived = True
            break

        if finded == 'station':
            print 'target station finded, dock'
            x, y = image.findImgR(panel.Overview,
             'img/target_station.bmp', 0.2)
            mouse.leftClickAt(x, y)
            dock()
            print 'wait until entering station'
            while not findEnteringStation():
                time.sleep(0.1)
            print 'entering station'
            time.sleep(4)
            arrived = True
            break

        if finded == 'stargate':
            print 'target stargate finded, jump'
            x, y = image.findImgR(panel.Overview,
             'img/target_star_gate.bmp', 0.2)
            mouse.leftClickAt(x, y)
            jump()
            print 'wait until entering space'
            while not findEnteringSpace():
                time.sleep(0.1)
            print 'entering space'
            time.sleep(4)

    time.sleep(1)
    print '<-- autopilot\n'
Ejemplo n.º 4
0
def findRequestMission():
    x, y = image.findImgR(panel.Mission,
        'img/request_mission.bmp')
    if x != -1 and y != -1:
        mouse.moveTo(x, y)
        return True
    return False
Ejemplo n.º 5
0
def findUndock():
    x, y = image.findImgR(panel.Menu, 
        'img/undock.bmp', 0.2)
    if x > 0 and y > 0:
        mouse.moveTo(x, y)
        return True
    return False
Ejemplo n.º 6
0
def findCompleteMission():
    x, y = image.findImgR(panel.MissionRight,
        'img/complete_mission.bmp')
    if x != -1 and y != -1:
        mouse.moveTo(x, y)
        return True
    return False
Ejemplo n.º 7
0
def findAccept():
    x, y = image.findImgR(panel.MissionRight,
        'img/accept.bmp')
    if x != -1 and y != -1:
        mouse.moveTo(x, y)
        return True
    return False
Ejemplo n.º 8
0
def findAgent(agentPicSource):
    x, y = image.findImgR(panel.StationServices,
        agentPicSource)
    if x != -1 and y != -1:
        mouse.moveTo(x + 10, y + 10)
        return True
    return False
Ejemplo n.º 9
0
def findEnteringStation():
    x, y = image.findImgR(panel.ProcessBar,
        'img/entering_station.bmp')
    if x != -1 and y != -1:
        mouse.moveTo(x, y)
        return True
    return False
Ejemplo n.º 10
0
def findX():
    x, y = image.findImgR(panel.Mission,
        'img/x.bmp')
    if x != -1 and y != -1:
        mouse.moveTo(x, y)
        return True
    return False
Ejemplo n.º 11
0
def openInventory():
    print '--> open inventory'

    x, y = image.findImgR(panel.Menu, 'img/inventory.bmp', 0.2)
    if x < 0:
        return False
    mouse.moveTo(x, y)
    mouse.leftClick()
    time.sleep(1)

    print '<-- open inventory\n'
    return True
Ejemplo n.º 12
0
def closeInventory():
    print '--> close inventory'

    mouse.moveToP(panel.middle(panel.Inventory))
    x, y = image.findImgR(panel.Inventory, 'img/x.bmp')
    if x < 0:
        return False
    mouse.moveTo(x, y)
    mouse.leftClick()
    time.sleep(1)
    
    print '<-- close inventory\n'
    return True
def run():
    print "--> mission Eliminate the Pirate Campers"

    if not station.undock():
        return False

    pilot.autopilot()

    if not space.warpToMissionLocation():
        return False

    if not space.enableAllLowSlot():
        return False

    if not space.launchDrones():
        return False

    if not space.openMissionDetail():
        return False

    x = -1
    while x < 0:
        x, y = image.findImgR(panel.Full, "img/close.bmp")
        time.sleep(0.1)
    mouse.moveTo(x, y)
    mouse.leftClick()

    if not space.missionObjectiveComplete():
        return False

    if not space.dronesReturn():
        return False

    if space.setMissionWaypoint():
        pilot.autopilot()
    else:
        mouse.leftClick()
        space.exitStartMap()
        space.backToAgentStation()

    print "<-- mission Eliminate the Pirate Campers\n"
    return True
Ejemplo n.º 14
0
def inStation():
    x, y = image.findImgR(panel.Menu,
        'img/undock.bmp', 0.2)
    if x > 0 and y > 0:
        return True
    return False
Ejemplo n.º 15
0
def findTargetStarGate():
    x, y = image.findImgR(panel.Overview,
       'img/target_star_gate.bmp', 0.2)
    if x != -1 and y != -1:
        return True
    return False
Ejemplo n.º 16
0
def run():
	print '--> mission Deadly Arrival'

	if not station.undock():
		return False

	if not space.warpToMissionLocation():
		return False

	if not space.enableAllLowSlot():
		return False

	# in this mission we should approach a Large Collidable Object
	x, y = image.findImgR(panel.Overview, 'img/overview.bmp')
	if x < 0 or y < 0:
		return False
	mouse.moveTo(x, y)
	mouse.leftClick()

	x, y = image.findImgR(panel.Overview,
		'img/load_lco.bmp')
	if x < 0 or y < 0:
		return False
	mouse.moveTo(x, y)
	mouse.leftClick()

	if not space.lockTarget('img/ruined_structure.bmp'):
		return False

	if not space.approach():
		return False

	if not space.openAfterBurn():
		return False

	if not space.openMissionDetail():
		return False

	if not space.missionObjectiveComplete():
		return False

	# reset overview
	x, y = image.findImgR(panel.Overview,
		'img/overview.bmp')
	if x < 0 or y < 0:
		return False
	mouse.moveTo(x, y)
	mouse.leftClick()

	x, y = image.findImgR(panel.Overview,
		'img/load_kid.bmp')
	if x < 0 or y < 0:
		return False
	mouse.moveTo(x, y)
	mouse.leftClick()

	if not space.backToAgentStation():
		return False

	print '<-- mission Deadly Arrival\n'
	return True
Ejemplo n.º 17
0
def findInfo():
    x, y = image.findImgR(panel.MissionLeft,
        'img/info.bmp')
    if x != -1 and y != -1:
        return True
    return False