From 93a1cdd2e436a011cff26ee2b1b0333237d91089 Mon Sep 17 00:00:00 2001 From: Enrique Moran Date: Thu, 15 Dec 2016 16:14:25 +0100 Subject: [PATCH] Version 1.4 Probably, this is final version. --- lumberjackBot.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lumberjackBot.py b/lumberjackBot.py index 3bda360..e7814ab 100644 --- a/lumberjackBot.py +++ b/lumberjackBot.py @@ -22,12 +22,11 @@ class lumberjackBot(): def move(self, direction): + speed = 0.027 if direction == "left": - pyautogui.typewrite(['left']) - pyautogui.typewrite(['left']) + pyautogui.typewrite(['left', 'left'], speed) elif direction == "right": - pyautogui.typewrite(['right']) - pyautogui.typewrite(['right']) + pyautogui.typewrite(['right', 'right'], speed) def get_color(self, rgb): r = rgb & 0xff @@ -46,11 +45,12 @@ class lumberjackBot(): def play(self): self.move("right") while True: - if self.pixelL == (161, 116, 56): # or self.pixelL == (153, 110, 54): + if self.pixelL == (161, 116, 56): self.move("right") - elif self.pixelR == (161, 116, 56): # or self.pixelR == (153, 110, 54): + elif self.pixelR == (161, 116, 56): self.move("left") + def pixelThreadL(self): while True: self.get_pixel(self.lX, self.y, 'L')