Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
LawTotem committed Oct 22, 2021
2 parents 4faa6ee + b718b44 commit a56e84c
Show file tree
Hide file tree
Showing 15 changed files with 2,687 additions and 2,162 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ mockups
.vscode
snipper.dll
snap*png
PoE-Enchantress.exe
PoE-Enchantress.exe
*.zip
29 changes: 24 additions & 5 deletions PoE-Enchantress.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SendMode Input ; Recommended for new scripts due to its superior speed and reli
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.


global version := "0.2.1"
global version := "0.3.0"

global PID := DllCall("Kernel32\GetCurrentProcessId")

Expand All @@ -34,6 +34,8 @@ if (!FileExist(RoamingDir)) {

global SettingsPath := RoamingDir . "\settings.ini"
global TempPath := RoamingDir . "\temp.txt"
global RawTextCapture := ""
global RawCaptureTime := ""

tooltip, Loading Enchantress [Initializing Settings]

Expand Down Expand Up @@ -123,6 +125,13 @@ while (EnchantRemappingTxt == "ERROR") {
IniRead, EnchantRemappingTxt, %SettingsPath%, User, EnchantRemappingTxt
}

IniRead, SaveEnchant, %SettingsPath%, User, SaveEnchant
while (SaveEnchant == "ERROR") {
IniWrite, 0, %SettingsPath%, User, SaveEnchant
sleep, 250
IniRead, SaveEnchant, %SettingsPath%, User, SaveEnchant
}

tooltip, Loading Enchantress [Enchant List]

tooltip, Loading Enchantress [Personal Lists]
Expand Down Expand Up @@ -329,6 +338,7 @@ Settings:
offset := addOption("User", "HeistRemappingTxt", offset, "Heist Text Remapping File")
offset := addOption("User", "EnchantRemappingTxt", offset, "Enchant Text Remapping File")
offset := addOption("User", "SnapshotScreen", offset, "Save a snapshot when OCRing screen")
offset := addOption("User", "SaveEnchant", offset, "Save Text Capture of Enchants")
Gui, font

Gui, font, s14
Expand Down Expand Up @@ -358,6 +368,7 @@ SaveSettings:
saveOption("User", "HeistRemappingTxt", offset, "Heist Text Remapping File")
saveOption("User", "EnchantRemappingTxt", offset, "Enchant Text Remapping File")
saveOption("User", "SnapshotScreen", offset, "Save a snapshot when OCRing screen")
saveOption("User", "SaveEnchant", offset, "Save Text Capture of Enchants")
saveOption("Other", "scale", offset, "Monitor Scale")
saveOption("Other", "monitor", offset, "Select Monitor")
Gui, Settings:Destroy
Expand Down Expand Up @@ -409,9 +420,12 @@ grabScreen(whitelist) {
return false
}

FileRead, CaptureString, %tempPath%
global RawCaptureTime
global RawTextCapture
FileRead, RawTextCapture, %tempPath%
FormatTime, RawCaptureTime,, yyyy_MM_dd_HH_mm_ss

GuiControl,, CaptureS, %CaptureString%
GuiControl,, CaptureS, %RawTextCapture%
return true
}

Expand All @@ -424,6 +438,13 @@ cleanString(instring){

enchantSort() {
GuiControlGet, EnchantString,, CaptureS, value
IniRead, SaveEnchant, %SettingsPath%, User, SaveEnchant
if (SaveEnchant)
{
EnchantFileName := "enchant_" RawCaptureTime ".txt"
FileDelete, %EnchantFileName%
FileAppend, %EnchantString%, %EnchantFileName%
}
loop, 20
{
GuiControl,, enchant_%A_Index%,
Expand Down Expand Up @@ -539,8 +560,6 @@ checkFiles() {
return true
}



monitorInfo(num) {
SysGet, Mon2, monitor, %num%

Expand Down
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# PoE-Enchantress
The PoE-Enchantress tool help in pricing elements of Path of Exile (PoE) which you cannot simply copy to the clipboard. It uses an Optical Character Recognition (OCR) tool to convert selected portions of the screen to text. This text, either names of items or enchants, are looked up in user configurable files to price them.
The Poe-Enchantress tool help in pricing elements of Path of Exile (PoE) which you cannot simply copy to the clipboard. It uses an Optical Character Recognition (OCR) tool to convert selected portions of the screen to text. This text, either names of items or enchants, are looked up in user configurable files to price them.

You can find the latest release on the releases page <https://github.com/LawTotem/PoE-Enchantress/releases>.
The releases include an executable version of the autohotkey script and come in a more convenient zip file.
## Setup
You will need the tool <code>Capture2Text</code> to perform the ORC. This will need to be downloaded seperately and the folder <code>Capture2Text</code> should be moved into the folder with the PoE-Enchantress script.
You will need the tool <code>Capture2Text</code> to perform the ORC. This will need to be downloaded separately and the folder <code>Capture2Text</code> should be moved into the folder with the PoE-Enchantress script.

PoE-Enchantress does not use any external sites/tools to perform Heist item pricing.
To start you can copy the example <code>heists.txt</code> to the root folder for heist prices.
You will probably have to manually configure <code>general_enchants.txt</code> and <code>services.txt</code> because I'm no good at that stuff.
To pratice you can snapshot any text which has the name of the item/enchant to see what the tool will do or manually hand type it into the GUI's captured text box and press the desired Reprocess button.
To practice you can snapshot any text which has the name of the item/enchant to see what the tool will do or manually hand type it into the GUI's captured text box and press the desired Reprocess button.

# Features

Expand All @@ -21,9 +23,14 @@ To price enchants press the enchant hotkey, default Ctrl-y, and select a relativ


## OCR Remapping
Because the OCR can make mistakes in its CRing the tool by default always compares strings with no white space, so "h e l l o" and "hello" are the same, and no capitolization, "HeLlO" and "hello" are the same.
Because the OCR can make mistakes in its CRing the tool by default always compares strings with no white space, so "h e l l o" and "hello" are the same, and no capitalization, "HeLlO" and "hello" are the same.

In addition two remapping files <code>HeistRemappingTxt</code> and <code>EnchantRemappingTxt</code> are provided. They have been generate to provide short strings which should be mostly unique to actual things that you are looking for. When these files are provided the associated scanned text will be searched for the short strings and replaced with the complete ones. This can result in the order of enchants being shuffled or lost and some heist gems being duplicated, Anomalous Withering Step going to Anomalous Wither and Anomalous Withering Step __BUT__ the anything that survives will be exactly correct. If something is missing you can manually type in the full text and click associated reprocesses buttons. If you hate this you can change the file name in settings to a non-existant file and the feature will not be used.
In addition, two remapping files <code>HeistRemappingTxt</code> and <code>EnchantRemappingTxt</code> are provided. They have been generated to provide short strings which should be mostly unique to actual things that you are looking for. When these files are provided the associated scanned text will be searched for the short strings and replaced with the complete ones. This can result in the order of enchants being shuffled or lost and some heist gems being duplicated, Anomalous Withering Step going to Anomalous Wither and Anomalous Withering Step __BUT__ the anything that survives will be exactly correct. If something is missing you can manually type in the full text and click associated reprocesses buttons. If you hate this you can change the file name in settings to a non-existant file and the feature will not be used.

There are a couple of gems whose names are a subset of another gem so the tool will always miss-map them.
- Arc (Arcmage, Arcane Surge, Arctic Armour, Arcane Cloak, Arcanist Brand)
- Barrage (Barrage Support)
- Wither (Withering Step)

# Settings

Expand Down Expand Up @@ -51,7 +58,11 @@ This file provides the string remapping for Heist, see the ORC remapping feature
This file provides the string remapping for Enchants, see the OCR remapping feature.

### SnapshotScreen
You'll have to compile the snapper.cpp file yourself into a dll and put that into the same folder as the script to use this but when enabled it will save a timestamped snapshot everytime you use the tool. Used in development to provide reference images.
You'll have to compile the snapper.cpp file yourself into a dll and put that into the same folder as the script to use this but when enabled it will save a time stamped snapshot every time you use the tool. Used in development to provide reference images.

### SaveEnchant
This option will save the scanned enchants to a date stamped text file if you want to keep statistics on what you have seen.
If anything goes wrong with the scan, missed enchant or something, you can type in the correct enchant and press the reprocess enchant and it will save the file again, overwriting the file until you perform another screen grab.

## Other
### scale
Expand All @@ -62,9 +73,16 @@ Untested but maybe allows for monitor selection.

# Change List

## 0.x.0
- Added an enchant scraper, still requires hand data analysis to create general_enchants.txt.
- Added league variables to tools.
- Corrected seperator in heist price scraper.
- Readme grammer/spelling.
- Added support for saving text version of enchant grabs.

## 0.2.0
- Added settings menu, available from main GUI
- Added more complete Heist prices
- Added example Lab services and base enchant files
- Update GUI
- Added OCR string fixing
- Added settings menu, available from main GUI
- Added more complete Heist prices
- Added example Lab services and base enchant files
- Update GUI
- Added OCR string fixing
Loading

0 comments on commit a56e84c

Please sign in to comment.