From 50652242c13530e3f65409fd442ed87d41a5d20c Mon Sep 17 00:00:00 2001 From: Enrique Moran Date: Sun, 11 Mar 2018 23:04:59 +0100 Subject: [PATCH] fixed images, max speed 0.2 Incoming update --- lumberjackBot.py | 8 +++++--- playButton.png | Bin 125 -> 369 bytes 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lumberjackBot.py b/lumberjackBot.py index e7814ab..e95ccf0 100644 --- a/lumberjackBot.py +++ b/lumberjackBot.py @@ -18,11 +18,11 @@ class lumberjackBot(): self.pixelR = (0,0,0) # Right side branch color self.lX = treeX - 30 # Left side branch X location self.rX = treeX + 30 # Right side branch X location - self.y = treeY - 130 # Both side branch Y location + self.y = treeY - 132 # Both side branch Y location def move(self, direction): - speed = 0.027 + speed = 0.2 if direction == "left": pyautogui.typewrite(['left', 'left'], speed) elif direction == "right": @@ -61,11 +61,13 @@ class lumberjackBot(): if __name__ == "__main__": + print("Running in 5 seconds, minimize this windows.") + time.sleep(5) playX, playY = pyautogui.locateCenterOnScreen('playButton.png') pyautogui.moveTo(playX, playY) pyautogui.click() # Start the game by pressing play button time.sleep(0.5) # Wait for screen refresh - treeX, treeY = pyautogui.locateCenterOnScreen('tree.png') # Recognize tree position + treeX, treeY = playX - 6, playY - 177 # Tree position time.sleep(0.3) print("Im playing... To stop me click on IDLE and press CTRL+F6.") lumberjack = lumberjackBot(playX, playY, treeX, treeY) diff --git a/playButton.png b/playButton.png index 499e7747b06d7936c8182083eb616131e0262f9b..08e8aee33a239d4ca12622da59d06c342c05f173 100644 GIT binary patch delta 356 zcmV-q0h|7P@d6=@Nb6g&0uL?)+AcoW`9Hg>B!}T# zXi!;0t;jMu^vT3M?r=c+r7KZ?GZ4cjfy7*MY*$XeBCmg}$ETF5PNS}Lzj5qCT4 zDDKLj@9E+gV&R|sqh!Z( z`@J7lq=p<^JS~vbc+Z`<&;QT9Yx^(%ZF_R4122!!ZxD~+WbNJ!BDz-Bfo3pxy85}S Ib4q9e05>!zuK)l5