This is a project to automate the mobile game Summoners War on the Android platform.
You need an Android phone, and a PC with Android Debug Bridge (ADB) installed as a command accessible from the default terminal.
The PC (Host) is typically linked with the Android phone (Target) with a USB to micro USB cable, but ADB over WiFi does exist, but hasn't been tested with this program.
The one thing that needs to be completed for this project to be considered good.
- Automate daily quests.
These goals are not really important, but would be good to implement after the Main Goal is completed.
- Collect mana stones and gems from the different buildings that produce them.
- When using the Power-Up Circle, only use silver star monsters.
- Use up energy to perform tasks based on what is needed/lacking.
- Be able to start from a new account, proceed through the tutorial properly, and run the account by itself with no human help.
To know what is happening on the screen, currently the script takes a screenshot using the Android command "screencap" with a PNG format. It then reads the pixel at a certain coordinate on the screen, and using a array of Hex values located in ArrayHolder.HEXCOLOR, decides if to tap the screen at certain coordinates or not.
Currently working on this: Instead of querying for colors of specific pixels on the screen and deciding what to do based on that, I want it to scan the entirety of the screenshot and logically make decisions based on what it finds, with the overall goal still completing all the daily quests.
These are known bottlenecks that slow down either portions or the entire script.
- Using screencap to make a PNG file of the Targets screen is slow.
- Transferring the PNG image from the Target to the Host is slow (USB 2.0).
- Currently only have a Galaxy S6, with a 1440x2560 (portrait) screen. Anything else will almost certainly break the script, particularly the hex values.
These applies to both Bottlenecks and Issues. Not required, but would be good to fix.
- Switch from screepcap to something faster
- Find method to either shrink the size of image transferred, or increase rate of transfer.
Hypothetically, with a lot of work, the core methods of this script could be adapted to suit games that don't need the screen to be updated very fast.