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:
parent
0bb3681dc5
commit
3f751fcbf1
15
D3K.ahk
15
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user