Compare commits
46
Commits
65b040054a
...
3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84f9a6b603 | ||
|
|
0cefd963b6 | ||
|
|
bbfbaf4034 | ||
|
|
a54571f6cd | ||
|
|
ec815b5314 | ||
|
|
5aa7108086 | ||
|
|
409f6b9b4c | ||
|
|
32a5b74f71 | ||
|
|
9fd247681a | ||
|
|
946e4b7be8 | ||
|
|
2129e733d1 | ||
|
|
c9ef223131 | ||
|
|
03f34dd75e | ||
|
|
a704be9088 | ||
|
|
31ab7b9c59 | ||
|
|
748e3ab321 | ||
|
|
9e8ed05b4e | ||
|
|
9b9405c7d1 | ||
|
|
0fb614940f | ||
|
|
de5e7b88e6 | ||
|
|
82ef19a67d | ||
|
|
97f2d2382b | ||
|
|
d02ef808f8 | ||
|
|
e10c04c253 | ||
|
|
d537a9bf7b | ||
|
|
5a4d36ff44 | ||
|
|
2eff8ca4ad | ||
|
|
ab12192837 | ||
|
|
e851dc5c3c | ||
|
|
d434dc3f1e | ||
|
|
5ba0c5a215 | ||
|
|
2a4cf2dbda | ||
|
|
0d596fd2d4 | ||
|
|
7d0838567e | ||
|
|
f19018ff70 | ||
|
|
83bd0d3e6c | ||
|
|
c7d3567790 | ||
|
|
b73be18a62 | ||
|
|
ab8f81db2c | ||
|
|
b4637072a2 | ||
|
|
9b7d00648e | ||
|
|
cc3863b0d2 | ||
|
|
dcb2e97426 | ||
|
|
9c1b4c85f4 | ||
|
|
4efd802be3 | ||
|
|
5bbbbad247 |
@@ -0,0 +1,6 @@
|
||||
*.code-workspace
|
||||
SmartGooey/*
|
||||
Projects/*
|
||||
emails.example.csv
|
||||
.gitignore
|
||||
.zip
|
||||
@@ -1,172 +0,0 @@
|
||||
#Include, func.ahk
|
||||
|
||||
SetTitleMatchMode, 2
|
||||
|
||||
; These next 3 options make it so that it's always on top, it there are no buttons, and doesn't show up in the alt-tab or taskbar
|
||||
Gui,+AlwaysOnTop
|
||||
Gui, +ToolWindow
|
||||
|
||||
docfile := ini_get(ini, "USpec", "DocFile")
|
||||
cfmail := ini_get(ini, "Main", "CFmail")
|
||||
Contact := 2
|
||||
|
||||
CurrTimeEN := GetDateTime("en")
|
||||
CurrTimeDE := GetDateTime("de")
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; GUI creation
|
||||
;------------------------------------------------------------------------------
|
||||
; The & in front of the letters lets you hold alt and press the first letter instead of having to click on it. That is why its "Mail", not "E-Mail"
|
||||
|
||||
Gui, Add, Radio, x12 y3 w60 h20 Group vLang Checked, &English ; First group of Radio buttons
|
||||
Gui, Add, Radio, x12 y23 w60 h20, &German
|
||||
|
||||
Gui, Add, Radio, x82 y3 w60 h20 Group vAct, &Warrant
|
||||
Gui, Add, Radio, x82 y23 w60 h20, &Demo
|
||||
|
||||
Gui, Add, Button, x12 y43 w55 h20 Default vHidden, Go ; That way you don't have to have an actual button, it just happens when you press enter.
|
||||
|
||||
if (cfmail)
|
||||
{
|
||||
Gui, Add, Radio, x142 y3 w80 h20 Group vContact Checked, E-&Mail ; Second group of Radio buttons
|
||||
Gui, Add, Radio, x142 y23 w80 h20 , &Call
|
||||
Gui, Add, Text, x75 y46 w150 h20 gTime, %CurrTimeEN%
|
||||
Gui, Show, h70 w210, Contact
|
||||
} Else {
|
||||
Gui, Show, h70 w145, Contact
|
||||
}
|
||||
|
||||
Return
|
||||
|
||||
Time:
|
||||
Run, addemail.ahk
|
||||
|
||||
GuiClose:
|
||||
GuiEscape:
|
||||
ExitApp
|
||||
;------------------------------------------------------------------------------
|
||||
; Buttons
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
|
||||
ButtonGo:
|
||||
Gui, submit
|
||||
Goto, Write
|
||||
Return
|
||||
|
||||
/*
|
||||
Contact
|
||||
Mail: 1
|
||||
Call: 2
|
||||
|
||||
Lang
|
||||
English: 1
|
||||
German: 2
|
||||
|
||||
Act
|
||||
Warrant: 1
|
||||
Demo: 2
|
||||
*/
|
||||
|
||||
Write:
|
||||
{
|
||||
FileRead, NewLine, %docfile% ; Read the documentation file
|
||||
If (NewLine != "") ; If there is something in the file, this would return a string
|
||||
{
|
||||
FileAppend,`n`n`n`n, %docfile% ; Inserts a new line so that it isn't just appended directly to the end
|
||||
}
|
||||
NewLine := "" ; Free up Memory cause this could be quite a bit of stuff
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Email
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
If (Contact = "1")
|
||||
{
|
||||
If (Lang = "1") ; English
|
||||
{
|
||||
If (Act = "0") ; Not an activation
|
||||
{
|
||||
FileAppend,Dealer emailed: "", %docfile%
|
||||
}
|
||||
|
||||
If (Act = "1") ; Warrant
|
||||
{
|
||||
FileAppend,Dealer emailed for warrant transfer: ""`n`nOld SN: `nNew SN: `nChallenge Code: `n`n, %docfile%
|
||||
}
|
||||
|
||||
If (Act = "2") ; Demo
|
||||
{
|
||||
FileAppend,Dealer emailed for `n`nSN: `nChallenge Code: `n`n, %docfile%
|
||||
}
|
||||
}
|
||||
|
||||
Else If (Lang = "2") ; German
|
||||
{
|
||||
If (Act = "0") ; Not an activation
|
||||
{
|
||||
FileAppend,Händler emailte: "", %docfile%
|
||||
}
|
||||
|
||||
Else If (Act = "1") ; Warrant
|
||||
{
|
||||
FileAppend,Händler emailte für Garantieübertragung`n`nAlte SN: `nNeue SN: `nAuthentisierungscode: `n`n, %docfile%
|
||||
}
|
||||
|
||||
Else If (Act = "2") ; Demo
|
||||
{
|
||||
FileAppend,Händler emailte für `n`nSN: `nAuthentisierungscode: `n`n, %docfile%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Call
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
Else If (Contact = "2")
|
||||
{
|
||||
If (Lang = "1") ; English
|
||||
{
|
||||
FileAppend, Call received %CurrTimeEN%.`n`n, %docfile%
|
||||
If (Act = "0") ; Not an activation
|
||||
{
|
||||
FileAppend,Dealer called for , %docfile%
|
||||
}
|
||||
|
||||
Else If (Act = "1") ; Warrant
|
||||
{
|
||||
FileAppend,Dealer called for Warrant transfer`nOld SN: `nNew SN: `nChallenge Code: `n`n, %docfile%
|
||||
}
|
||||
|
||||
Else If (Act = "2") ; Demo
|
||||
{
|
||||
FileAppend,Dealer called for Demo`nSN: `nChallenge Code: `n`n, %docfile%
|
||||
}
|
||||
}
|
||||
|
||||
Else If (Lang = "2") ; German
|
||||
{
|
||||
FileAppend, Anruf wurde %CurrTimeDE% entgegengenommen.`n`n, %docfile%
|
||||
|
||||
If (Act = "0") ; Not an activation
|
||||
{
|
||||
FileAppend,Händler rief an mit , %docfile%
|
||||
}
|
||||
|
||||
Else If (Act = "1") ; Warrant
|
||||
{
|
||||
FileAppend,Händler rief an für Garantieübertragung`nAlte SN: `nNeue SN: `nAuthentisierungscode: `n`n, %docfile%
|
||||
}
|
||||
|
||||
Else If (Act = "2") ; Demo
|
||||
{
|
||||
FileAppend,Händler rief an für Demo`nSN: `nAuthentisierungscode: `n`n, %docfile%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ExitApp
|
||||
}
|
||||
@@ -1,177 +1,99 @@
|
||||
#Include, func.ahk
|
||||
#Include "func.ahk"
|
||||
|
||||
Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard
|
||||
DetectHiddenWindows true
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Make sure the settings file exists, if not, create it
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
If !FileExist(ini) ; Check if the ini doesn't exist
|
||||
{
|
||||
FileAppend,
|
||||
(
|
||||
; 0 is off, 1 is on
|
||||
[USpec]
|
||||
RACF=LF01234
|
||||
Email=LastnameFirstname@JohnDeere.com
|
||||
Name=Firstname
|
||||
DocFile=Select File
|
||||
[Main]
|
||||
Mansol=1
|
||||
MJDPaste=1
|
||||
CaseFormatter=1
|
||||
CFmail=0
|
||||
[Replacement]
|
||||
JDProductNames=1
|
||||
GloVar=0
|
||||
[Language]
|
||||
German=0
|
||||
), %ini%
|
||||
Run Settings.ahk ; Runs the GUI for changing the settings, also accessible with Alt+Shift+\ (also easy way to restart this script)
|
||||
}
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Read the ini
|
||||
;------------------------------------------------------------------------------
|
||||
; This is the part that reads the file to see what your settings are. Variables in the ini file are in all lowercase, variables here are CamelCase for more distinction
|
||||
|
||||
; User Specific things:
|
||||
racf := ini_get(ini, "USpec", "RACF")
|
||||
email := ini_get(ini, "USpec", "Email")
|
||||
name := ini_get(ini, "USpec", "Name")
|
||||
docfile := ini_get(ini, "USpec", "DocFile")
|
||||
|
||||
; General Settings
|
||||
mansol := ini_get(ini, "Main", "Mansol")
|
||||
supadmin := ini_get(ini, "Main", "Supadmin")
|
||||
mjdpaste := ini_get(ini, "Main", "MJDPaste")
|
||||
caseformatter := ini_get(ini, "Main", "CaseFormatter")
|
||||
|
||||
; Replacement
|
||||
jdpn := ini_get(ini, "Replacement", "JDProductNames")
|
||||
glovar := ini_get(ini, "Replacement", "GloVar")
|
||||
|
||||
; Language
|
||||
ger := ini_get(ini, "Language", "German")
|
||||
A_TrayMenu.Add("&Mouse Mover", MsMv) ; Add item to the tray to move the mouse
|
||||
A_TrayMenu.Add("&Settings", D3K_Settings) ; Add item to the tray for the settings window
|
||||
A_TrayMenu.Add(A_AhkVersion, docs)
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Global Variables
|
||||
;------------------------------------------------------------------------------
|
||||
If (settings["GloVar"])
|
||||
{
|
||||
global glovarini := A_MyDocuments "\GloVar.ini" ; Location of the ini that the user modifies
|
||||
global gvMod := FileGetTime(glovarini)
|
||||
SetTimer(GloVar, 2000) ; Check every 2 seconds
|
||||
|
||||
If (glovar = 1)
|
||||
GloVar(*){
|
||||
If !(WinActive("GloVar.ini")){ ; Only run when the window isn't active, prevents accidential editing by the script while the user is editing
|
||||
gvModNew := FileGetTime(glovarini)
|
||||
If !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini.
|
||||
{
|
||||
glovarini := A_MyDocuments "\GloVar.ini" ; Location of the ini that the user modifies
|
||||
|
||||
glovarstart := "#SingleInstance force`n`n:*:$dorg::`n:*:$dus::`n:*:$dnm::`n:*:$dem::`n:*:$xid::`n"
|
||||
|
||||
SetTimer, GloVar, 2000 ; Check every 2 seconds
|
||||
|
||||
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
|
||||
glovarscript := A_Temp "\GloVar.ahk" ; self-contained, no reference to any other AHK scripts
|
||||
glovarstart := "#Requires AutoHotkey v2`n#SingleInstance force`n#NoTrayIcon`n"
|
||||
hotstrings := "" ; Stop ahk from complaining about it not having a value. Just ignore it bro
|
||||
SetTimer(GloVar, 0) ; Stop the timer while we work on the file
|
||||
glovar_map := ini_load(glovarini)
|
||||
For section in glovar_map {
|
||||
For key, value in glovar_map[section]
|
||||
{
|
||||
FileGetTime, gvModNew, %glovarini%
|
||||
if !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini.
|
||||
Switch section, 0
|
||||
{
|
||||
gvMod := gvModNew
|
||||
FileDelete, glovar.ahk ; Start with a clean slate
|
||||
FileAppend, %glovarstart%, glovar.ahk ; makes sure we only have one instance of the script running at a time
|
||||
|
||||
RESection := "" ; Make sure that its clear
|
||||
file := FileOpen(glovarini, "r")
|
||||
Loop ; Read one line at a time
|
||||
Case "Serial Numbers":
|
||||
value := StrUpper(value) ; Makes it uppercase
|
||||
ini_write(glovarini, key, value)
|
||||
Case "Info":
|
||||
If (key = "case")
|
||||
{
|
||||
Line := file.ReadLine()
|
||||
RegExMatch(Line, "(?<=\[).*(?=\])", RESection) ; explained above
|
||||
RegExMatch(Line, "^(?<Key>.*)=(?<Value>.*)", RE) ; Key = REKey, Value = REValue
|
||||
|
||||
If !(RESection) ; If the RegEx doesn't find antything, its empty
|
||||
{
|
||||
If !(REValue) ; If there is no value for the key, skip it (Continue the loop at the next line)
|
||||
{
|
||||
Continue
|
||||
}
|
||||
If InStr(StoredSection, "Serial Numbers") ; If the section is "Serial Numbers", 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(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(REKey, "case") ; If a key contains "case". Case numbers are all in the format "LETTERS-NUMBERS".
|
||||
{
|
||||
StringUpper, REValue, REValue ; Makes it uppercase
|
||||
RegExMatch(REValue, "(?<=\().*(?=\))", REMatch) ; Match everything but the parenthesis. When the case numbers are shown they have parenthesis, and those are annoying.
|
||||
If (REMatch) ; If there's anything there
|
||||
{
|
||||
WinWaitNotActive, GloVar.ini
|
||||
{
|
||||
ini_write(glovarini, REKey, REMatch) ; Writes the properly formatted case number to glovar.ini
|
||||
FileGetTime, gvMod, %glovarini%
|
||||
}
|
||||
REValue := REMatch
|
||||
} Else {
|
||||
WinWaitNotActive, GloVar.ini
|
||||
{
|
||||
ini_write(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini
|
||||
FileGetTime, gvMod, %glovarini%
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
{
|
||||
StoredSection := RESection
|
||||
If InStr(RESection, "clear") ; Will clear the ini and save its and the documentation file's contents to a log
|
||||
{
|
||||
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"
|
||||
|
||||
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
|
||||
FileCopy, temptemp, %docfile%, 1 ; These two this close together makes it look like they get cleared at the same time
|
||||
FileDelete, temptemp
|
||||
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
|
||||
value := StrUpper(value) ; Makes it uppercase, just in case it was manually typed
|
||||
ini_write(glovarini, key, value) ; Writes the properly formatted case number to glovar.ini
|
||||
}
|
||||
Case "Clear": ; Will clear the ini and save its and the documentation file's contents to a log
|
||||
temp := FileOpen(settings["DocFile"], "r")
|
||||
doctemp := temp.Read()
|
||||
temp.Close()
|
||||
temp := FileOpen(glovarini, "r")
|
||||
initemp := temp.Read()
|
||||
temp.Close()
|
||||
initemp := RegExReplace(initemp, "i)(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info, case insensitive
|
||||
temp := FileOpen(A_MyDocuments "/D3KLog.txt", "a")
|
||||
writethis := "Case on " FormatTime(A_NowUTC, "yyyy-MM-dd") "`n`n" doctemp "`n`n" initemp ; Save the current time, what was in the doc file, and glovarini to a variable
|
||||
temp.Write("`n`n" writethis "`n`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
|
||||
temp.Close()
|
||||
temp := FileOpen("glovarsource", "r")
|
||||
glovarsource := temp.Read()
|
||||
temp.Close()
|
||||
temp := FileOpen(glovarini, "w")
|
||||
temp.Write(glovarsource) ; Overwrite .ini for a clean slate
|
||||
temp.Close()
|
||||
temp := FileOpen(settings["DocFile"], "w") ; Overwrites documentation for a clean slate
|
||||
temp.Close()
|
||||
script := FileOpen(glovarscript, "w")
|
||||
script.Encoding := "UTF-8"
|
||||
script.Write(glovarstart)
|
||||
script.Close()
|
||||
Run(glovarscript) ; Just in case. Don't want an old version running.
|
||||
ToolTip("Cleared")
|
||||
Sleep(500)
|
||||
ToolTip()
|
||||
global gvMod := FileGetTime(glovarini) ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code
|
||||
SetTimer(GloVar, 2000) ; Check every 2 seconds
|
||||
Return
|
||||
}
|
||||
If (value){ ; skip trying to write a hotstring that doesn't do anything
|
||||
hotstrings .= "`n:*:$" key "::" value
|
||||
}
|
||||
} Until (file.AtEOF)
|
||||
file.Close()
|
||||
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 (hotstrings){ ; skip trying to write to the file if there aren't any hotstrings (as in any time it's cleared)
|
||||
script := FileOpen(glovarscript, "w")
|
||||
script.Write(glovarstart hotstrings)
|
||||
script.Close()
|
||||
Run(A_AhkPath " " glovarscript)
|
||||
ToolTip("GloVars updated")
|
||||
Sleep(500)
|
||||
ToolTip()
|
||||
}
|
||||
global gvMod := FileGetTime(glovarini) ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code
|
||||
SetTimer(GloVar, 2000) ; Check every 2 seconds
|
||||
If (settings["msmv"] = "no-running" or settings["msmv"] = "yes-running") ; might as well update the checkboxes in the menu
|
||||
{
|
||||
Run glovar.ahk
|
||||
}
|
||||
A_TrayMenu.Check("&Mouse Mover")
|
||||
} else { ; have to include ampersand to refer to it by name!
|
||||
A_TrayMenu.UnCheck("&Mouse Mover")
|
||||
}
|
||||
}
|
||||
}}
|
||||
Return
|
||||
}
|
||||
|
||||
@@ -179,60 +101,64 @@ If (glovar = 1)
|
||||
;------------------------------------------------------------------------------
|
||||
; Settings window
|
||||
;------------------------------------------------------------------------------
|
||||
!+\::D3K_Settings() ; Alt+Shift+\
|
||||
D3K_Settings(*)
|
||||
{
|
||||
Run("Settings.ahk")
|
||||
}
|
||||
|
||||
!+\::Run Settings.ahk ; Alt+Shift+\
|
||||
|
||||
docs(*){
|
||||
Run("https://www.autohotkey.com/docs/AutoHotkey.htm")
|
||||
}
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; DTAC Solution Opener
|
||||
; Mouse Mover todo: autostart
|
||||
;------------------------------------------------------------------------------
|
||||
MsMv(ItemName, ItemPos, MyMenu)
|
||||
{
|
||||
settings := ini_load(sett_ini)
|
||||
switch settings["msmv"] { ; couldn't find a good way to detect if it's running or not so now we have this.
|
||||
case "always-running": ; run at refresh of d3k. if currently running, stop
|
||||
Run A_ScriptDir "\msmv.ahk off"
|
||||
MyMenu.Uncheck(ItemName)
|
||||
ini_write(sett_ini, "msmv", "always-stopped")
|
||||
case "always-stopped": ; run at refresh, currently stopped. if currently stopped, start
|
||||
Run A_ScriptDir "\msmv.ahk on"
|
||||
MyMenu.Check(ItemName)
|
||||
ini_write(sett_ini, "msmv", "always-running")
|
||||
case "no-running": ; don't run at refresh, currently running. if currently running, stop
|
||||
Run A_ScriptDir "\msmv.ahk off"
|
||||
MyMenu.Uncheck(ItemName)
|
||||
ini_write(sett_ini, "msmv", "no-stopped")
|
||||
case "no-stopped": ; don't run at refresh, currently stopped. if currently stopped, start
|
||||
Run A_ScriptDir "\msmv.ahk on"
|
||||
MyMenu.Check(ItemName)
|
||||
ini_write(sett_ini, "msmv", "no-running")
|
||||
default:
|
||||
MsgBox("Unexpected value `"" settings["msmv"] "`" in D3Ksettings.ini")
|
||||
Reload
|
||||
}
|
||||
}
|
||||
|
||||
#If, mansol = "1" ; checks from the variable thats set from the .ini file
|
||||
!+S::Run Mansol_Opener.ahk ; Alt+Shift+S
|
||||
#If ; these are to make sure one "if" doesn't influence the next accidentially
|
||||
cleanup(*) ; to make sure msmv closes when we close d3k
|
||||
{
|
||||
settings := ini_load(sett_ini)
|
||||
switch settings["msmv"] { ; couldn't find a good way to detect if it's running or not so now we have this.
|
||||
case "always-running": ; run at refresh of d3k. if currently running, stop
|
||||
Run A_ScriptDir "\msmv.ahk off"
|
||||
ini_write(sett_ini, "msmv", "always-stopped")
|
||||
case "no-running": ; don't run at refresh, currently running. if currently running, stop
|
||||
Run A_ScriptDir "\msmv.ahk off"
|
||||
ini_write(sett_ini, "msmv", "no-stopped")
|
||||
}
|
||||
}
|
||||
|
||||
OnExit cleanup
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Case Formatter
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
#If, CaseFormatter = "1"
|
||||
Pause::Run Case_Formatter.ahk ; The Pause|Break key
|
||||
#If
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Special Characters
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
#If, ger = "1"
|
||||
; scharfes s / Eszett / ß
|
||||
!s::Send {U+00DF} ;Alt+S
|
||||
|
||||
; ä
|
||||
!a::Send {U+00E4} ;Alt+a
|
||||
|
||||
; ö
|
||||
!o::Send {U+00F6} ;Alt+o
|
||||
|
||||
; ü
|
||||
!u::Send {U+00FC} ;Alt+u
|
||||
|
||||
; Ä
|
||||
+!A::Send {U+00C4} ;Alt+A
|
||||
|
||||
; Ö
|
||||
+!O::Send {U+00D6} ;Alt+O
|
||||
|
||||
; Ü
|
||||
+!U::Send {U+00DC} ;Alt+U
|
||||
|
||||
#If
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
; Capitalise dates
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
::monday::Monday
|
||||
::tuesday::Tuesday
|
||||
::wednesday::Wednesday
|
||||
@@ -240,12 +166,9 @@ If (glovar = 1)
|
||||
::friday::Friday
|
||||
::saturday::Saturday
|
||||
::sunday::Sunday
|
||||
|
||||
::january::January
|
||||
::february::February
|
||||
; ::march::March ; Commented out because it matches the common word "march".
|
||||
::april::April
|
||||
; ::may::May ; Commented out because it matches the common word "may".
|
||||
::june::June
|
||||
::july::July
|
||||
::august::August
|
||||
@@ -254,9 +177,8 @@ If (glovar = 1)
|
||||
::november::November
|
||||
::december::December
|
||||
|
||||
|
||||
; German
|
||||
#If, ger = "1"
|
||||
#HotIf (settings["German"])
|
||||
::montag::Montag
|
||||
::dienstag::Dienstag
|
||||
::mittwoch::Mittwoch
|
||||
@@ -273,233 +195,213 @@ If (glovar = 1)
|
||||
::juli::Juli
|
||||
::oktober::Oktober
|
||||
::dezebmer::Dezember
|
||||
#If
|
||||
#HotIf
|
||||
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Copypastas
|
||||
;------------------------------------------------------------------------------
|
||||
;STWA Applied
|
||||
:*:]cms::
|
||||
Send Notes:{Space}{Enter}Explanation:{Space}{Enter}Flowdock:{Space}{Enter 2}Thank you,{Enter}%name%{Enter 2}Tier 2 internal steps:{Space}{CtrlDown}{Home}{CtrlUp}{End}
|
||||
Return
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Email
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
; Regular
|
||||
:*:]email::
|
||||
Send Hello,{Enter 2}{Space 3}
|
||||
Return
|
||||
|
||||
; Cases
|
||||
:*:]cms::
|
||||
Send Hello,{Enter 2}{Space 3}{Enter}{Home down}{Shift up}{Home up}{Enter}Thank you,{Enter}%name%{Up 3}{End}
|
||||
Return
|
||||
|
||||
#If
|
||||
|
||||
{
|
||||
Send "Hello,{Enter 2}{Space 3}"
|
||||
}
|
||||
|
||||
; German
|
||||
#If, ger = "1"
|
||||
|
||||
; Regular
|
||||
:*:[email::
|
||||
Send Hallo,{Enter 2}{Space 3}
|
||||
Return
|
||||
|
||||
; Case
|
||||
:*:[cms::
|
||||
Send Hallo,{Enter 2}{Space 3}{Enter}{Home down}{Shift down}{Home up}{Shift up}{Enter}Mit freundlichen Grüßen,{Enter}%name%{Up 3}{End}
|
||||
Return
|
||||
|
||||
#If
|
||||
|
||||
|
||||
#HotIf (settings["German"])
|
||||
:*:[email::{
|
||||
Send "Hallo,{Enter 2}{Space 3}"
|
||||
}
|
||||
#HotIf
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Profile email paste
|
||||
;------------------------------------------------------------------------------
|
||||
; So when editing Profiles, it won't let you paste in the email field. We don't like that. Make sure to let go of all keys immediatley after pressing this
|
||||
|
||||
#If, mjdpaste = "1"
|
||||
#v::
|
||||
sleep, 750
|
||||
Send %clipboard%
|
||||
sleep, 500
|
||||
send # ; to make sure the start menu isn't open for some reason
|
||||
return
|
||||
#If
|
||||
|
||||
|
||||
{
|
||||
Sleep(750)
|
||||
SendInput(A_Clipboard)
|
||||
}
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Common Terms autocorrect and replacement
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
#If, not(racf = "LF01234") ; So that it doesn't put the fake RACF from the default ini file
|
||||
:*:]me::
|
||||
Send, %racf%
|
||||
return
|
||||
|
||||
:*:[me::
|
||||
Send, %racf%
|
||||
return
|
||||
#If
|
||||
|
||||
#If, not(email = "[email protected]") ; Same as above
|
||||
:*:@me::
|
||||
Send, %email%
|
||||
Return
|
||||
#If
|
||||
|
||||
; JD Names
|
||||
#If, jdpn = "1"
|
||||
|
||||
:*:[xx::XXXXXXXXXXXXX ; I'm not gonna try and find the right amount of X's to appease the CCMS demons
|
||||
:*:]xx::XXXXXXXXXXXXX
|
||||
|
||||
#HotIf (settings["JDProductNames"])
|
||||
; English
|
||||
:*:]at::AutoTrac
|
||||
:*:]sf::StarFire
|
||||
:*:]jdlw::JDLink Web
|
||||
:*:]jdld::JDLink Dashboard
|
||||
:*:]jdl2::JDLink Dashboard 2.0
|
||||
:*:]jdlc::JDLink Connect
|
||||
:*:]jdla::JDLink Access
|
||||
:*:]jdls::JDLink Subscription
|
||||
:*:]jdll::JDLink
|
||||
:*:]bna::Basics & AutoTrac
|
||||
:*:]bfs::Basics for Services
|
||||
:*:]bas::Basics, AutoTrac, and Section Control
|
||||
:*:]jlb::JDLink Boost
|
||||
:*:]jdp::JDParts
|
||||
:*:]jdsm::John Deere Software Manager
|
||||
:*:]macrep::Machine Reports
|
||||
:*:]mjd::MyJohnDeere
|
||||
:*:]muc::Master Unlock Code
|
||||
:*:]oman::Operator's Manual
|
||||
:*:]opsc::Operations Center
|
||||
:*:]rs::RowSense
|
||||
:*:]seccon::Section Control
|
||||
:*:]gs::GreenStar
|
||||
:*:]cc::CommandCenter
|
||||
:*:]fc::Field Connect
|
||||
:*:]rs::RowSense
|
||||
:*:]sub::subscription
|
||||
:*:]ss::Stellar Support
|
||||
:*:]sub::subscription
|
||||
:*:]tcsm::Territory Customer Support Manager
|
||||
:*:]tman::Technical Manual
|
||||
:*:]oman::Operator's Manual
|
||||
:*:]hl3::HarvestLab 3000
|
||||
:*:]hlo::Original HarvestLab
|
||||
:*:]bin::Virtual Inventory
|
||||
:*:]tp::TouchPoint
|
||||
:*:]warrep::Warranty Reports
|
||||
:*:]tp::TouchPoint
|
||||
:*:]tcsm::Territory Customer Support Manager
|
||||
:*:]macrep::Machine Reports
|
||||
:*:]jdsm::John Deere Software Manager
|
||||
:*:]jddm::John Deere Data Manager
|
||||
:*:]serva::Service Advisor
|
||||
:*:]muc::Master Unlock Code
|
||||
:*:]asmn::Asset Manager
|
||||
|
||||
:*:]bsm::Base Station Manager
|
||||
:*:]lm::License Manager
|
||||
:*:]sns::See & Spray
|
||||
:*:]s4::SF-RTK
|
||||
:*:]ls::licenses
|
||||
:*:]sub::subscription
|
||||
:*:]agt::AgTech Code
|
||||
|
||||
::rowsense::RowSense
|
||||
::comar::COMAR
|
||||
::comars::COMARs
|
||||
::mrtk::mRTK
|
||||
::rda::RDA
|
||||
::rtk::RTK
|
||||
::autotrac::AutoTrac
|
||||
::ccms::CCMS
|
||||
::comar::COMAR
|
||||
::dtac::DTAC
|
||||
::tcsm::TCSM
|
||||
::itec::iTEC Pro
|
||||
::ssu::SSU
|
||||
::atu::ATU
|
||||
:*:mtg::MTG
|
||||
::wdt::WDT
|
||||
:*:mtg::modem
|
||||
::itc::iTC
|
||||
:*:vin::VIN
|
||||
::vin::Machine PIN ; Not actually vehicles, so they don't have VINs
|
||||
::gs2::GS2
|
||||
::gs3::GS3
|
||||
::g4::G4
|
||||
::g5::G5
|
||||
::sf1::SF1
|
||||
::sf2::SF2
|
||||
::sf3::SF3
|
||||
::sf4::SF4
|
||||
::xid::xID
|
||||
::pmcalc::PMCalc
|
||||
::vat::VAT
|
||||
:*:racf::RACF
|
||||
::VAT::VAT
|
||||
::RACF::RACF
|
||||
::igrade::iGrade
|
||||
|
||||
::ISOBUS::ISOBUS
|
||||
::JDCP::JDCP
|
||||
::LORT::LORT
|
||||
::ISG::ISG
|
||||
|
||||
; German
|
||||
#If, ger = "1"
|
||||
#HotIf (settings["German"])
|
||||
:*:[at::AutoTrac
|
||||
:*:[sf::StarFire
|
||||
:*:[jdlw::JDLink Web
|
||||
:*:[jdld::JDLink Dashboard
|
||||
:*:[jdl2::JDLink Dashboard 2.0
|
||||
:*:[jdlc::JDLink Connect
|
||||
:*:[jdla::JDLink Access
|
||||
:*:[jdls::JDLink Abonnement
|
||||
:*:[jdll::JDLink
|
||||
:*:[bna::Basics & AutoTrac
|
||||
:*:[bfs::Basics for Services
|
||||
:*:[bas::Basics, AutoTrac, and Section Control
|
||||
:*:[sf4::SF-RTK
|
||||
:*:[jlb::JDLink Boost
|
||||
:*:[jdp::JDParts
|
||||
:*:[mjd::MyJohnDeere
|
||||
:*:[opsc::Einsatzzentrale
|
||||
:*:[seccon::Teilbreitensteuerung
|
||||
:*:[gs::GreenStar
|
||||
:*:[cc::CommandCenter
|
||||
:*:[fc::Field Connect
|
||||
:*:[rs::RowSense
|
||||
:*:[sub::Abonnement
|
||||
:*:[ss::Stellar Support
|
||||
:*:[tman::Technische Betriebsanleitung
|
||||
:*:[oman::Betriebsanleitung
|
||||
:*:[hl3::HarvestLab 3000
|
||||
:*:[hlo::Originales HarvestLab
|
||||
:*:[bin::Virtuellen Bestand
|
||||
:*:[warrep::Warranty Reports
|
||||
:*:[tp::TouchPoint
|
||||
:*:[tcsm::Technischer Bezirksleiter
|
||||
:*:[jdsm::John Deere Software Manager
|
||||
:*:[macrep::Machine Reports
|
||||
:*:[mjd::MyJohnDeere
|
||||
:*:[muc::Master Unlock Code
|
||||
:*:[oman::Betriebsanleitung
|
||||
:*:[opsc::Einsatzzentrale
|
||||
:*:[rs::RowSense
|
||||
:*:[seccon::Teilbreitensteuerung
|
||||
:*:[serva::Service Advisor
|
||||
:*:[sf::StarFire
|
||||
:*:[ss::Stellar Support
|
||||
:*:[sub::Abonnement
|
||||
:*:[tcsm::Technischer Bezirksleiter
|
||||
:*:[tman::Technische Betriebsanleitung
|
||||
:*:[tp::TouchPoint
|
||||
:*:[warrep::Warranty Reports
|
||||
:*:[tcsm::Technischer Bezirksleiter
|
||||
:*:[jdsm::John Deere Software Manager
|
||||
:*:[jddm::John Deere Data Manager
|
||||
:*:[serva::Service Advisor
|
||||
:*:[muc::Master Unlock Code
|
||||
:*:[asmn::Asset Manager
|
||||
#If
|
||||
:*:[bsm::Base Station Manager
|
||||
:*:[lm::License Manager
|
||||
:*:[sns::See & Spray
|
||||
:*:[s4::SF-RTK
|
||||
:*:[ls::Lizenz
|
||||
:*:[agt::AgTech Code
|
||||
#HotIf
|
||||
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; QoL Improvements
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
#j:: ; Open the downloads folder on Win+J
|
||||
Run, C:\Users\%racf%\Downloads
|
||||
Return
|
||||
|
||||
|
||||
|
||||
#w:: ; Open My Documents folder on Win+W
|
||||
if WinActive("ahk_exe Explorer.EXE") ; If windows explorer is focused
|
||||
:*:]me::
|
||||
:*:[me::
|
||||
{
|
||||
Send !d ; Focus the address bar
|
||||
Send C:\Users\%racf%\Documents
|
||||
Send {Enter}
|
||||
Return
|
||||
Send StrUpper(A_UserName)
|
||||
}
|
||||
|
||||
|
||||
#HotIf !(settings["Email"] = "[email protected]")
|
||||
:*:@em::
|
||||
{
|
||||
SendInput(settings["Email"])
|
||||
}
|
||||
#HotIf
|
||||
|
||||
; Open the downloads folder on Win+J
|
||||
#j::Run("C:\Users\" A_UserName "\Downloads")
|
||||
|
||||
|
||||
:*:[now::
|
||||
:*:]now::
|
||||
{
|
||||
SendInput(FormatTime(A_NowUTC, "yyyy-MM-dd") "T" FormatTime(A_NowUTC, "H:mm'Z'")) ; Send the current time & date in ISO8601 format
|
||||
}
|
||||
|
||||
; Send the current date in ISO8601 format
|
||||
:*:[today::
|
||||
:*:]today::
|
||||
{
|
||||
|
||||
SendInput(FormatTime(A_NowUTC, "yyyy-MM-dd"))
|
||||
}
|
||||
Run, C:\Users\%racf%\Documents
|
||||
Return
|
||||
|
||||
:*:[deg::{ASC 248}
|
||||
:*:]deg::{ASC 248}
|
||||
:*:[eq::{ASC 247}
|
||||
:*:]eq::{ASC 247}
|
||||
|
||||
:*:[shrug::¯\_(ツ)_/¯
|
||||
:*:]shrug::¯\_(ツ)_/¯
|
||||
::]yee::
|
||||
yee()
|
||||
{
|
||||
asc_yee := ["░░░░░░░░░░░░░▄███▄▄▄░░░░░░░","░░░░░░░░░▄▄▄██▀▀▀▀███▄░░░░░","░░░░░░░▄▀▀░░░░░░░░░░░▀█░░░░","░░░░▄▄▀░░░░░░░░░░░░░░░▀█░░░","░░░█░░░░░▀▄░░▄▀░░░░░░░░█░░░","░░░▐██▄░░▀▄▀▀▄▀░░▄██▀░▐▌░░░","░░░█▀█░▀░░░▀▀░░░▀░█▀░░▐▌░░░","░░░█░░▀▐░░░░░░░░▌▀░░░░░█░░░","░░░█░░░░░░░░░░░░░░░░░░░█░░░","░░░░█░░▀▄░░░░▄▀░░░░░░░░█░░░","░░░░█░░░░░░░░░░░▄▄░░░░█░░░░","░░░░░█▀██▀▀▀▀██▀░░░░░░█░░░░","░░░░░█░░▀████▀░░░░░░░█░░░░░","░░░░░░█░░░░░░░░░░░░▄█░░░░░░","░░░░░░░██░░░░░█▄▄▀▀░█░░░░░░","░░░░░░░░▀▀█▀▀▀▀░░░░░░█░░░░░", "yee ░░░░░█░░░░░░░░░░░░█░░░░"]
|
||||
|
||||
For index, value in asc_yee
|
||||
:*:[shrug::
|
||||
:*:]shrug::
|
||||
{
|
||||
SendInput, %value%{ShiftDown}{Enter}{ShiftUp}
|
||||
SendInput("¯\_(ツ)_/¯ ") ; Somehow the space at the end is very important
|
||||
}
|
||||
|
||||
:*:[pwd::
|
||||
:*:]pwd::
|
||||
{
|
||||
Send "{AppsKey}"
|
||||
Sleep(100)
|
||||
Send "{Up}"
|
||||
Sleep(50)
|
||||
Send "{Enter}"
|
||||
Sleep(50)
|
||||
Send "{Enter}"
|
||||
Sleep(100)
|
||||
Send "{Enter}"
|
||||
Sleep(750)
|
||||
Send "{Enter}"
|
||||
}
|
||||
|
||||
F19::Reload
|
||||
@@ -1,33 +0,0 @@
|
||||
#SingleInstance force ; Only one instance at a time
|
||||
SendMode, Input
|
||||
FileEncoding, UTF-8 ; Makes sure the special characters don't break stuff
|
||||
|
||||
Menu, Tray, Icon, %A_MyDocuments%\D3K\icons\manual.ico
|
||||
|
||||
Gui, +AlwaysOnTop +ToolWindow
|
||||
|
||||
Gui, Add, Edit, x2 y3 w78 h20 vNumber +Left,
|
||||
Gui, Add, Button, x22 y43 w70 h20 Default vHidden, Ok
|
||||
Gui, Add, Button, x81 y3 w17 h20 gHelp +Center, ?
|
||||
Gui, Show, h28 w100, ManSol
|
||||
GuiControl, Hide, Hidden
|
||||
|
||||
Return
|
||||
|
||||
ButtonOk:
|
||||
Gui, submit ; I have no idea what the regex means any more...
|
||||
If RegExMatch(Number, "[[:alpha:]]+")
|
||||
run, % "http://serviceadvisor.deere.com/WebSA/manuals/" . Number
|
||||
Else If RegExMatch(Number, "[[:digit:]]+")
|
||||
run, % "https://ccms.deere.com/prweb/PRServletCustomAuth/ZDate_MgiNPn1ccL6O6pyBurDs0hjFQ8*/!STANDARD?pyActivity=SolutionsSnapStart&Action=showHarness&className=Deere-Int-Solr-Docs&Purpose=SolutionDescriptionNew&SolutionID=" . Number . "&Language=Default"
|
||||
ExitApp
|
||||
Return
|
||||
|
||||
|
||||
Help:
|
||||
MsgBox, 262176, Maual & Solution opener, Input the TM/OM SKU (easily ofund on TechPubs) or the DTAC solution number to open it in your default browser.`nTMs & OMs open in Service Advisor.
|
||||
Return
|
||||
|
||||
GuiClose:
|
||||
GuiEscape:
|
||||
ExitApp
|
||||
+63
-123
@@ -1,152 +1,92 @@
|
||||
#Include, func.ahk
|
||||
Menu, Tray, Icon, shell32.dll, 283
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Read ini
|
||||
;------------------------------------------------------------------------------
|
||||
/*
|
||||
This is the part that reads the file to see what your settings are. Variables in the ini file are in CamelCase, variables here are lowercase for more distinction
|
||||
*/
|
||||
|
||||
; User Specific things:
|
||||
racf := ini_get(ini, "USpec", "RACF")
|
||||
email := ini_get(ini, "USpec", "Email")
|
||||
docfile := ini_get(ini, "USpec", "DocFile")
|
||||
|
||||
; General Settings
|
||||
mansol := ini_get(ini, "Main", "Mansol")
|
||||
mjdpaste := ini_get(ini, "Main", "MJDPaste")
|
||||
caseformatter := ini_get(ini, "Main", "CaseFormatter")
|
||||
cfmail := ini_get(ini, "Main", "CFmail")
|
||||
|
||||
; Replacement
|
||||
jdpn := ini_get(ini, "Replacement", "JDProductNames")
|
||||
glovar := ini_get(ini, "Replacement", "GloVar")
|
||||
|
||||
; Language
|
||||
ger := ini_get(ini, "Language", "German")
|
||||
#Include "func.ahk"
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Create GUI
|
||||
;------------------------------------------------------------------------------
|
||||
Gui, -MaximizeBox -MinimizeBox ; Remove the max+min buttons
|
||||
myGui := Gui()
|
||||
myGui.Opt("-MaximizeBox -MinimizeBox") ; Remove the max+min buttons
|
||||
|
||||
Gui, Add, GroupBox, x8 y2 w67 h37, RACF
|
||||
Gui, Add, Edit, x12 y15 w60 h20 vformRACF gRACF, %RACF%
|
||||
myGui.Add("Edit", "w200 vEmail", settings["Email"]).OnEvent("LoseFocus", ProcessUserInput) ; settings["Email"]
|
||||
|
||||
Gui, Add, GroupBox, x8 y40 w207 h37, Email Address
|
||||
Gui, Add, Edit, x12 y53 w200 h20 vformEmail gEmail, %Email%
|
||||
myGui.Add("Text",, "Documentation file:") ; settings["DocFile"]
|
||||
myGui.Add("Text",, settings["DocFile"])
|
||||
myGui.Add("Button",, "Pick a different file").OnEvent("Click", DocSelect)
|
||||
|
||||
Gui, Add, GroupBox, x77 y2 w207 h37, Documentation File
|
||||
Gui, Add, Text, x81 y19 w200 h20 gDocFile, %docfile%
|
||||
myGui.Add("Text", "Section", "Text Replacement")
|
||||
myGui.Add("CheckBox", "vJDPN Checked" . settings["JDProductNames"], "JD Product Names").OnEvent("Click", ProcessUserInput)
|
||||
myGui.Add("CheckBox", "vGloVar Checked" . settings["GloVar"], "Global Variables").OnEvent("Click", ProcessUserInput)
|
||||
myGui.Add("CheckBox", "vDE Checked" . settings["German"], "DE ([ as prefix)").OnEvent("Click", ProcessUserInput)
|
||||
|
||||
Gui, Add, GroupBox, x8 y83 w107 h130, Main
|
||||
Gui, Add, CheckBox, x12 y95 w100 h30 vformMansol Checked%mansol% gMansol, ManSol
|
||||
Gui, Add, CheckBox, x12 y125 w100 h30 vformMJDPaste Checked%mjdpaste% gMJDPaste, MJDPaste
|
||||
Gui, Add, CheckBox, x12 y155 w100 h30 vformCaseFormatter Checked%caseformatter% gCaseFormatter, Case Formatter
|
||||
Gui, Add, CheckBox, x25 y178 w75 h30 vformCFmail Checked%cfmail% gCFmail, Email option
|
||||
GuiControl, show%caseformatter%, formCFmail ; only shows the check box for emails if the Case Formatter box is checked
|
||||
switch settings["msmv"] {
|
||||
case "always-running": ; run at refresh of d3k, currently running
|
||||
msmv_check := 1
|
||||
case "always-stopped": ; run at refresh, currently stopped
|
||||
msmv_check := 1
|
||||
case "no-running": ; don't run at refresh, currently running
|
||||
msmv_check := 0
|
||||
case "no-stopped": ; don't run at refresh, currently stopped
|
||||
msmv_check := 0
|
||||
default:
|
||||
MsgBox("Unexpected value `"" settings["msmv"] "`" in D3Ksettings.ini")
|
||||
Reload
|
||||
}
|
||||
|
||||
Gui, Add, GroupBox, x128 y83 w157 h75, Text Replacement
|
||||
Gui, Add, CheckBox, x132 y95 w150 h30 vformJdpn Checked%jdpn% gJdpn, JD Product Names
|
||||
Gui, Add, CheckBox, x132 y125 w150 h30 vformGlovar Checked%glovar% gGlovar, Global Variables
|
||||
Gui, Add, CheckBox, x132 y155 w100 h30 vformGer Checked%ger% gGer, DE ([ as prefix)
|
||||
myGui.Add("Checkbox", "vMsmv Checked" . msmv_check, "Mouse Mover: silently start on startup").OnEvent("Click", ProcessUserInput)
|
||||
|
||||
Gui, Add, Link, x132 y190 w150 h23 gHelp, <a href="https://daviddaily.dev/david/d3k/wiki">Click here for help</a> (v%d3k_version%)
|
||||
|
||||
Gui, Show, h225 w295, David 3000 Settings
|
||||
myGui.Add("Link",, "<a href=`"https://daviddaily.dev/david/d3k/wiki`">Click here for help</a>")
|
||||
myGui.Add("Text",, "AHK Version: " . A_AhkVersion)
|
||||
myGui.Add("Text",, "D3K version " . d3k_version)
|
||||
myGui.Title := "D3K settings"
|
||||
MyGui.OnEvent("Close", ProcessUserInput)
|
||||
myGui.OnEvent("Escape", End)
|
||||
myGui.Show("AutoSize")
|
||||
Return
|
||||
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Edit ini
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
/*
|
||||
Default ini, sections are in []: (0 is off, 1 is on)
|
||||
[USpec]
|
||||
RACF=LF01234
|
||||
[email protected]
|
||||
Name=Firstname
|
||||
DocFile=Select File
|
||||
[Main]
|
||||
Mansol=1
|
||||
MJDPaste=1
|
||||
CaseFormatter=1
|
||||
CFmail=0
|
||||
[Replacement]
|
||||
JDProductNames=1
|
||||
GloVar=0
|
||||
[Language]
|
||||
German=0
|
||||
|
||||
format for below:
|
||||
Button G-label (executes when clicked):
|
||||
Submit the gui so that it can change and don't hide it
|
||||
write the state of the check box (a 0 for unchecked, 1 for checked), to the file at %ini%, section with this name, line with this name
|
||||
*/
|
||||
|
||||
RACF:
|
||||
Gui, Submit, NoHide
|
||||
ini_write(ini, "RACF", formRACF)
|
||||
Return
|
||||
|
||||
Email:
|
||||
Gui, Submit, NoHide
|
||||
ini_write(ini, "Email", formEmail)
|
||||
Return
|
||||
ProcessUserInput(*)
|
||||
{
|
||||
Saved := MyGui.Submit(0) ; Save the contents of named controls into an object.
|
||||
ini_write(sett_ini, "Email", Saved.Email)
|
||||
ini_write(sett_ini, "JDProductNames", Saved.JDPN)
|
||||
ini_write(sett_ini, "GloVar", Saved.GloVar)
|
||||
ini_write(sett_ini, "German", Saved.DE)
|
||||
if (Saved.Msmv = 1)
|
||||
{
|
||||
ini_write(sett_ini, "msmv", "always-stopped")
|
||||
} else {
|
||||
ini_write(sett_ini, "msmv", "no-stopped")
|
||||
}
|
||||
}
|
||||
|
||||
DocFile:
|
||||
Gui, Submit
|
||||
FileSelectFile, SelectedFile, 3, , Open a file, Text Documents (*.txt; *.doc)
|
||||
if SelectedFile =
|
||||
MsgBox, You have not selected a file, this will break some things.
|
||||
DocSelect(*)
|
||||
{
|
||||
oSaved := myGui.Submit()
|
||||
SelectedFile := FileSelect(3,, "Open a file", "Text Documents (*.txt)")
|
||||
if !(SelectedFile)
|
||||
MsgBox("You have not selected a file, this will break some things.")
|
||||
else
|
||||
ini_write(ini, "DocFile", SelectedFile)
|
||||
docfile := ini_get(ini, "USpec", "DocFile")
|
||||
Gui, Show, h225 w295, David 3000 Settings
|
||||
Return
|
||||
ini_write(sett_ini, "DocFile", SelectedFile)
|
||||
Run("Settings.ahk")
|
||||
}
|
||||
|
||||
Mansol:
|
||||
Gui, Submit, NoHide
|
||||
ini_write(ini, "Mansol", formMansol)
|
||||
Return
|
||||
|
||||
MJDPaste:
|
||||
Gui, Submit, NoHide
|
||||
ini_write(ini, "MJDPaste", formMJDPaste)
|
||||
Return
|
||||
|
||||
CaseFormatter:
|
||||
Gui, Submit, NoHide
|
||||
GuiControl, show%formCaseFormatter%, formCFmail ; only shows the check box for emails if the Case Formatter box is checked
|
||||
GuiControl,, formCFmail, 0
|
||||
ini_write(ini, "CaseFormatter", formCaseFormatter)
|
||||
ini_write(ini, "CFmail", "0") ; if you're toggling this, its either on or off, doesn't hurt to set it here
|
||||
Return
|
||||
|
||||
CFmail:
|
||||
Gui, Submit, NoHide
|
||||
ini_write(ini, "CFmail", formCFmail)
|
||||
Return
|
||||
|
||||
Jdpn:
|
||||
Gui, Submit, NoHide
|
||||
ini_write(ini, "JDProductNames", formJdpn)
|
||||
Return
|
||||
|
||||
Glovar:
|
||||
Gui, Submit, NoHide
|
||||
ini_write(ini, "GloVar", formGlovar)
|
||||
Return
|
||||
|
||||
Ger:
|
||||
Gui, Submit, NoHide
|
||||
ini_write(ini, "German", formGer)
|
||||
Return
|
||||
|
||||
Help:
|
||||
Gui, Submit
|
||||
Return
|
||||
|
||||
GuiClose:
|
||||
GuiEscape:
|
||||
Run D3K.ahk
|
||||
ExitApp ; Closes the app when escape or the exit button is pressed
|
||||
End(*)
|
||||
{
|
||||
ProcessUserInput()
|
||||
ExitApp
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#Include, func.ahk
|
||||
|
||||
csv = %A_MyDocuments%\emails.csv ; Where the email CSV is
|
||||
|
||||
glovarini := A_MyDocuments "\GloVar.ini"
|
||||
Xid := ini_get(glovarini, "Info", "xID")
|
||||
|
||||
Gui, +AlwaysOnTop +ToolWindow
|
||||
|
||||
Gui, Add, Text, x2 y2 w60 h17 +Center, xID
|
||||
Gui, Add, Text, x65 y2 w120 h17 +Center, Email
|
||||
Gui, Add, Text, x190 y2 w100 h17 +Center, Name
|
||||
|
||||
Gui, Add, Edit, x2 y17 w60 h20 vXid, %Xid%
|
||||
Gui, Add, Edit, x65 y17 w120 h20 vEmail
|
||||
Gui, Add, Edit, x190 y17 w100 h20 vName
|
||||
|
||||
Gui, Add, Button, x172 y89 w70 h30 Default, OK
|
||||
|
||||
Gui, Show, h39 w292, Add dealer to CSV
|
||||
Return
|
||||
|
||||
ButtonOK:
|
||||
Gui, Submit
|
||||
writethis := Xid . "," . Email . "," . Name
|
||||
FileAppend, % "`n" writethis, %csv%
|
||||
ini_write(A_MyDocuments "\GloVar.ini", "dem", Email)
|
||||
Return
|
||||
|
||||
|
||||
GuiEscape:
|
||||
GuiClose:
|
||||
ExitApp
|
||||
@@ -1,4 +0,0 @@
|
||||
xID,Email,Name,Demo Username,Dealer Org
|
||||
X1,[email protected],Person 1,User 1,554866
|
||||
X2,[email protected],Person 2,User 2,69983
|
||||
X3,[email protected],Person 3,,4832
|
||||
|
@@ -1,54 +1,11 @@
|
||||
#SingleInstance force ; Only one instance at a time
|
||||
SendMode, Input
|
||||
FileEncoding, UTF-8 ; Makes sure the special characters dont break stuff
|
||||
SetWorkingDir, %A_MyDocuments%\D3K ; Make sure we can find the .ahks linked below
|
||||
#Requires AutoHotkey v2 ; v2 only
|
||||
#SingleInstance force ; Only one instance at a time
|
||||
FileEncoding("UTF-8") ; Makes sure the special characters dont break stuff
|
||||
SetWorkingDir(A_MyDocuments "\D3K") ; Make sure we can find the .ahks linked below
|
||||
SetTitleMatchMode(2)
|
||||
|
||||
d3k_version = 2.9 ; The current version
|
||||
global d3k_version := 3 ; The current version
|
||||
|
||||
ini = %A_MyDocuments%\D3Ksettings.ini ; Where the settings ini is
|
||||
|
||||
GetDateTime(lang)
|
||||
{
|
||||
UTCTimestamp := A_NowUTC ; Grab the current time and date
|
||||
UTCFormatStr := "yyyy-MM-dd" ; The Date
|
||||
FormatTime, DateStr, %UTCTimestamp%, %UTCFormatStr% ; format it to make it look like the Date we want
|
||||
UTCFormatStr := "H:mm' GMT'" ; The time
|
||||
FormatTime, TimeStr, %UTCTimestamp%, %UTCFormatStr% ; Format the string to be better
|
||||
if (lang = "en")
|
||||
{
|
||||
Return DateStr " at " TimeStr
|
||||
}
|
||||
|
||||
if (lang = "de")
|
||||
{
|
||||
Return DateStr " um " TimeStr
|
||||
}
|
||||
}
|
||||
|
||||
GetInfo(xID)
|
||||
{
|
||||
if (xID)
|
||||
{
|
||||
File := FileOpen(A_MyDocuments "\emails.csv", "r")
|
||||
Loop
|
||||
{
|
||||
Line := File.ReadLine()
|
||||
Array := StrSplit(Line,",") ; split the line at its separating commas to get separate "columns" AKA elements
|
||||
if InStr(Array[1], xID) ; if at the specified element (1) the specified content (dealers xID) has been found
|
||||
{
|
||||
Test := {xid: Array[1], email: Array[2], name: Array[3], user: Array[4], org: Array[5]} ; Return the array so we can do {variable}.email and so on
|
||||
File.Close() ; Close the file
|
||||
Return Test ; Return the array with the deets that we found
|
||||
}
|
||||
} Until (File.AtEOF)
|
||||
File.Close()
|
||||
Return false
|
||||
}
|
||||
if !(xID)
|
||||
{
|
||||
Return false
|
||||
}
|
||||
}
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; INI Manipulation that supports UTF-8
|
||||
@@ -56,56 +13,89 @@ GetInfo(xID)
|
||||
|
||||
ini_load(location)
|
||||
{
|
||||
File := FileOpen(location, "r")
|
||||
out := {}
|
||||
temp := FileOpen(location, "r")
|
||||
cleaner := temp.Read()
|
||||
temp.Close()
|
||||
cleaner := RegExReplace(cleaner, "`m)[ \t]+$|^[\s\R]*$") ; Remove empty lines, spaces, tabs
|
||||
temp := FileOpen(location, "w")
|
||||
temp.Write(cleaner)
|
||||
temp.Close()
|
||||
temp := FileOpen(location, "r")
|
||||
out := Map() ; I tried an object, it was too complicated for what I'm doing. Nested map is good enough
|
||||
curr_section := 0 ; v2 won't evaluate a true/false to false if a variable isn't set to false
|
||||
r := Object() ; bruh why do I have to set up variables now suddenly
|
||||
Loop
|
||||
{
|
||||
Line := File.ReadLine()
|
||||
RegExMatch(Line, "(?<=\[).*(?=\])", _RESection) ; Matches section name
|
||||
RegExMatch(Line, "(?<Key>.*)=(?<Value>.*)", _) ; Key = _Key, Value = _Value
|
||||
|
||||
If (_RESection)
|
||||
Line := temp.ReadLine()
|
||||
if (Line){
|
||||
RegExMatch(Line, "(?<Section>(?<=\[).*(?=\]))|(?<Key>.*)=(?<Value>.*)", &r) ; Key = r.Key, Value = r.Value, Section = r.Section
|
||||
If (r.Section)
|
||||
{
|
||||
_RESection := StrReplace(_RESection, " ", "_")
|
||||
out[_RESection]:={}
|
||||
currentSection := _RESection
|
||||
} Else {
|
||||
If (_Value)
|
||||
out[r.Section] := Map()
|
||||
curr_section := r.Section
|
||||
} Else
|
||||
{
|
||||
_Key := StrReplace(_Key, " ", "_")
|
||||
out[currentSection][_Key] := _Value
|
||||
If (curr_section)
|
||||
{
|
||||
out[curr_section].Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n"))
|
||||
} Else
|
||||
{
|
||||
out.Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n")) ; this handles things with no section
|
||||
}
|
||||
}
|
||||
} Until (File.AtEOF)
|
||||
File.Close()
|
||||
}
|
||||
} Until (temp.AtEOF)
|
||||
temp.Close()
|
||||
Return out
|
||||
}
|
||||
|
||||
ini_get(location, inSec, inKey)
|
||||
|
||||
ini_write(location, inKey, inValue) ; Don't need to specify section because you can only have one hotstring anyway
|
||||
{
|
||||
ini_loaded := {}
|
||||
ini_loaded := ini_load(location)
|
||||
|
||||
inSec := StrReplace(inSec, " ", "_")
|
||||
inKey := StrReplace(inKey, " ", "_")
|
||||
|
||||
needed := ini_loaded[inSec][inKey]
|
||||
|
||||
if (needed) ; Without this it doesn't know what to return and gets stuck
|
||||
{
|
||||
Return needed
|
||||
} Else Return false
|
||||
ini := FileOpen(location, "r")
|
||||
temp := ini.Read()
|
||||
ini.Close()
|
||||
temp := RegExReplace(temp, "(?<=" inKey "=).*", inValue)
|
||||
ini := FileOpen(location, "w")
|
||||
ini.Write(temp)
|
||||
ini.Close()
|
||||
}
|
||||
|
||||
ini_write(location, inKey, inValue)
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Make sure the settings file exists, if not, create it
|
||||
;------------------------------------------------------------------------------
|
||||
sett_ini := A_MyDocuments "\D3Ksettings.ini" ; Where the settings ini is
|
||||
|
||||
If !FileExist(sett_ini) ; Check if the sett_ini doesn't exist
|
||||
{
|
||||
FileRead, tempini, %location%
|
||||
needle := inKey . "=.*"
|
||||
replacement := inKey . "=" . inValue
|
||||
tempini := RegExReplace(tempini, needle, replacement,, 1)
|
||||
tempini := RegExReplace(tempini, "\R+\R", "`r`n")
|
||||
WinWaitNotActive, GloVar.ini
|
||||
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file
|
||||
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents
|
||||
FileDelete, tempini ; Delete the fixed temporary ini
|
||||
ini := FileOpen(sett_ini, "w")
|
||||
writethis := "
|
||||
( LTrim
|
||||
Email=LastnameFirstname@JohnDeere.com
|
||||
DocFile=0
|
||||
JDProductNames=1
|
||||
GloVar=0
|
||||
German=0
|
||||
msmv=always
|
||||
msmv_status=stopped
|
||||
)"
|
||||
ini.Write(writethis)
|
||||
ini.Close()
|
||||
Run("Settings.ahk") ; Runs the GUI for changing the settings, accessible with Alt+Shift+\ (also easy way to restart this script)
|
||||
}
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Read the sett_ini
|
||||
;------------------------------------------------------------------------------
|
||||
; This is the part that reads the file to see what your settings are.
|
||||
|
||||
global settings := ini_load(sett_ini)
|
||||
|
||||
; started as global variables, keeping this commented out in case there's some old script where I need to replace something
|
||||
; User Specific things:
|
||||
;global email := settings["Email"]
|
||||
;global docfile := settings["DocFile"]
|
||||
;global jdpn := settings["JDProductNames"]
|
||||
;global glovar := settings["GloVar"]
|
||||
;global ger := settings["German"]
|
||||
+5
-8
@@ -1,11 +1,8 @@
|
||||
[Serial Numbers]
|
||||
1=
|
||||
ch=
|
||||
2=
|
||||
MTG=
|
||||
VIN=
|
||||
[Operations Center]
|
||||
usr=
|
||||
org=
|
||||
v=
|
||||
cm=
|
||||
do=
|
||||
co=
|
||||
[Info]
|
||||
ccms=
|
||||
case=
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 161 KiB |
@@ -0,0 +1,92 @@
|
||||
#Requires AutoHotkey v2 ; v2 only
|
||||
#SingleInstance force
|
||||
CoordMode("Mouse", "Screen")
|
||||
|
||||
waittime := 10000
|
||||
|
||||
for i in A_Args
|
||||
{
|
||||
if (i = "on")
|
||||
{
|
||||
A_IconHidden := 1
|
||||
Start(1,2,3)
|
||||
}
|
||||
else if (i = "off")
|
||||
{
|
||||
ExitApp()
|
||||
}
|
||||
else
|
||||
{
|
||||
MsgBox (i)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
A_TrayMenu.Delete() ; None of the standard tray buttons
|
||||
A_TrayMenu.Add("Hide GUI", GuiToggle) ; Adds a button to toggle the gui
|
||||
A_TrayMenu.Add("Exit", ExtMen) ; Exit button
|
||||
|
||||
myGui := Gui()
|
||||
myGui.Opt("+AlwaysOnTop +ToolWindow")
|
||||
ButtonStart := myGui.Add("Button", "x3 y3 w55 h20 +Center", "Start")
|
||||
ButtonStart.OnEvent("Click", Start.Bind("Normal"))
|
||||
ButtonStop := myGui.Add("Button", "x3 y3 w55 h20 +Center Hidden", "Stop")
|
||||
ButtonStop.OnEvent("Click", Stop.Bind("Normal"))
|
||||
myGui.Title := "msmv"
|
||||
If (A_IconHidden = false)
|
||||
{
|
||||
myGui.Show("h28 w60")
|
||||
}
|
||||
|
||||
|
||||
Start(A_GuiEvent, GuiCtrlObj, Info)
|
||||
{
|
||||
SetTimer(Msmv,waittime) ; Checks if the has been input in the last 2 minutes every 30 secs, easier to stop a loop with SetTimer
|
||||
If (A_IconHidden = false)
|
||||
{
|
||||
ButtonStart.Visible := false
|
||||
ButtonStop.Visible := true
|
||||
}
|
||||
}
|
||||
|
||||
Stop(A_GuiEvent, GuiCtrlObj, Info)
|
||||
{
|
||||
SetTimer(Msmv,0)
|
||||
If (A_IconHidden = false)
|
||||
{
|
||||
ButtonStop.Visible := false
|
||||
ButtonStart.Visible := true
|
||||
}
|
||||
}
|
||||
|
||||
Msmv(*)
|
||||
{
|
||||
If (A_TimeIdle > waittime) ; https://www.autohotkey.com/docs/Variables.htm#User_Idle_Time
|
||||
{
|
||||
x := Random(, A_ScreenWidth)
|
||||
y := Random(, A_ScreenHeight)
|
||||
MouseMove(x, y)
|
||||
}
|
||||
}
|
||||
|
||||
GuiToggle(ItemName, ItemPos, MenuObj)
|
||||
{
|
||||
global
|
||||
If (WinExist("msmv"))
|
||||
{
|
||||
myGui.Destroy()
|
||||
MenuObj.Check(ItemName)
|
||||
}
|
||||
Else
|
||||
{
|
||||
MenuObj.Uncheck(ItemName)
|
||||
myGui.Restore()
|
||||
}
|
||||
Return
|
||||
}
|
||||
|
||||
; exit option from tray menu
|
||||
ExtMen(*)
|
||||
{
|
||||
ExitApp()
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
#SingleInstance force
|
||||
|
||||
; The exe this is compiled into has manual.ico set as its icon.
|
||||
|
||||
!+S::gui()
|
||||
|
||||
gui()
|
||||
{
|
||||
static Number
|
||||
static Hidden
|
||||
|
||||
Gui, +AlwaysOnTop +ToolWindow
|
||||
|
||||
Gui, Add, Edit, x2 y3 w78 h20 vNumber +Left,
|
||||
Gui, Add, Button, x22 y43 w70 h20 Default vHidden, Ok
|
||||
Gui, Add, Button, x81 y3 w17 h20 gHelp +Center, ?
|
||||
Gui, Show, h28 w100, ManSol
|
||||
GuiControl, Hide, Hidden
|
||||
|
||||
Return
|
||||
|
||||
ButtonOk:
|
||||
Gui, submit ; I have no idea what the regex means any more...
|
||||
If RegExMatch(Number, "[[:alpha:]]+")
|
||||
run, % "http://serviceadvisor.deere.com/WebSA/manuals/" . Number
|
||||
Else If RegExMatch(Number, "[[:digit:]]+")
|
||||
run, % "https://ccms.deere.com/prweb/PRServletCustomAuth/ZDate_MgiNPn1ccL6O6pyBurDs0hjFQ8*/!STANDARD?pyActivity=SolutionsSnapStart&Action=showHarness&className=Deere-Int-Solr-Docs&Purpose=SolutionDescriptionNew&SolutionID=" . Number . "&Language=Default"
|
||||
ExitApp
|
||||
Return
|
||||
|
||||
|
||||
Help:
|
||||
Run, https://daviddaily.dev/david/d3k/wiki/ManSol
|
||||
Return
|
||||
|
||||
GuiClose:
|
||||
GuiEscape:
|
||||
Gui, Destroy
|
||||
Return
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
# Standalone ManSol Opener
|
||||
|
||||
This is a standalone version, the help guide can be found [here](https://daviddaily.dev/david/d3k/wiki/ManSol)
|
||||
|
||||
## [Download the executable here](https://files.daviddaily.dev/.d3k/ManSol%20Opener.exe)
|
||||
I would recommend putting it in your startup folder (`%appdata%\Microsoft\Windows\Start Menu\Programs\Startup`) so that it starts automagically when you start your computer.
|
||||
Reference in New Issue
Block a user