diff --git a/D3K.ahk b/D3K.ahk index 098ec86..0ba7cc6 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -101,27 +101,6 @@ If (glovar = 1) FileGetTime, gvMod, %glovarini% } } - If InStr(StoredSection, "Operations Center") ; If the section is "Operations Center" and the Key "un", make it uppercase - { - If InStr(REKey, "usr") - { - StringUpper, REValue, REValue ; Makes it uppercase - WinWaitNotActive, GloVar.ini - { - ini_write(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini - FileGetTime, gvMod, %glovarini% - } - } - } - If InStr(StoredSection, "GuestAdmin") ; If the section is "GuestAdmin", make everything uppercase - { - StringUpper, REValue, REValue ; Makes it uppercase - WinWaitNotActive, GloVar.ini ; Just to make sure - { - ini_write(glovarini, REKey, REValue) - FileGetTime, gvMod, %glovarini% - } - } If InStr(REKey, "case") ; If a key contains "case". Case numbers are all in the format "LETTERS-NUMBERS". { StringUpper, REValue, REValue ; Makes it uppercase @@ -148,46 +127,13 @@ If (glovar = 1) If (RESection) ; If we have a section { StoredSection := RESection - If InStr(RESection, "GuestAdmin") ; For giving other people access to orgs - { - If !(GuestAdmin) - { - FileRead, initemp, %glovarini% ; Read the ini - initemp := "[GuestAdmin]`nid=`nusr=`norg=`n[Info]`ncase=" - FileAppend, %initemp%, temptemp - FileCopy, temptemp, %glovarini%, 1 - FileDelete, temptemp - FileRead, gvMod, %glovarini% - FileDelete, glovar.ahk ; THE CLEAN SLATE - FileAppend, %glovarstart%, glovar.ahk - - Sleep, 500 - 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 - If FileExist("glovar.ahk") - { - Run glovar.ahk - } - } - GuestAdmin := True - } - If InStr(RESection, "clear") ; Will clear the ini and save its and the documentation file's contents to a log { - If !(GuestAdmin) - { - FileRead, doctemp, %docfile% ; Read documentation file, set in settings - } + FileRead, doctemp, %docfile% ; Read documentation file, set in settings FileRead, initemp, %glovarini% ; Read the ini initemp := RegExReplace(initemp, "(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info CurrTime := GetDateTime("en") ; get the current date and time as "YYYY-MM-DD at HH:MM GMT" - - If !(GuestAdmin) - { - writethis := "Case on " . CurrTime . "`n`n`n" . doctemp . "`n`n" . initemp ; Save the current time, what was in the doc file, and glovarini to a variable - } else { - writethis := "Case on " . CurrTime . "`n`n" . initemp ; Save the current time and glovarini to a variable if it was just giving access to an org - } - + writethis := "Case on " . CurrTime . "`n`n`n" . doctemp . "`n`n" . initemp ; Save the current time, what was in the doc file, and glovarini to a variable FileAppend, % "`n`n" writethis "`n`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", %A_MyDocuments%/D3KLog.txt ; Write a few new lines , the content, and a line underneath FileAppend,, temptemp FileCopy, glovarsource, %glovarini%, 1 ; Copies and replaces any text in glovar.ini with the template @@ -196,14 +142,12 @@ If (glovar = 1) fileread, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code FileDelete, glovar.ahk ; THE CLEAN SLATE FileAppend, %glovarstart%, glovar.ahk - Sleep, 500 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 If FileExist("glovar.ahk") { Run glovar.ahk } - GuestAdmin := False Return } }