diff --git a/.gitignore b/.gitignore index beb9a9e..d626125 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ AHK-Studio Backup/ +config/secure/main_secure.ini diff --git a/Launcher.ahk b/Launcher.ahk index 68e5d5d..441dd84 100644 --- a/Launcher.ahk +++ b/Launcher.ahk @@ -12,6 +12,8 @@ SetBatchLines, -1 SetTitleMatchMode, 2 SetKeyDelay, 50 +IniRead, EPSPin, config\secure\main_secure.ini, EPS, Pin + #Include libraries\helper_library.ahk ;; nhs_number functions @@ -23,6 +25,7 @@ SetKeyDelay, 50 #Include includes\QuickSearch.ahk ;; Quicksearch / shortcut tools #Include includes\PrintHomeVisitsImageSearch.ahk #Include includes\EPS.ahk +#Include includes\SignAcuteIssue.ahk ; Reload Script after changes (Ctrl + F1) ^F1:: diff --git a/assets/eps/eps_pin.png b/assets/eps/eps_pin.png new file mode 100644 index 0000000..8c4ce81 Binary files /dev/null and b/assets/eps/eps_pin.png differ diff --git a/assets/eps/eps_tick_box.png b/assets/eps/eps_tick_box.png new file mode 100644 index 0000000..eead8b4 Binary files /dev/null and b/assets/eps/eps_tick_box.png differ diff --git a/includes/PrintHomeVisitsImageSearch.ahk b/includes/PrintHomeVisitsImageSearch.ahk index fe2ded3..a52d771 100644 --- a/includes/PrintHomeVisitsImageSearch.ahk +++ b/includes/PrintHomeVisitsImageSearch.ahk @@ -16,7 +16,6 @@ SetBatchLines -1 ; UserGlobalVars -F18:: PrintHomeVisits: Loop, 10 { @@ -32,6 +31,8 @@ If (ErrorLevel) MsgBox, 0, , Couldn't find the home visit icon Return } + + FoundX := FoundX + 43 Click, %FoundX%, %FoundY% Left, 2 Sleep, 10 @@ -41,7 +42,7 @@ Loop, 20 CoordMode, Pixel, Screen CoordMode, Mouse, Screen ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, assets\homevisits\home_visit_wrench.png - CenterImgSrchCoords("assets\homevisits\home_visit_wrench.png", FoundX, FoundY + CenterImgSrchCoords("assets\homevisits\home_visit_wrench.png", FoundX, FoundY) Sleep, 100 } Until ErrorLevel = 0 diff --git a/includes/SignAcuteIssue.ahk b/includes/SignAcuteIssue.ahk new file mode 100644 index 0000000..f2f45a2 --- /dev/null +++ b/includes/SignAcuteIssue.ahk @@ -0,0 +1,58 @@ +; This script was created using Pulover's Macro Creator +; www.macrocreator.com + +#NoEnv +SetWorkingDir %A_ScriptDir% +CoordMode, Mouse, Screen +SendMode Input +#SingleInstance Force +SetTitleMatchMode 2 +#WinActivateForce +SetControlDelay 1 +SetWinDelay 0 +SetKeyDelay -1 +SetMouseDelay -1 +SetBatchLines -1 + + +F23:: +Macro1: +Send, !p +Send, !o +Sleep, 400 +Loop, 5 +{ + CoordMode, Pixel, Screen + ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440,assets\eps\eps_tick_box.png + CenterImgSrchCoords("assets\eps\eps_tick_box.png", FoundX, FoundY) + If ErrorLevel + Break + Sleep, 50 + If (ErrorLevel = 0) + { + CoordMode, Mouse, Screen + Click, %FoundX%, %FoundY% Left, 1 + Sleep, 10 + } +} +Until, ErrorLevel != 0 +CoordMode, Pixel, Screen +ImageSearch, FoundX, FoundY, 0, 0, 2560, 1440, assets\eps\eps_pin.png +CenterImgSrchCoords("assets\eps\eps_pin.png", FoundX, FoundY) +If ErrorLevel +{ + MsgBox, 49, Continue?, Image / Pixel Not Found.`nPress OK to continue. + IfMsgBox, Cancel + Return +} +If (ErrorLevel = 0) +{ + CoordMode, Mouse, Screen + Click, %FoundX%, %FoundY% Left, 1 + Sleep, 10 + SendRaw, %EPSPin% +} +/* +Send, !p +*/ +Return \ No newline at end of file