Skip to content

Commit

Permalink
drop tesseract ocr engine
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoRodriges committed Jul 30, 2023
1 parent 7e31c5e commit cf5c830
Show file tree
Hide file tree
Showing 10 changed files with 830 additions and 619 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
[package]
name = "cyberbot2077"
version = "0.1.0"
version = "0.2.0"
edition = "2021"

[dependencies]
winapi = { version = "0.3", features = ["winuser"] }
clipboard-win = "4.4"
bmp = "0.5"
winput = "0.2"

#tesseract = "0.12"
32 changes: 7 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

Bot, who solves breach protocol games from Cyberpunk 2077.

[![Preview](assets/preview.gif)](assets/preview.mp4)
![Preview](assets/preview.gif)

## Usage

- [Download](#download) or [build](#build) the bot
- Launch `cyberbot2077.exe`
- Launch a breach protocol game
- Move mouse cursor away. It must not obstruct the game field
- Press `PrintScreen` keyboard button
- Press `PrintScreen` (or `Alt + PrintScreen` in window mode) keyboard button
- Wait a second
- ???
- PROFIT
Expand All @@ -22,10 +22,8 @@ Bot, who solves breach protocol games from Cyberpunk 2077.
## How it works
This bot uses [Tesseract](https://github.com/tesseract-ocr/tesseract) library as OCR engine.
`PrintScreen` keyboard button triggers the bot, and it grabs screenshot
to recognize game field (matrix, conditions, max step count and screen coordinates).
to recognize game field (matrix, conditions, buffer size and screen coordinates).
![Recognize example](assets/recognize.jpg)
Expand Down Expand Up @@ -83,33 +81,17 @@ Last solution `#6` will be applied.
Download bot [here](https://github.com/ricorodriges/cyberbot2077/releases).
Bot uses `tesseract/tesseract.exe` binary. So please [download binaries](https://github.com/UB-Mannheim/tesseract/wiki) and extract to `tesseract` directory
```
|- tesseract
| |- tesseract.exe
|- cyberbot2077.exe
```
Then run `cyberbot2077.exe` and enjoy!
## Build
Since this project uses [Tesseract](https://github.com/tesseract-ocr/tesseract),
you need to build it yourself or [download binaries](https://github.com/UB-Mannheim/tesseract/wiki).
Bot uses `tesseract/tesseract.exe` binary. So please extract binaries to `tesseract` directory
```
|- tesseract
| |- tesseract.exe
|- src
|- test
|- Cargo.toml
You may run tests to make sure everything is ok
```sh
cargo test
```

Then you may run tests to make sure everything is ok and build
And build as usual rust crate
```sh
cargo test
cargo build --release
./target/release/cyberbot2077.exe
```
Binary file removed assets/preview.mp4
Binary file not shown.
Loading

0 comments on commit cf5c830

Please sign in to comment.