From 3f751fcbf1a9948681eb3ace3d0a0da69b9c4ce7 Mon Sep 17 00:00:00 2001 From: David Daily Date: Wed, 8 Jan 2020 09:07:42 -0600 Subject: [PATCH] Trying to fix bad behaviour it keeps the previous data from the xID lookup in the created glovar.ahk instead of the new information. --- D3K.ahk | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/D3K.ahk b/D3K.ahk index a49d8a5..5c71b09 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -70,7 +70,7 @@ If (glovar = 1) SetTimer, GloVar, 2000 ; Check every 2 seconds -GloVar: + GloVar: WinWaitNotActive, GloVar.ini ; So that we don't get any problems with the file on disk being out of date. I use VSCode with the "Save on lose focus" option on, YMMV { FileGetTime, gvModNew, %glovarini% @@ -81,7 +81,6 @@ GloVar: FileAppend, #SingleInstance force`n`n, glovar.ahk ; makes sure we only have one instance of the script running at a time RESection := "" ; Make sure that its clear - Loop, Read, %glovarini% ; Read one line at a time { RegExMatch(A_LoopReadLine, "(?<=\[).*(?=\])", RESection) ; explained above @@ -134,21 +133,21 @@ GloVar: } } } - writethis := ":*:$" REKey "::" REValue "`n" ; Save the hotstring to a variable - FileAppend, %writethis%, glovar.ahk ; Write the variable to glovar.ahk If InStr(REKey, "xid") ; If an xID is entered. Unique identifier for people { dealinfo := GetInfo(REValue) ; Gets information, see function for details StringUpper, REValue, REValue ; Makes xID uppercase WinWaitNotActive, GloVar.ini { - ini_writeValue(glovarini, "dem", dealinfo.email) ; Writes email address (incredibly useful) - ini_writeValue(glovarini, "dnm", dealinfo.name) ; Writes Name (useful for when referring to that person) - ini_writeValue(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful) ini_writeValue(glovarini, "xID", REValue) ; Writes the xID entered, but uppercase + ini_writeValue(glovarini, "dem", dealinfo.email) ; Writes email address (incredibly useful) + ini_writeValue(glovarini, "dnm", dealinfo.name) ; Writes Name (useful for when referring to that person) + ini_writeValue(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful) } FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code } + writethis := ":*:$" REKey "::" REValue "`n" ; Save the hotstring to a variable + FileAppend, %writethis%, glovar.ahk ; Write the variable to glovar.ahk } If (RESection) ; If we have a section { @@ -171,7 +170,7 @@ GloVar: { Run glovar.ahk } - Goto, GloVar + Break } } }