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
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
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
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
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
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
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
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
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
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
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
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