def main(): scratch.init() scratch.newGame() scratch.printAll() scratch.simulateGame() scratch.postGameToTumblr()
def main(): scratch.init() server = WordsServer() while True: server.act() time.sleep(1) server.save_image()
def runBot(): scratch.init() while (True): im = getImage() if selectOpenGame(im): time.sleep(2) clickImage(wwfAccept) shuffleOrRecall() im = getImage() rack = {} board = {} for i in range(7): rack[i] = getRackTile(im, i) print(rack[i],) print print for i in range(15): board[i] = {} for j in range(15): board[i][j] = getBoardTile(im, i, j) print(board[i][j],) if board[i][j] == ' ': board[i][j] = None print scratch.newGame() scratch.setBoard(board) scratch.setCurrentRack(rack) move = scratch.bestMove() print(move) playMove(board, rack, move) else: print("Not my turn %d" % (int(time.time()))) time.sleep(5)
def runBot(): scratch.init() while (True): im = getImage() if selectOpenGame(im): time.sleep(2) clickImage(wwfAccept) shuffleOrRecall() im = getImage() rack = {} board = {} for i in range(7): rack[i] = getRackTile(im, i) print(rack[i], ) print print for i in range(15): board[i] = {} for j in range(15): board[i][j] = getBoardTile(im, i, j) print(board[i][j], ) if board[i][j] == ' ': board[i][j] = None print scratch.newGame() scratch.setBoard(board) scratch.setCurrentRack(rack) move = scratch.bestMove() print(move) playMove(board, rack, move) else: print("Not my turn %d" % (int(time.time()))) time.sleep(5)
def __init__(self, options): # XXX: is this correct? scratch.init() pass