aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2018-01-03 00:41:37 +0800
committerclarkzjw <[email protected]>2018-01-03 00:41:37 +0800
commitf4c535b38aaee18dd479e230858db316d1051d88 (patch)
tree5864dd6f8794a17c61ad4cf27246bec811a583c3
parentf4a786ad11fc659d649738d90113604c6f32567b (diff)
downloadLumberJack-f4c535b38aaee18dd479e230858db316d1051d88.tar.gz
+ fix
-rw-r--r--Dockerfile38
-rw-r--r--README.md29
-rw-r--r--bot.py5
-rw-r--r--circle.yml12
-rw-r--r--requirements.txt9
5 files changed, 14 insertions, 79 deletions
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index 0f556b7..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,38 +0,0 @@
1# LumberJack bot
2# It is difficult to dockerize this bot
3# I have no idea how to access host's screenshot
4# inside a docker container
5# Project's present status:
6# It can access mouse move inside a container
7# But due to it cannot access screenshot of the host
8# it cannot make decisions yet
9
10FROM ubuntu:latest
11MAINTAINER clarkzjw <[email protected]>
12
13RUN \
14 sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \
15 apt-get update && \
16 apt-get -y upgrade && \
17 apt-get install -y firefox sudo xvfb scrot git build-essential python3 python3-dev python3-pip python3-tk
18
19RUN export uid=1000 gid=1000 && \
20 mkdir -p /home/developer && \
21 echo "developer:x:${uid}:${gid}:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd && \
22 echo "developer:x:${uid}:" >> /etc/group && \
23 echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer && \
24 chmod 0440 /etc/sudoers.d/developer && \
25 chown ${uid}:${gid} -R /home/developer
26
27RUN \
28 Xvfb :1 -screen 0 1366x768x16 &> xvfb.log && \
29 export DISPLAY=:1.0 && \
30 touch /root/.Xauthority && \
31 touch /home/developer/.Xauthority && \
32 pip3 install image && \
33 pip3 install python3-xlib && \
34 pip3 install pyautogui
35
36USER developer
37ENV HOME /home/developer
38CMD /bin/bash
diff --git a/README.md b/README.md
index 3d46f32..75395d3 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
1# LumberJack bot [![CircleCI](https://circleci.com/gh/clarkzjw/LumberJack.svg?style=svg)](https://circleci.com/gh/clarkzjw/LumberJack) [![](https://images.microbadger.com/badges/version/clarkzjw/lumberjack.svg)](https://microbadger.com/images/clarkzjw/lumberjack "Get your own version badge on microbadger.com") [![](https://images.microbadger.com/badges/image/clarkzjw/lumberjack.svg)](https://microbadger.com/images/clarkzjw/lumberjack "Get your own image badge on microbadger.com") 1# LumberJack bot
2 2
3Current Top Score: 408 3Current Top Score: 1068
4 4
5![image](https://cloud.githubusercontent.com/assets/2663319/20305522/de7b327e-ab70-11e6-898e-3f286a0b567a.png) 5![image](https://user-images.githubusercontent.com/2663319/34491418-4e345ac6-f01e-11e7-99af-88e8e8a1e2ec.png)
6 6
7## Usage 7## Usage
8 8
@@ -10,25 +10,4 @@ Current Top Score: 408
10python3 bot.py 10python3 bot.py
11``` 11```
12 12
13Make sure you have PyAutoGUI installed. 13Tested on macOS 10.12.6 with screen resolution 1680*1050 (not HiDPI) on Safari.
14
15If you use Debian based Linux, you can install PyAutoGUI by
16
17```bash
18sudo apt-get install scrot python3-tk python3 python3-dev python3-pip
19sudo pip3 install image
20sudo pip3 install python3-xlib
21sudo pip3 install pyautogui
22```
23
24## The Docker way
25
26Although the Docker image of this bot cannot work correctly, you can give it a try. Remember to read the comments on top of Dockerfile
27
28```bash
29docker run -it \
30-e DISPLAY=$DISPLAY \
31-v /tmp/.X11-unix:/tmp/.X11-unix \
32clarkzjw/lumberjack
33```
34
diff --git a/bot.py b/bot.py
index c419bbc..42cb070 100644
--- a/bot.py
+++ b/bot.py
@@ -3,12 +3,11 @@ import time
3import mss 3import mss
4import pyautogui as pg 4import pyautogui as pg
5from numpy import array, uint8 5from numpy import array, uint8
6
7#from keyboard import send
8
9from pynput.keyboard import Key, Controller 6from pynput.keyboard import Key, Controller
7
10keyboard = Controller() 8keyboard = Controller()
11 9
10
12def begin(): 11def begin():
13 pg.click(440, 900, 2) 12 pg.click(440, 900, 2)
14 13
diff --git a/circle.yml b/circle.yml
deleted file mode 100644
index e4d4da5..0000000
--- a/circle.yml
+++ /dev/null
@@ -1,12 +0,0 @@
1machine:
2 services:
3 - docker
4
5dependencies:
6 override:
7 - docker info
8 - docker build -t lumberjack .
9
10test:
11 override:
12 - docker run -d lumberjack; sleep 10
diff --git a/requirements.txt b/requirements.txt
index f30d3d3..1b8e67c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,6 +1,13 @@
1keyboard==0.11.0 1keyboard==0.11.0
2mss==3.1.1 2mss==3.1.1
3numpy==1.13.3 3numpy==1.13.3
4Pillow==5.0.0
4PyAutoGUI==0.9.36 5PyAutoGUI==0.9.36
5pyobjc==4.1 6PyMsgBox==1.0.6
7pynput==1.3.8.1
6pyobjc-core==4.1 8pyobjc-core==4.1
9pyobjc-framework-Cocoa==4.1
10pyobjc-framework-Quartz==4.1
11PyScreeze==0.1.13
12PyTweening==1.0.3
13six==1.11.0
Powered by cgit v1.2.3 (git 2.41.0)