Ejemplo n.º 1
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