remove unused code

This commit is contained in:
David Daily 2021-10-05 09:26:28 -05:00
parent f19018ff70
commit 7d0838567e

60
D3K.ahk
View File

@ -101,27 +101,6 @@ If (glovar = 1)
FileGetTime, gvMod, %glovarini% 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". If InStr(REKey, "case") ; If a key contains "case". Case numbers are all in the format "LETTERS-NUMBERS".
{ {
StringUpper, REValue, REValue ; Makes it uppercase StringUpper, REValue, REValue ; Makes it uppercase
@ -148,46 +127,13 @@ If (glovar = 1)
If (RESection) ; If we have a section If (RESection) ; If we have a section
{ {
StoredSection := RESection 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 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 FileRead, initemp, %glovarini% ; Read the ini
initemp := RegExReplace(initemp, "(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info 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" CurrTime := GetDateTime("en") ; get the current date and time as "YYYY-MM-DD at HH:MM GMT"
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
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
}
FileAppend, % "`n`n" writethis "`n`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", %A_MyDocuments%/D3KLog.txt ; Write a few new lines , the content, and a line underneath FileAppend, % "`n`n" writethis "`n`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", %A_MyDocuments%/D3KLog.txt ; Write a few new lines , the content, and a line underneath
FileAppend,, temptemp FileAppend,, temptemp
FileCopy, glovarsource, %glovarini%, 1 ; Copies and replaces any text in glovar.ini with the template 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 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 FileDelete, glovar.ahk ; THE CLEAN SLATE
FileAppend, %glovarstart%, glovar.ahk FileAppend, %glovarstart%, glovar.ahk
Sleep, 500 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 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") If FileExist("glovar.ahk")
{ {
Run glovar.ahk Run glovar.ahk
} }
GuestAdmin := False
Return Return
} }
} }