def start_game():
	"""
		Click on the Play again button if present on the screen, for more details, refer playAgain.png and gameOver.png
	"""

	# Avoid writing into the file 'id' and use subprocess later
	os.system('xwininfo -root -tree  | grep -i -e "gnome-mine" -e "Print Cart"| egrep -o "[0-9a-fA-F]+x[0-9a-fA-F]+" | head -1 > id')
	os.system('xdotool windowactivate `cat id`')
	time.sleep(0.1)
	get_cropped_image()
	coordinates, image_name = findImage.main('playAgain', 'fullScreen.png', 1, 20)
	if len(coordinates):
		i,j = coordinates[0][0], coordinates[0][1]
		clickAbsolute(j,i)
def start_game():
    """
		Click on the Play again button if present on the screen, for more details, refer playAgain.png and gameOver.png
	"""

    # Avoid writing into the file 'id' and use subprocess later
    os.system(
        'xwininfo -root -tree  | grep -i -e "gnome-mine" -e "Print Cart"| egrep -o "[0-9a-fA-F]+x[0-9a-fA-F]+" | head -1 > id'
    )
    os.system('xdotool windowactivate `cat id`')
    time.sleep(0.1)
    get_cropped_image()
    coordinates, image_name = findImage.main('playAgain', 'fullScreen.png', 1,
                                             20)
    if len(coordinates):
        i, j = coordinates[0][0], coordinates[0][1]
        clickAbsolute(j, i)
def update_board(board):
	for i in GLOBALS.AVAILABLE_NUMBERS:
		coordinates, image_number = findImage.main(i)
		for j in coordinates:
			board[j[0]][j[1]] = i # i or image_number, whatever :P
示例#4
0
def is_game_finished():
    # print 'is_game_finished================================='
    coordinates, x = findImage.main("finished")
    if len(coordinates):
        exit(0)
    return False
def update_board(board):
    for i in GLOBALS.AVAILABLE_NUMBERS:
        coordinates, image_number = findImage.main(i)
        for j in coordinates:
            board[j[0]][j[1]] = i  # i or image_number, whatever :P
def is_game_finished():
    coordinates, x = findImage.main(
        'finished')  # finished.png is the image when the game is finished
    if len(coordinates):
        exit(0)
    return False
示例#7
0
def is_game_finished():
    # print 'is_game_finished================================='
    coordinates, x = findImage.main('finished')
    if len(coordinates):
        exit(0)
    return False
def is_game_finished():
	coordinates, x = findImage.main('finished') # finished.png is the image when the game is finished
	if len(coordinates):
		exit(0)
	return False