Skip to content

yarinl3/Mimic_Capture_Flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Installation instructions:

  1. Download zip from and extract it.
image

2. Check if python exist with the command python in terminal / cmd. (ctrl+z to exit)
python
image

3. If python does not exist [download python](https://www.python.org/downloads/).
image

4. Install virtualenv package with the command: python -m pip install virtualenv
image

5. Nevigate to the extract folder with cd
image

6. Create a new environment with the command: python -m venv myenv
image

7. Activate the environment with the command:
Mac / Ubuntu:
    source myenv/bin/activate
Windows:
    myenv\Scripts\activate
image

8. Install Mimic dependencies with the command: python -m pip install -r requirements.txt
image

Web mode:
9. Run the server with the command: flask run --host=0.0.0.0 --port=1234
image

Web Mode

  • 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.

How to use

Home Page

Upload screenshot of the board (initial game state and only png / jpg / jpeg / webp)
image

Fix Points Page

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".
image image

Solutions Page

image

Get Order Page

image

Play Page

image

IDE / Terminal

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.

Modes

SOLVE

Solves a given board and prints blocks to remove with the highest benefit.

GET_ORDER

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.

PLAY

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.

DEBUG

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:

  1. Run the script in debug mode and look at the result image.
  2. Change height_fix parameter to place the center dot vertically in the center of the Mimic block.
  3. Change width_fix parameter to place the center dot horizontally in the center of the Mimic block.
  4. Change horizontal_fix, vertical_fix parameters to place other dots in the middle of their blocks.
  5. Change the global parameters that in the head of the script to the correct values.

For questions and bug reporting: yarinl330@gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published