Skip to content

Commit

Permalink
Merge pull request #36 from sushibagel/Development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
sushibagel committed Aug 10, 2023
2 parents 6336245 + 1687810 commit 95686d7
Show file tree
Hide file tree
Showing 17 changed files with 574 additions and 60 deletions.
14 changes: 12 additions & 2 deletions PoE Mechanic Watch.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ DetectHiddenWindows, On

OnMessage(0x01111, "RefreshOverlay")
OnMessage(0x012222, "OverlayKill")
OnMessage(0x012229, "MasterOverlayKill")
OnMessage(0x01786, "Start")
OnMessage(0x01741, "HotkeyCheck") ;check hotkeys
OnMessage(0x01783, "LaunchUpdate") ;timed update on PoE launch
OnMessage(0x01789, "Reload") ;timed update on PoE launch
OnMessage(0x204, "WM_RBUTTONDOWN")
OnMessage(0x01775, "MapDevice") ;Launch Map Device Search

;;;;;;;;;;;;;; Tray Menu ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Expand All @@ -40,8 +42,9 @@ MenuDark(isDark)
; 0=Default 1=AllowDark 2=ForceDark 3=ForceLight 4=Max
Menu, Tray, NoStandard
Menu, Tray, Add, Select Mechanics, SelectMechanics
Menu, Tray, Add, Select Auto Enable/Disable (Beta), SelectAuto
Menu, Tray, Add, Select Auto Enable/Disable, SelectAuto
Menu, Tray, Add, View Maven Invitation Status, ViewMaven
Menu, Tray, Add, Master Mapping Settings, MasterSetup
Menu, Tray, Add
Menu, Tray, Add, Launch Path of Exile, LaunchPoe
Menu, Tray, Add, View Path of Exile Log, ViewLog
Expand Down Expand Up @@ -663,7 +666,7 @@ AdditionalScripts(Action)
HotkeyCheck()
{
HotkeyPath := HotkeyIni()
Loop, 16
Loop, 17
{
IniRead, Hotkey%A_Index%, %HotkeyPath%, Hotkeys, %A_Index%

Expand Down Expand Up @@ -757,6 +760,12 @@ HotkeyCheck()
Hotkey, IfWinActive, ahk_group PoeWindow
Hotkey, %Hotkey16%, Generic, T5
}

If !(Hotkey17 = "") and !(Hotkey17 = "ERROR")
{
Hotkey, IfWinActive, ahk_group PoeWindow
Hotkey, %Hotkey17%, ToggleMasters, T5
}
}
}

Expand All @@ -779,6 +788,7 @@ TransparencyCheck(NotificationTransparency)
#Include, Resources\Scripts\iniChoose.ahk
#Include, Resources\Scripts\Influences.ahk
#Include, Resources\Scripts\LaunchOptions.ahk
#Include, Resources\Scripts\Masters.ahk
#Include, Resources\Scripts\Maven.ahk
#Include, Resources\Scripts\MavenReminder.ahk
#Include, Resources\Scripts\Mechanics.ahk
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This program is a AutoHotKey Script. AutoHotKey can be downloaded for free here:

The purpose of this program is for use with Path Of Exile to assist in tracking and reminding the user of completing in game mechanics.

This program works by setting an overlay in Path of Exile, when one of the overlay icons are pressed the script then begins continuously reading your Client.txt log file looking for a line stating that you have entered your hideout. Once the text is found in your log file a notification is triggered reminding you to complete the mechanic that you have turned on monitoring for, Clicking "Yes!" will close the notificaiton and begin reading your logs again, clicking "No" will turn off the reminder script resetting the overlay. Clicking the overlay icon a second time will also turn the reminder script off and reset the overlay.
This program works by setting an overlay in Path of Exile, when one of the overlay icons are pressed (or triggered) the script then begins continuously reading your Client.txt log file looking for a line stating that you have entered your hideout. Once the text is found in your log file a notification is triggered reminding you to complete the mechanic that you have turned on monitoring for, Clicking "Yes!" will close the notificaiton and begin reading your logs again, clicking "No" will turn off the reminder script resetting the overlay. Clicking the overlay icon a second time will also turn the reminder script off and reset the overlay.

#### The following game mechanics are currently supported:
- Abyss
Expand All @@ -18,7 +18,8 @@ This program works by setting an overlay in Path of Exile, when one of the overl
- Metamorph
- Ritual
- Searing Exarch/Eater of Worlds/Maven (Map Count Tracking)
- A "Generic" option is also available for those who desire a simplier interface or for use with other (future) league mechanics.
- A "Generic" option is also available for those who desire a simplier interface or for use with other (future) league mechanics.
- Mapping - Reminder to select a Master Mission.

#### Auto Mechanic Tracking:
Auto Mechanic Tracking is available for Blight, Expedition, Incursion, Metamorph, Ritual and the Eldritch bosses (Eater of Worlds, Searing Exarch and Maven).
Expand All @@ -39,6 +40,10 @@ Maven Invitation Tracking for map bosses is done automatically. Maps will only b
I have not tested Maven tracking extensively so there may be bugs. When I began this project I was excited to see the how Maven farming would feel with the new changes to Awakened Gem drops. Unforunately, (in my opinion) Maven still just doesn't feel very rewarding to farm so this resulted in minimal testing. This does not mean I refuse to work on it so please report any issues you notice.

##### Other Features:
## Master Mapping:
- Sets an overlay and reminder to track if you've selected a master mission.

## Launch tools:
- Setup tools/applications that will launch alongside Path of Exile

## Installation:
Expand Down Expand Up @@ -111,7 +116,7 @@ All "Counters" (Eater, Searing, Maven, Incursion) can be incremented by clicking

- If clicking the "View Log" button isn't taking you to the correct path, this is likely because you opened the script prior to having your client open. Once your client is open click the "Reload" button and it should work as expected.

- The Auto Enable/Disable feature is currently in Beta. For it to work for Blight, Expedition and Incursion it requires the "Output Dialogue To Chat" setting to be turned on in the "UI" section of the settings in game. I've tried to be as thorough as possible in adding dialogs but I may have missed some as there is some variance in the.
- Blight, Expedition or Incursion mechanics aren't automatically enabling/disabling. These mechanics all require the "Output Dialogue To Chat" setting to be turned on in the "UI" section of the settings in game. Please note there are some situations where certain dialogs aren't issued and it may result in a failure to enable/disable tracking. If you happen to find any dialogs that do not work as triggers please post a bug report on my Github.

- If Auto tracking isn't working for Metamorph, Ritual or the Eldritch bosses (Eater of Worlds, Searing Exarch and Maven) you may meed to calibrate the image recognition using the "Calibrate Search" tool found in the Auto Enable/Disable menu.

Expand All @@ -121,7 +126,7 @@ All "Counters" (Eater, Searing, Maven, Incursion) can be incremented by clicking
When using the "Update" tool press "Enter" or select "OK" when you notified of an update. "PoE Mechanic Watch Update.zip" will download to your PoE Mechanic Watch folder, simply unzip and copy all the files from the new release folder into your existing directy. Doing this should keep all user settings.

#### Hideout Notes:
The first time your run this script you will be required to set your hideout in the first run "Setup" menu. If at any time you switch your hideout you can change it by using the "Set Hideout" tool in the "Setup" submenu of the tray icon menu. Use the search box to find the hideout type you use, double clicking the name of your hideout or typing in the full hideout name and pressing enter will set your hideout. Note: If you hideout is not listed you can type in your hideout and press enter. However, any typos can result in the script not working as expected.
The first time your run this script you will be required to set your hideout in the first run "Setup" menu. If at any time you switch your hideout you can change it by using the "Set Hideout" tool in the "Setup" submenu of the tray icon menu. Use the search box to find the hideout type you use, double clicking the name of your hideout or typing in the full hideout name and pressing enter will set your hideout. Note: If you hideout is not listed you can type in your hideout and press enter. However, any typos can result in the script not working as expected. Please also feel free to let me know your hideout type is missing by posting feedback on my Github.

For feedback, questions or suggestions please visit the <a href="https://github.com/sushibagel/PoE-Mechanic-Watch/discussions" title="Discussion Section">Discussion Section of the Github</a>

Expand Down
10 changes: 8 additions & 2 deletions Resources/Data/HideoutList.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
All at Sea
Alpine
Arboreal
Atlas
Azurite Cavern
Backstreet
Baleful
Expand All @@ -25,6 +26,7 @@ Entombed
Eternal Wasteland
Excavated
Furious
Ghost-lit Graveyard
Glacial
Glacial Expanse
Glimmerwood
Expand All @@ -41,18 +43,22 @@ Overgrown
Polaric
Primeval
Ravenous
Redeemer's
Ritualist's
Robber's Trench
Sanquine
Seething
Shaped
Skeletal
Stately
Sunken
Sunspire
Tavern
Thaumaturgical
Timekeeper's
Towering
Undercity
Unearthed
Urban Sprawl
Void
Vast Plains
Vast Plains
Void
2 changes: 1 addition & 1 deletion Resources/Data/Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.6
v2.7
Binary file added Resources/Images/Image Search/MapDevice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Images/harvest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/Images/harvest_selected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 84 additions & 12 deletions Resources/Scripts/AutoMechanic.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Global MavenVar
Global SampleEater
Global SampleSearing
Global SampleMaven
Global SampleMapDevice
Global Completion

GroupAdd, PoeScreen, ahk_exe PathOfExileSteam.exe
GroupAdd, PoeScreen, ahk_exe PathOfExile.exe
Expand Down Expand Up @@ -215,11 +217,23 @@ AutoButtonCalibrateSearch()
Gui, Calibrate:Add, UpDown, Range%ERange%, %Value% x270 h20
XBut := Round(96/A_ScreenDPI*425)
Gui, Calibrate:Add, Button, ys x%XBut% w80 gButton%boss%, Calibrate
Gui, Calibrate:Font, c1177bb Normal Underline
Gui, Calibrate:Font, c1177bb Normal Underline s12
XSample := Round(96/A_ScreenDPI*570)
Gui, Calibrate:Add, Text, ys x+10 w80 HwndSample%boss% g%boss%Image, Sample
Gui, Calibrate:Font, c%Font% Normal
Gui, Calibrate:Font, c%Font% Normal s12
}
Gui, Calibrate:Add, Text, Section xs, Map Device
Gui, Calibrate:Font, s8 c1177bb Normal Underline
Gui, Calibrate:Add, Text, x+.5 yp HwndFootnote%A_Index% gOpenFootnote, 3
XBut := Round(96/A_ScreenDPI*425)
Gui, Calibrate:Font, Normal
Gui, Calibrate:Font, c%Font% s12
Gui, Calibrate:Add, Button, ys x%XBut% w80 gMapDeviceButton, Calibrate
XSample := Round(96/A_ScreenDPI*570)
Gui, Calibrate:Font, c1177bb Normal Underline s12
Gui, Calibrate:Add, Text, ys x+10 w80 HwndSampleMapDevice gMapDeviceImage, Sample
Gui, Calibrate:Font, c%Font% Normal

Gui, Calibrate:Add, Text, Section,
Gui, Calibrate:Show, , Calibration Tool
OnMessage(0x0200, "MouseMove")
Expand All @@ -228,6 +242,8 @@ AutoButtonCalibrateSearch()

CalibrateGuiClose:
{
Gui, FootnoteView:Destroy
Gui, ImageView:Destroy
Gui, Calibrate:Destroy
If (AutoRun = 1)
{
Expand Down Expand Up @@ -374,6 +390,15 @@ MouseMove(wParam, lParam, Msg, Hwnd) {
ShowImage("Eldritch/maven" mavenVar, ImageH, ImageW)
LastHwnd := mHwnd
}
If Instr(mHwnd, MapDevice) and (mHwnd != LastHwnd)
{
ImageH := 80
ImageW := 250
Gui, Calibrate:Submit, Nohide
ShowImage("MapDevice", ImageH, ImageW)
LastHwnd := mHwnd
}

}
If !InStr(A_GuiControl, "Sample") and (SamplePressed != 1)
{
Expand Down Expand Up @@ -508,6 +533,15 @@ OpenImage()
ShowImage("RitualShop", ImageH, ImageW, "+Caption")
LastHwnd := mHwnd
}
If Instr(mHwnd, "MapDevice")
{
SamplePressed := 1
ImageH := 100
ImageW := 250
msgbox, %ImagH% %ImageW%
ShowImage("MapDevice", ImageH, ImageW, "+Caption")
LastHwnd := mHwnd
}
}

ImageViewGuiClose()
Expand Down Expand Up @@ -579,23 +613,24 @@ Button10()

ScreenShotTool(path)
{
gdipCalibrate := Gdip_Startup()
Gui, Calibrate:Minimize
Completion := ""
Run, SnippingTool
SetTitleMatchMode, 2
WinWaitActive, Snipping Tool
WinWaitClose, Snipping Tool
WinGetActiveTitle, CWindow
snToken := Gdip_Startup()
ClipWait, , 1
pBitmap := Gdip_CreateBitmapFromClipboard()
Gdip_SaveBitmapToFile(pBitmap, path)
WinActivate, %CWindow%
WinWaitActive, %CWindow%
WinActivate, Path of Exile
WinWaitActive, Path of Exile
PoeHwnd := WinExist(CWindow)
Gui, CalibrationNotice:Destroy
Gui, CalibrationNotice:Color, %Background%
Gui, CalibrationNotice:Font, c%Font% s10
Gui, CalibrationNotice:Add, Text,,Performing calibration, please wait...
Gui, CalibrationNotice:Add, Text,,Performing calibration, please wait...
Gui, CalibrationNotice:Add, Text, w200 Center vCompletion, %Completion%
Gui, CalibrationNotice: +AlwaysOnTop -Border
Gui, CalibrationNotice:Show, NoActivate, Calibration Notify
MapTransparency := TransparencyCheck("Quick")
Expand All @@ -606,9 +641,12 @@ ScreenShotTool(path)
Global bmpNeedle := Gdip_CreateBitmapFromFile(path)
Loop, 201
{
If (Gdip_ImageSearch(bmpHaystack,bmpNeedle,LIST,0,0,0,0,A_Index,0xFFFFFF,1,0) > 0)
Completion := Round(A_Index/201*100) "%"
GuiControl, CalibrationNotice:, Completion, %Completion%
If (Gdip_ImageSearch(bmpHaystack,bmpNeedle,LIST,0,0,0,0,A_Index,,1,0) > 0)
{
Global VariationAmt := A_Index + 10 ; Find matchpoint and add 10 for safety.
; msgbox, Success! Your new calibration value is %A_Index%
Break
}
Else
Expand All @@ -633,7 +671,7 @@ ScreenShotTool(path)
Gdip_DisposeImage(bmpHaystack)
Gdip_DisposeImage(bmpNeedle)
Gdip_DisposeImage(pBitmap)
Gdip_Shutdown(rnToken)
Gdip_Shutdown(gdipCalibrate)
DeleteObject(pBitmap)
DeleteObject(bmpHaystack)
DeleteObject(bmpNeedle)
Expand Down Expand Up @@ -664,6 +702,7 @@ OpenFootnote()
If InStr(A_GuiControl, "3")
{
NoteSelected := 3
SamplePressed := 1
ViewFootnote(3)
}
}
Expand Down Expand Up @@ -712,9 +751,22 @@ ViewFootnote(FootnoteNum)
}
If (FootnoteNum = 3)
{
GuiControl, Auto:, Text, 3: Eldritch refers to Maven, Eater of Worlds and Searing Exarch. The tool will automatically check for whichever is active when the map device is,used in your hideout (make sure to keep your hideout updated using the "Set Hideout" tool) You may also need to calibrate the Search Tool by clicking the "Calibrate Search" button when you have it active in game.
Gui, Auto:Font, c%Font% s10
GuiControl, Font, Text
If WinActive("Calibration Tool")
{
CustomText := "The Map Device is used for identifying when the map device is open to activate the Master Mapping tool. To calibrate select the ""Map Receptacle"" text and the surrounding box, it`'s important not to select any of the Kirac mods below or your hideout in the background as this may cause issues with screen recognition."
Caption := "-Caption"
If (SamplePressed = 1)
{
Caption := "+Caption"
}
ShowImage("", 0, 0, Caption, CustomText,0)
}
Else
{
GuiControl, Auto:, Text, 3: Eldritch refers to Maven, Eater of Worlds and Searing Exarch. The tool will automatically check for whichever is active when the map device is,used in your hideout (make sure to keep your hideout updated using the "Set Hideout" tool) You may also need to calibrate the Search Tool by clicking the "Calibrate Search" button when you have it active in game.
Gui, Auto:Font, c%Font% s10
GuiControl, Font, Text
}
}
}

Expand Down Expand Up @@ -770,4 +822,24 @@ MavenImage()
ImageW := 130
ShowImage("Eldritch\maven5", ImageH, ImageW, "+Caption")
LastHwnd := mHwnd
}

MapDeviceImage()
{
MouseGetPos,,,, mHwnd,
Gui, ImageView:Destroy
SamplePressed := 1
ImageH := 130
ImageW := 250
ShowImage("MapDevice", ImageH, ImageW, "+Caption")
LastHwnd := mHwnd
Return
}

MapDeviceButton()
{
Gui, Calibrate:Submit, Nohide
FileName := "Resources\Images\Image Search\MapDevice.png"
ScreenShotTool(FileName)
Return
}
2 changes: 1 addition & 1 deletion Resources/Scripts/Influences.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ InfluenceMapNotification() ;Map tracking notification
PostMessage, 0x01741,,,, PoE Mechanic Watch.ahk - AutoHotkey ;Hotkey check
PostRestore()
InfluenceHotkey := InfluenceHotkey()
Notification := "You just entered a new map press" A_Space InfluenceHotkey A_Space "to subtract 1 map"
Notification := "You just entered a new map press" A_Space """" InfluenceHotkey """" A_Space "to subtract 1 map"
QuickNotify(Notification)
Return
}
Expand Down
Loading

0 comments on commit 95686d7

Please sign in to comment.