Trying to fix bad behaviour

it keeps the previous data from the xID lookup in the created glovar.ahk instead of the new information.
This commit is contained in:
David Daily 2020-01-08 09:07:42 -06:00
parent 0bb3681dc5
commit 3f751fcbf1

15
D3K.ahk
View File

@ -70,7 +70,7 @@ If (glovar = 1)
SetTimer, GloVar, 2000 ; Check every 2 seconds 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 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% 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 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 RESection := "" ; Make sure that its clear
Loop, Read, %glovarini% ; Read one line at a time Loop, Read, %glovarini% ; Read one line at a time
{ {
RegExMatch(A_LoopReadLine, "(?<=\[).*(?=\])", RESection) ; explained above 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 If InStr(REKey, "xid") ; If an xID is entered. Unique identifier for people
{ {
dealinfo := GetInfo(REValue) ; Gets information, see function for details dealinfo := GetInfo(REValue) ; Gets information, see function for details
StringUpper, REValue, REValue ; Makes xID uppercase StringUpper, REValue, REValue ; Makes xID uppercase
WinWaitNotActive, GloVar.ini 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, "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 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 If (RESection) ; If we have a section
{ {
@ -171,7 +170,7 @@ GloVar:
{ {
Run glovar.ahk Run glovar.ahk
} }
Goto, GloVar Break
} }
} }
} }