Skip to content

jmitash/BilgeBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BilgeBot

This is a bot that automatically solves the bilge puzzle in Puzzle Pirates. Please keep in mind it only works on Windows at the moment. Multi-threaded depth searching is supported, but note that increasing the depth increases the time it takes to compute the next moves exponentially. Each single increase in depth will take approximately 60 times longer than the previous depth.

How it works

While starting up, the bot will wait till it finds the Puzzle Pirates window. Once the window is found, the bot scans the window for the bilge puzzle, at which point it will attempt to solve it.

After finding the puzzle, the bot captures the puzzle part of the window and attempts to color-match specific pixels in the puzzle to pieces that it knows, allowing the bot to "see" what pieces are on the board. If the bot finds a piece that it isn't familiar with, it assumes the board is either still settling from the previous move or that the board is blocked by the duty report or something else.

Once the bot knows what pieces are on the board, it uses a brute-force algorithm to simulate every swap possible. If the depth is higher than 1, it will simulate another swap after the previous. After simulating a swap, the bot scores the simulated board and clears and solutions the swap may have caused, and shifts the pieces up to fill their place just as the actual puzzle does. This continues until all swaps within the given depth are performed. The highest scoring set of swaps is selected as the swaps to perform.

Lastly, and most simply is the mouse movement. The bot will fit a quadratic equation to the start and end points of the mouse movement. The bot then uses the time to tell where along the curve the mouse should be. Admittedly it's not the best solution, but so far it has been effective.

Compiling the bot

  1. The bot requires JNA, or Java Native Access to be able to keep track of the Puzzle Pirates window.
  2. The contents of the /rsc/ folder must be built into the root directory of the JAR.
  3. The StatusFrame form was created with the IntelliJ IDEA UI designer. I recommend you use the IDE to compile this.

Aside from that, compile the bot as you would any other program.

Found a problem/bug or have a feature request?

Please use the issue tracker to report it.



Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages