This branch is under construction. Please download the tool from "combined tool" branch.
This project can run in web mode with flask with nice user interface and also can run through terminal / IDE with low user interface.
- Download zip from and extract it.
2. Check if python exist with the command python in terminal / cmd. (ctrl+z to exit)
python
3. If python does not exist [download python](https://www.python.org/downloads/).
4. Install virtualenv package with the command:
python -m pip install virtualenv
5. Nevigate to the extract folder with
cd
6. Create a new environment with the command:
python -m venv myenv
7. Activate the environment with the command:
Mac / Ubuntu:
source myenv/bin/activate
Windows:
myenv\Scripts\activate
8. Install Mimic dependencies with the command:
python -m pip install -r requirements.txt
Web mode:
9. Run the server with the command:
flask run --host=0.0.0.0 --port=1234
- The first url can opened only from the same computer.
The other url can opened from any device that connected to the same local network. - To close the server use ctrl+c otherwise you will have to use other port next run.
- From this moment on, to run the program again, you need to open the terminal and perform steps 5 -> 7 -> 9.
Upload screenshot of the board (initial game state and only png / jpg / jpeg / webp)
Different phones have different resolutions so you need to correct the position of the dots.
First of all place the central point in the center of the mimic treasure block with X / Y offsets.
Then widen the distance between the points so that they are roughly in the center of the blocks using vertical / horizontal offsets.
Click the change button to apply.
The "Solve" button will display all results with maximum benefit.
If you want to skip it and get the order of the first result use the checkbox before click "Solve".
In case all the solutions have no winning order, you can look for solutions with smaller benefit using "Specific benefit" textbox before click "Solve".
Install as in web mode up to step 8 (inclusive).
To run the script from IDE select mode and screenshot_path.
For example:
mode = MODES['PLAY']
screenshot_path = '1.png'
To run the script from terminal load the environment if it exists (step 7), run the script with two parameters: screenshot path and mode.
For example:
py ~/pythonProject/Mimic_Capture.py test.png get_order
If no mode is selected, the default is play.
The script will convert the image to png (from jpeg / jpg / webp), so in the next run you must change the extension to png.
Solves a given board and prints blocks to remove with the highest benefit.
Gets a list of blocks to remove and finds the order in which they must be removed to win.
After using the solver, copy the printed block list as input to this mode.
Runs a game with the given board. It is recommended to play through the terminal.
A block index consists of letter a-g for column index and numbers 1-7 for row index.
For example: A1, A5, G4, C5
At the end of the game a record of the moves is shown.
Different phones have different resolution.
The program is aimed at the resolution of most phones.
If the parameters not match the resolution the dots will not be in the center of the blocks and it will cause wrong results.
To fix it do this steps:
- Run the script in debug mode and look at the result image.
- Change height_fix parameter to place the center dot vertically in the center of the Mimic block.
- Change width_fix parameter to place the center dot horizontally in the center of the Mimic block.
- Change horizontal_fix, vertical_fix parameters to place other dots in the middle of their blocks.
- Change the global parameters that in the head of the script to the correct values.
For questions and bug reporting: yarinl330@gmail.com