Beispiel #1
0
def openMissionMenu():
	print '--> open mission menu'

	result = findAtInfo('agent_mission')

	while not result:
		result = findAtInfo('agent_mission')
		time.sleep(1)
	mouse.leftClickAt(result[0] + 60, result[1] + 30)
	time.sleep(1)
	print '<-- open mission menu\n'
Beispiel #2
0
def repair():
	print '--> repair'

	result = findAtStationServices('repair_shop')
	if not result:
		return
	mouse.leftClickAtP(result)

	print 'wait until open repair facilities'
	result = None
	while not result:
		result = findAtFull('repair_facilities')
		time.sleep(0.5)
	time.sleep(0.5)
	mouse.leftClickAt(result[0], result[1] + 70)
	key.pressEx('ctrl+a')

	result = None	
	while not result:
		result = findAtFull('repair_item')
		time.sleep(0.2)
	mouse.leftClickAtP(result)

	print 'wait...'
	while not findAtFull('pick_new_item'):
		time.sleep(0.2)

	result = findAtFull('repair_all')
	if result:
		mouse.leftClickAtP(result)
		print 'repairing...'
		result = None
		while not result:
			time.sleep(0.2)
			result = findAtFull('ok')
			if not result:
				result = findAtFull('yes')
		mouse.leftClickAtP(result)
		result = findAtFull('repair_facilities')
		mouse.moveToP(result)
	else:
		print 'nothing to repair'

	result = None
	while not result:
		time.sleep(0.2)
		result = findAtFull('x')
	mouse.leftClickAtP(result)

	print '<-- repair\n'
	return True
Beispiel #3
0
def _launch(group):

	result = None
	while not result:
		mouse.moveToP(panel.center(panel.Drones))
		mouse.wheel(100)
		mouse.moveToP(panel.center(panel.Full))
		result = findAtDrones('bay')

	if group == None:
		mouse.rightClickAtP(result)
	else:
		if not findAtDrones(group):
			mouse.leftClickAtP(result)
		result = findAtDrones(group)
		while not result:
			time.sleep(0.5)
			result = findAtDrones(group)
		mouse.rightClickAtP(result)

	result = findAtDrones('launch_drones')
	while not result:
		time.sleep(0.5)
		result = findAtDrones('launch_drones')
	mouse.leftClickAtP(result)

	print 'wait until drones launching..'
	mouse.moveToP(panel.center(panel.Full))
	# time.sleep(5)
	while not findAtDrones('idle') and not findAtDrones('fighting') and not findAtDrones('returning'):
		mouse.moveToP(panel.center(panel.Drones))
		mouse.wheel(-100)
		mouse.moveToP(panel.center(panel.Full))
		if not findAtDrones('idle') and not findAtDrones('fighting') and not findAtDrones('returning'):
			result = findAtDrones('local_space')
			if result:
				mouse.leftClickAtP(result)
				mouse.wheel(-100)
				mouse.leftClickAt(result[0], result[1] + 20)

	return True
Beispiel #4
0
def openMissionDetails():
	enterStarMap()

	print '--> open mission detail'

	openMissionMenu()

	result = findAtInfo('read_details')
	while not result:
		result = findAtInfo('read_details')
		time.sleep(0.5)
	mouse.leftClickAtP(result)

	print 'wait until find mission objective'
	while not findAtMissionDetails('o'):
		mouse.leftClickAt(panel.MissionDetails[0] + 20, panel.MissionDetails[1] + 20)
		mouse.wheel(-20)

	print '<-- open mission detail\n'

	exitStarMap()
	return True
Beispiel #5
0
def findEnemy():
	print '--> find enemy'
	count = 0
	result = pic.findColorR(panel.Overview, 'c11313')
	while result == None and count < 10:
		if result:
			break
		x, y = panel.center(panel.Overview)
		y += random.random() * 200 - 100
		mouse.leftClickAt(x, y)
		if count < 5:
			mouse.wheel(-20)
		else:
			mouse.wheel(20)
		count += 1
		result = pic.findColorR(panel.Overview, 'c11313')

	if not result:
		print 'can not find enemy.'
	else:
		print 'target finded.'

	print '<-- find enemy'
	return result
Beispiel #6
0
def findTarget(target, threashould = 0.1):
	print '--> find target "' + target + '"'
	count = 0
	result = findAtOverview(target, threashould)
	while result == None and count < 10:
		if result:
			break
		x, y = panel.center(panel.Overview)
		y += random.random() * 200 - 100
		mouse.leftClickAt(x, y)
		if count < 5:
			mouse.wheel(-20)
		else:
			mouse.wheel(20)
		count += 1
		result = findAtOverview(target)

	if not result:
		print 'can not find target.'
	else:
		print 'target finded.'

	print '<-- find target "' + target + '"\n'
	return result
Beispiel #7
0
def autopilot():
    print '--> autopilot'

    overview.switchTo('pilot')

    while True:
        print 'try to find target stargate or station'
        finded = ''
        result = None
        for retry in range(3):
            print 'try: ' + str(retry + 1)
            result = findAtOverview('target_station', 0.2)
            if result:
                print 'station finded'
                finded = 'station'
                break
            result = findAtOverview('target_star_gate', 0.2)
            if result:
                print 'stargate finded'
                finded = 'gate'
                break
            x, y = panel.center(panel.Overview)
            y += random.random() * 200 - 100
            mouse.leftClickAt(x, y)
            mouse.wheel(-12)
            mouse.moveToP(panel.center(panel.Full))

        if finded == '':
            print "can't find any waypoint"
            print '<-- autopilot\n'
            return False

        if finded == 'station':
            print 'docking...'
            mouse.leftClickAtP(result)
            key.pressEx(sc.Activate)
            print 'wait until entering station'
            begin = time.time()
            result = findAtProgressBar('entering_station', 0.1) 
            while not result and time.time() - begin < 80:
                result = findAtProgressBar('entering_station', 0.1) 
                time.sleep(0.1)
            if result:
                print 'entering station'
                time.sleep(4)
                print '<-- autopilot\n'
                return True

        if finded == 'gate':
            print 'jump...'
            mouse.leftClickAtP(result)
            key.pressEx(sc.Activate)
            print 'wait until entering space'
            begin = time.time()
            result = findAtProgressBar('entering_space', 0.1)
            while not result  and time.time() - begin < 80:
                result = findAtProgressBar('entering_space', 0.1)
                time.sleep(0.1)
            if result:
                print 'entering space'
                time.sleep(3)