Last active
April 3, 2021 20:05
-
-
Save fnx4/fa0cbb79a495c6894a402417c078befe to your computer and use it in GitHub Desktop.
Revisions
-
fnx4 revised this gist
Apr 3, 2021 . 6 changed files with 50 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ /_prmt.lnk /_absr.lnk LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed.LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed.LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,54 @@ Run("new") Run(mode) { if (mode == "new") { Hotkey, !PrintScreen, Search Hotkey, !Insert, Translate } else if (mode == "leagcy") { ;CoordMode Mouse, Screen tgtMonitor = 2 LegacyTranslate("p3.png", tgtMonitor) } } Search() { if (WinExist("ahk_exe ScreenshotReader.exe")) { ControlClick, x237 y31, ahk_exe ScreenshotReader.exe } else { MsgBox ScreenshotReader.exe not found } } Translate() { if (WinExist("ahk_exe prmt.exe")) { WinActivate ControlClick, x16 y190, ahk_exe prmt.exe,,,3 Sleep 300 Send ^a Sleep 250 Send {Delete} Sleep 250 Clipboard = %Clipboard% ;Send Clipboard Send ^v Sleep 100 ControlClick, x249 y64, ahk_exe prmt.exe } else { MsgBox prmt.exe not found } } LegacyTranslate(srcImg, tgtMonitor) { SysGet, Mon, Monitor, %tgtMonitor% ImageSearch, xi, yi, %MonLeft%, %MonTop%, %MonRight%, %MonBottom%, %A_WorkingDir%\%srcImg% if (ErrorLevel = 2) { MsgBox Exception } else if (ErrorLevel = 1) { if (srcImg == "p3.png") { LegacyTranslate("p2.png", tgtMonitor) } else if (srcImg == "p2.png") { LegacyTranslate("p1.png", tgtMonitor) } else if (srcImg == "p1.png") { MsgBox Not found } @@ -22,4 +57,5 @@ Search(srcImg, tgtMonitor) { Click %xi%, %yi%, 0 } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ @echo off start _prmt.lnk start _absr.lnk start prmt.ahk exit -
fnx4 created this gist
Apr 3, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ ;CoordMode Mouse, Screen tgtMonitor = 2 Search("p3.png", tgtMonitor) Search(srcImg, tgtMonitor) { SysGet, Mon, Monitor, %tgtMonitor% ImageSearch, xi, yi, %MonLeft%, %MonTop%, %MonRight%, %MonBottom%, %A_WorkingDir%\%srcImg% if (ErrorLevel = 2) { MsgBox Could not conduct the search } else if (ErrorLevel = 1) { if (srcImg == "p3.png") { Search("p2.png", tgtMonitor) } else if (srcImg == "p2.png") { Search("p1.png", tgtMonitor) } else if (srcImg == "p1.png") { MsgBox Not found } } else { ;MsgBox Icon %srcImg%: %xi%x%yi% Click %xi%, %yi%, 0 } }