This commit is contained in:
Alexander Popov 2022-12-26 01:02:19 +03:00
commit 63a84f2345
18 changed files with 172 additions and 0 deletions

16
.editorconfig Normal file
View File

@ -0,0 +1,16 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_style = space
indent_size = 4
[*.md]
trim_trailing_whitespace = false

47
README-EN.md Normal file
View File

@ -0,0 +1,47 @@
# 🇺🇦 🖕
## 🍎 Battlepillars Farming Bot
![Battlepillars Logo](images/logo.png)
🇷🇺 Руководство на [русском](README.md)!
## 💻 Requirements
* [JDK](https://adoptium.net/temurin/releases/) 11.0.17+8
* [SikuliX](https://launchpad.net/sikuli/sikulix/2.0.5/+download/sikulixide-2.0.5.jar) 2.0.5 или выше | SikuliX 2.0.5 or high
* [Jython](https://search.maven.org/artifact/org.python/jython-standalone/2.7.3/jar) 2.7.3 Standalone
## 💽 Installing Jython
Download `jython-standalone-2.7.3.jar` and place it in the specified paths
for your operating system.
* Windows: `%APPDATA%\Sikulix\Extensions`
* Mac: `~/Library/Application Support/Sikulix/Extensions`
* Linux: `~/.Sikulix/Extensions`
## 🕹 Preparing the game
1. Set in game settings **window mode** and window resolution **1024x768**
2. Select the "Chain" skin for the battlepillars
3. Run a campaign and open Level 8
4. As items of equipment, select
third item: **Medic**, fourth item: **Flamethrower**
5. Run the level (this is necessary so that Level 8 is always selected by default)
## Bot Launch
1. Open the game, go to the company and leave on the global map,
so that level 8 is on the screen
2. Open the script `apple-farm.py` in SikuliX IDE
3. Run the script
> To stop script execution, use key combination [Alt]+[Shift]+[C].
## ⭐ Extra
### run-ide.bat
Script to run **SikuliX IDE** with required version of **JDK**.
The JDK directory is supposed to be located next to the IDE file (`sikulixide-2.0.5.jar`).

48
README.md Normal file
View File

@ -0,0 +1,48 @@
# 🇺🇦 🖕
## 🍎 Бот для фарма в Battlepillars
![Battlepillars Logo](images/logo.png)
🇺🇸 [English](README-EN.md) guide!
## 💻 Требования
* [JDK](https://adoptium.net/temurin/releases/) 11.0.17+8
* [SikuliX](https://launchpad.net/sikuli/sikulix/2.0.5/+download/sikulixide-2.0.5.jar) 2.0.5 или выше
* [Jython](https://search.maven.org/artifact/org.python/jython-standalone/2.7.3/jar) 2.7.3 Standalone
## 💽 Установка Jython
Скачаиваем `jython-standalone-2.7.3.jar` и размещаем его по указанным путям
для своей операционной системы.
* Windows: `%APPDATA%\Sikulix\Extensions`
* Mac: `~/Library/Application Support/Sikulix/Extensions`
* Linux: `~/.Sikulix/Extensions`
## 🕹 Подготовка игры
1. Установить в настройках игры **оконный режим** и разрешение окна **1024x768**
2. Выбрать скин "Кольчуга" для гусениц
3. Запустить из меню игры кампанию, открыть 8 уровень
4. В качестве элементов экипировки выбрать
третий предмет: **Медик**, четвёртый предмет: **Огнемёт**
5. Запустить уровень (это необходимо, чтобы по умолчанию всегда был выбран 8 уровень)
## 🤖 Запуск бота
1. Открываем игру, заходим в компанию и оставляем игру на глобальной карте,
чтобы 8 уровень был на экране
2. Открываем скрипт `apple-farm.py` в SikuliX IDE
3. Запускаем скрипт
> Для остановки выполнения скрипта исполльзуется
> комбинация клавиш [Alt]+[Shift]+[C].
## ⭐ Дополнительно
### run-ide.bat
Скрипт для запуска **SikuliX IDE** с необходимой версией **JDK**.
Предпологается, что директория с JDK разположена рядом с файлом IDE (`sikulixide-2.0.5.jar`).

60
apple-farm.py Normal file
View File

@ -0,0 +1,60 @@
from datetime import datetime
__author__ = "Alexander Popov <iiiypuk@fastmail.fm>"
__version__ = "1.0.0"
__license__ = "Unlicense"
def runLevel():
"""Running level and farming applesю"""
wait("images/farm_level_on_map.png", 10)
click("images/farm_level_on_map.png")
wait("images/level_title.png", 3)
click("images/level_start_button.png")
wait("images/equip_window.png", 3)
click("images/button_start.png")
wait("images/level_info_message.png", 5)
click("images/level_info_message_ok.png")
Mouse.wheel(WHEEL_DOWN, 6)
for pillar in range(2):
click("images/pillar_fire.png")
for x in range(7):
click("images/pillar_heal.png")
click("images/pillar_go.png")
wait("images/winner_window.png", 60 * 3)
click("images/level_complete.png")
def main():
"""Main farm loop."""
print("Battlepillars Farming Bot {0} by {1}".format(__version__, __author__))
run_count = 0
while True:
run_count += 1
date_now = datetime.now()
date_string = date_now.strftime("%Y-%m-%d %H:%M:%S")
print(
"[{date}] Running farm {times} times".format(
date=date_string, times=run_count
)
)
runLevel()
if __name__ == "__main__":
main()

BIN
images/button_start.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
images/equip_window.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
images/level_complete.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
images/level_title.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
images/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
images/pillar_fire.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
images/pillar_go.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
images/pillar_heal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
images/winner_window.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

1
run-ide.bat Normal file
View File

@ -0,0 +1 @@
start "" "jdk-11.0.17+8/bin/java.exe" -jar sikulixide-2.0.5.jar