put all files

This commit is contained in:
2018-02-14 00:45:37 +08:00
parent 956464c6af
commit 05ea41a98b
3 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,17 @@
# auto_village # auto_village
Telegram 自動收穫工作 Script請搭配 Telegram CLI 使用。 Telegram 自動收穫工作 Script請搭配 Telegram CLI 使用。
## Install
1. 建立一個資料夾 `auto_village`,把 [`tg`](https://github.com/vysheng/tg) 編譯好登入進去。
2. `auto.sh` 放進去。
3.`rc.local` 的內容放進 `/etc/rc.local` 之後打:
```sh
# 打開
sudo systemctl restart rc-local.service
# 關掉好像要用
sudo systemctl kill rc-local.service
```

9
auto.sh Normal file
View File

@ -0,0 +1,9 @@
#! /bin/bash
sleep 3s
while true; do
echo "dialog_list" | nc localhost 58787
echo "msg Village_Game /work" | nc localhost 58787
echo "msg Village_Game /harvest" | nc localhost 58787
sleep 720s
done

2
rc.local Normal file
View File

@ -0,0 +1,2 @@
sudo -u pinlin /home/pinlin/auto_village/tg/bin/telegram-cli -W -P 58787 -d &
sudo -u pinlin /home/pinlin/auto_village/auto.sh &