Upgrade to AHK v2 #3

Open
david wants to merge 35 commits from tier2 into master
13 changed files with 478 additions and 986 deletions
+6
View File
@@ -0,0 +1,6 @@
*.code-workspace
SmartGooey/*
Projects/*
emails.example.csv
.gitignore
.zip
-172
View File
@@ -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
}
+237 -474
View File
@@ -1,213 +1,100 @@
#Include, func.ahk #Include "func.ahk"
#Include Peep.v2.ahk
Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard DetectHiddenWindows true
;------------------------------------------------------------------------------ A_TrayMenu.Add("&Mouse Mover", MsMv) ; Add item to the tray to move the mouse
; Make sure the settings file exists, if not, create it A_TrayMenu.Add("&Settings", D3K_Settings) ; Add item to the tray for the settings window
;------------------------------------------------------------------------------ A_TrayMenu.Add(A_AhkVersion, docs)
If !FileExist(ini) ; Check if the ini doesn't exist
{
FileAppend,
(
; 0 is off, 1 is on
[USpec]
RACF=LF01234
Email=LastnameFirstname@JohnDeere.com
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")
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")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Global Variables ; Global Variables
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
If (settings["GloVar"])
If (glovar = 1)
{ {
glovarini := A_MyDocuments "\GloVar.ini" ; Location of the ini that the user modifies 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
glovarstart := "#SingleInstance force`n`n:*:$dorg::`n:*:$dus::`n:*:$dnm::`n:*:$dem::`n:*:$xid::`n" GloVar(*){
If !(WinActive("GloVar.ini")){ ; Only run when the window isn't active, prevents accidential editing by the script while the user is editing
SetTimer, GloVar, 2000 ; Check every 2 seconds gvModNew := FileGetTime(glovarini)
If !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini.
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%
if !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini.
{ {
gvMod := gvModNew glovarscript := A_Temp "\GloVar.ahk" ; self-contained, no reference to any other AHK scripts
FileDelete, glovar.ahk ; Start with a clean slate glovarstart := "#Requires AutoHotkey v2`n#SingleInstance force`n#NoTrayIcon`n"
FileAppend, %glovarstart%, glovar.ahk ; makes sure we only have one instance of the script running at a time 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
RESection := "" ; Make sure that its clear glovar_map := ini_load(glovarini)
file := FileOpen(glovarini, "r") For section in glovar_map {
Loop ; Read one line at a time For key, value in glovar_map[section]
{ {
Line := file.ReadLine() Switch section, 0
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) Case "Serial Numbers":
{ value := StrUpper(value) ; Makes it uppercase
Continue ini_write(glovarini, key, value)
} Case "Info":
If InStr(StoredSection, "Serial Numbers") ; If the section is "Serial Numbers", make everything uppercase If (key = "case")
{
StringUpper, REValue, REValue ; Makes it uppercase
WinWaitNotActive, GloVar.ini ; Just to make sure
{ {
ini_write(glovarini, REKey, REValue) value := StrUpper(value) ; Makes it uppercase, just in case it was manually typed
FileGetTime, gvMod, %glovarini% ini_write(glovarini, key, value) ; Writes the properly formatted case number to glovar.ini
}
}
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%
}
}
}
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
if !(REValue = dealinfo.xid)
{
run addemail.ahk
Continue
}
; Replace the data in glovar.ahk with the data from the ini
FileRead, tempglovar, glovar.ahk
tempglovar := RegExReplace(tempglovar, "(?<=\$xid::).*", dealinfo.xid)
tempglovar := RegExReplace(tempglovar, "(?<=\$dem::).*", dealinfo.email)
tempglovar := RegExReplace(tempglovar, "(?<=\$dnm::).*", dealinfo.name)
tempglovar := RegExReplace(tempglovar, "(?<=\$dus::).*", dealinfo.user)
tempglovar := RegExReplace(tempglovar, "(?<=\$dorg::).*", dealinfo.org)
FileAppend, %tempglovar%, tempglovar
FileCopy, tempglovar, glovar.ahk,1
FileDelete, tempglovar
WinWaitNotActive, GloVar.ini
{
ini_write(glovarini, "xID", dealinfo.xid) ; Writes the xID
ini_write(glovarini, "dem", dealinfo.email) ; Writes email address (incredibly useful)
ini_write(glovarini, "dnm", dealinfo.name) ; Writes Name (useful for when referring to that person)
ini_write(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful)
ini_write(glovarini, "dorg", dealinfo.org)
}
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
Continue
}
If (InStr(REKey, "dem") or InStr(REKey, "dnm") or InStr(REKey, "dus"))
{
; Do not process xID related info, that is done above
Continue
}
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" . doctemp . "`n`n" . initemp ; Save the current time, what was in the doc file, and glovarini to a variable
FileAppend, % "`n`n`n`n" writethis "`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
} }
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 Return
}
} }
} Until (file.AtEOF) If (value){ ; skip trying to write a hotstring that doesn't do anything
file.Close() hotstrings .= "`n:*:$" key "::" value
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 Return
} }
@@ -215,79 +102,64 @@ If (glovar = 1)
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Settings window ; 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 cleanup(*) ; to make sure msmv closes when we close d3k
!+S::Run Mansol_Opener.ahk ; Alt+Shift+S {
#If ; these are to make sure one "if" doesn't influence the next accidentially 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
; These things below are for using in a pinch, or when there is no dealer.
SetTitleMatchMode, 2
#If (WinActive = Temp.txt) && (CaseFormatter = "1")
:*:\case::
CurrTime := GetDateTime("en")
Send Call received on %CurrTime% {Enter}Name: {Enter}Username: {Enter}
Return
#If
;German
#If (CaseFormatter = "1") && (ger = "1")
:*:|case::
CurrTime := GetDateTime("de")
Send Anruf wurde am %CurrTime% entgegengenommen{Enter}Name: {Enter}Benutzername: {Enter}
Return
#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 ; Capitalise dates
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
::monday::Monday ::monday::Monday
::tuesday::Tuesday ::tuesday::Tuesday
::wednesday::Wednesday ::wednesday::Wednesday
@@ -295,12 +167,9 @@ SetTitleMatchMode, 2
::friday::Friday ::friday::Friday
::saturday::Saturday ::saturday::Saturday
::sunday::Sunday ::sunday::Sunday
::january::January ::january::January
::february::February ::february::February
; ::march::March ; Commented out because it matches the common word "march".
::april::April ::april::April
; ::may::May ; Commented out because it matches the common word "may".
::june::June ::june::June
::july::July ::july::July
::august::August ::august::August
@@ -309,9 +178,8 @@ SetTitleMatchMode, 2
::november::November ::november::November
::december::December ::december::December
; German ; German
#If, ger = "1" #HotIf (settings["German"])
::montag::Montag ::montag::Montag
::dienstag::Dienstag ::dienstag::Dienstag
::mittwoch::Mittwoch ::mittwoch::Mittwoch
@@ -328,198 +196,45 @@ SetTitleMatchMode, 2
::juli::Juli ::juli::Juli
::oktober::Oktober ::oktober::Oktober
::dezebmer::Dezember ::dezebmer::Dezember
#If #HotIf
;------------------------------------------------------------------------------
; Copypastas
;------------------------------------------------------------------------------
; Recommending case
:*:]rec::
Send Recommending Case, please contact us if there are any further questions.
Return
; Escalatimg Case
:*:]esc1::
Send This case was unable to be resolved and has been transferred to another team. Our Tier 2 team is investigating the issue to find a short term resolution. We will update you as soon as we have a recommendation.
Return
:*:]esc2::
Send A short term resolution still has not been identified. We are requesting an immediate update on this case from our Tier 2 team. We will contact you as soon as we have a status update.
Return
; Requesting info
:*:]req1::
Send A request has been made for additional information in this case. Please provide the information as soon as possible so that the case can be resolved.
Return
:*:]req2::
Send A follow-up request has been made for the additional information.
Return
:*:]req3::
Send The additional information required has not yet been received. This case will now be sent back to you. Please reopen the case, or contact the Global Support Center again via phone or email with the additional information and reference this case number so that it can be reopened and investigated further.
Return
; Defect / NCCA
:*:]ncca::
Send We will be recommending this case back to you for the time being. This issue is still being investigated and worked on via an internal product corrective action ticket. We will continue to monitor the progress of that ticket and contact you when we have a solution or a short term recommendation. The case text will be updated at that time for documentation purposes.{Enter}You may choose to close this case yourself, return it to us, or keep it open until we provide you with a corrective action recommendation. If you have questions on the status of this issue, please re-open the case or contact the Global Support Center using the contact information found in DTAC solution 82793. We will provide you with any information we are able to gather from the product team.
Return
; DTAC
:*:]dtac::
Send The ISG Global Support Center has determined that this case is hardware related; therefore this case is being transferred from the GSC to the ISG DTAC group. A DTAC technician will now work this case via the CCMS system and provide a recommendation in the case text if more information is needed or if a solution has been found. Please continue to update or check on the progress of this case by using the CCMS system case text section moving forward.
Return
; German
#If, ger = "1"
; Recommending Case
:*:[rec::
Send Fall an H{U+00E4}ndler gewiesen, bitte melden Sie sich wenn sie weitere fragen haben.
Return
; Escalating Case
:*:[esc1::
Send Der Fall konnte vom GSC nicht gelöst werden und wurde an die nächste Supportebene weitergeleitet. Das Support Team wird das Problem weiter untersuchen und versuchen eine kurzfristige Lösung bereit zu stellen. Sobald wir eine Empfehlung erhalten, werden wir Sie darüber informieren.
Return
:*:[esc2::
Send Bisher steht uns keine kurzfristige Lösung zur Verfügung. Wir fordern umgehend ein Status-Update bezüglich des Falls von unserem Support Team an.{Shift down}{Enter}{Shift up}Wir werden Sie erneut kontaktieren, sobald wir über den aktuellsten Stand des Falls informiert sind.
Return
; Requesting info
:*:[req1::
Send Wir haben zusätzliche Informationen von Ihnen bezüglich des Falls angefordert. Bitte stellen Sie uns die Informationen so bald wie möglich zur Verfügung, damit der Fall gelöst werden kann.
Return
:*:[req2::
Send Wir fordern die zusätzlichen Informationen von Ihnen erneut an.
Return
:*:[req3::
Send Wir haben die benötigten zusätzlichen Informationen von Ihnen noch nicht erhalten. Dieser Fall wird jetzt zu Ihnen zurückgeschickt. Bitte setzen Sie sich mit dem GSC telefonisch oder per Email mit den zusätzlichen Informationen nochmal in Verbindung und referenzieren Sie die Fallnummer, damit der Fall erneut geöffnet und weiter untersucht werden kann.
Return
; Defect / NCCA
:*:[ncca::
Send Wir werden diesen Fall vorübergehend an Sie zurückweisen. Dieses Problem wird noch über ein innenseitiges Produkt Korrektur Ticket bearbeitet. Wir werden weiterhin den Fortschritt dieses Tickets verfolgen und mit Ihnen Kontakt aufnehmen, wenn wir eine Lösung oder eine kurzfristige Empfehlung haben.{Enter}Sie können diesen Fall selbst schließen, an uns zurückzugeben oder offen halten, bis wir Ihnen eine Korrekturmaßnahme empfehlen. Wenn Sie Fragen zum Fall Status haben wenden Sie sich an das Global Support Center, indem Sie die Kontaktinformationen in der DTAC-Lösung 82793 abrufen. Wir werden Ihnen alle Informationen, die wir von dem Produktteam bekommen haben, zu Verfügung stellen.
Return
; DTAC
:*:[dtac::
Send Das ISG Global Support Center hat festgestellt, dass dieser Fall hardwarebezogen ist; Daher wird dieser Fall vom GSC an die ISG DTAC Gruppe übertragen. Ein DTAC-Techniker wird nun diesen Fall über das DTAC-System bearbeiten und eine Empfehlung im Fall Text geben, wenn weitere Informationen benötigt werden oder wenn eine Lösung gefunden wurde. Dementsprechend bitten wir Sie, den Fortschritt des Falls mithilfe des Falltextes zu überprüfen und falls nötig mit fehlenden Informationen zu ergänzen.
Return
#If
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Email ; Email
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Regular
:*:]email:: :*:]email::
Send Hello,{Enter 2} {Shift down}{Enter}{Shift up}Please contact us if you have any questions.{Up}{End} {
Return Send "Hello,{Enter 2}{Space 3}"
}
; DTAC Problem
:*:]97010::
Send Hello,{Enter 2} As this is a hardware/compatibility related inquiry, we here at the GSC cannot assist you properly. Please contact DTAC and they will be able to assist you further.
Return
; 2 Year old COMAR
:*:]2yc::
Send Hello,{Enter 2} You are unable to activate this product as the COMAR is over 2 years old. There is a form in the Dealer Corner that you can fill out to have it replaced as long as it falls within the criteria outlined in solution 108357.{Enter}Please contact your TCSM if you have any questions about this process.
Return
; CCMS
:*:]cms::
Send Hello,{Enter 2} {Enter}{Home down}{Shift up}{Home up}Please contact us if you have any questions.{Enter 2}Thank you,{Enter}David{Up 4}{End}
Return
#If
; German ; German
#If, ger = "1" #HotIf (settings["German"])
:*:[email::{
; Regular Send "Hallo,{Enter 2}{Space 3}"
:*:[email:: }
Send Hallo,{Enter 2} {Shift down}{Enter}{Shift up}Für Rückfragen stehen wir gerne zur Verfügung.{Up}{End} #HotIf
Return
; DTAC Problem
:*:[97010::
Send Hallo,{Enter 2} Da dies eine Hardware/Kompatibilität-bezogene Anfrage ist, können wir hier im GSC leider ihre Frage nicht sehr gut beantworten. Bitte wenden Sie sich an DTAC, dort können Sie bessere unterstützung für diesen typ von fragen bekommen.
Return
; 2 Year old COMAR
:*:[2yc::
Send Hallo,{Enter 2} Sie können dieses Produkt nicht aktivieren weil die COMAR-Nummer über 2 Yahre alt ist. Es gibt in Vertriebspartnerinformation ein Formular das Sie ausfüllen können, und Ihre Aktivierungen werden ersetzt so lange es innerhalb der Regeln in DTAC Lösung 108357 ist.{Enter}Bitte melden Sie sich bei Ihrem Technischen Bezirksleiter wenn Sie Fragen über diesen Prozess haben.
Return
; CCMS case
:*:[cms::
Send Hallo,{Enter 2} {Enter}{Home down}{Shift up}{Home up}Für Rückfragen stehen wir gerne zur Verfügung.{Enter 2}Mit freundlichen Grüßen,{Enter}David{Up 4}{End}
Return
#If
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Profile email paste ; 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 ; 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
#v::
#If, mjdpaste = "1" {
#v:: Sleep(750)
sleep, 750 SendInput(A_Clipboard)
Send %clipboard% }
sleep, 500
send # ; to make sure the start menu isn't open for some reason
return
#If
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Common Terms autocorrect and replacement ; Common Terms autocorrect and replacement
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
#If, not(racf = "LF01234") ; So that it doesn't put the fake RACF from the default ini file #HotIf (settings["JDProductNames"])
:*:]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
; English ; English
:*:]at::AutoTrac :*:]at::AutoTrac
:*:]sf::StarFire :*:]bna::Basics & AutoTrac
:*:]jdlw::JDLink Web :*:]bfs::Basics for Services
:*:]jdld::JDLink Dashboard :*:]bas::Basics, AutoTrac, and Section Control
:*:]jdl2::JDLink Dashboard 2.0 :*:]jlb::JDLink Boost
:*:]jdlc::JDLink Connect
:*:]jdla::JDLink Access
:*:]jdls::JDLink Subscription
:*:]jdll::JDLink
:*:]jdp::JDParts :*:]jdp::JDParts
:*:]mjd::MyJohnDeere :*:]mjd::MyJohnDeere
:*:]opsc::Operations Center :*:]opsc::Operations Center
@@ -528,7 +243,6 @@ SetTitleMatchMode, 2
:*:]cc::CommandCenter :*:]cc::CommandCenter
:*:]fc::Field Connect :*:]fc::Field Connect
:*:]rs::RowSense :*:]rs::RowSense
:*:]sub::subscription
:*:]ss::Stellar Support :*:]ss::Stellar Support
:*:]tman::Technical Manual :*:]tman::Technical Manual
:*:]oman::Operator's Manual :*:]oman::Operator's Manual
@@ -536,18 +250,22 @@ SetTitleMatchMode, 2
:*:]hlo::Original HarvestLab :*:]hlo::Original HarvestLab
:*:]bin::Virtual Inventory :*:]bin::Virtual Inventory
:*:]warrep::Warranty Reports :*:]warrep::Warranty Reports
:*:]tp::TouchPoint
:*:]tcsm::Territory Customer Support Manager :*:]tcsm::Territory Customer Support Manager
:*:]macrep::Machine Reports
:*:]jdsm::John Deere Software Manager :*:]jdsm::John Deere Software Manager
:*:]jddm::John Deere Data Manager :*:]jddm::John Deere Data Manager
:*:]serva::Service Advisor :*:]serva::Service Advisor
:*:]muc::Master Unlock Code :*:]muc::Master Unlock Code
:*:]deg::{ASC 248} :*:]bsm::Base Station Manager
:*:]eq::{ASC 247} :*:]lm::License Manager
:*:]sns::See & Spray
:*:]s4::SF-RTK
:*:]ls::licenses
:*:]sub::subscription
:*:]agt::AgTech Code
::rowsense::RowSense ::rowsense::RowSense
::comar::COMAR ::comar::COMAR
::comars::COMARs
::mrtk::mRTK ::mrtk::mRTK
::rda::RDA ::rda::RDA
::rtk::RTK ::rtk::RTK
@@ -558,34 +276,34 @@ SetTitleMatchMode, 2
::itec::iTEC Pro ::itec::iTEC Pro
::ssu::SSU ::ssu::SSU
::atu::ATU ::atu::ATU
:*:mtg::MTG :*:mtg::modem
::wdt::WDT
::itc::iTC ::itc::iTC
::vin::VIN ::vin::Machine PIN ; Not actually vehicles, so they don't have VINs
::gs2::GS2 ::gs2::GS2
::gs3::GS3 ::gs3::GS3
::g4::G4
::g5::G5
::sf1::SF1 ::sf1::SF1
::sf2::SF2 ::sf2::SF2
::sf3::SF3 ::sf3::SF3
::sf4::SF4
::xid::xID ::xid::xID
::pmcalc::PMCalc ::pmcalc::PMCalc
::vat::VAT ::VAT::VAT
:*:racf::RACF ::RACF::RACF
::igrade::iGrade ::igrade::iGrade
::ISOBUS::ISOBUS
::JDCP::JDCP
::LORT::LORT
::ISG::ISG
; German ; German
#If, ger = "1" #HotIf (settings["German"])
:*:[at::AutoTrac :*:[at::AutoTrac
:*:[sf::StarFire :*:[bna::Basics & AutoTrac
:*:[jdlw::JDLink Web :*:[bfs::Basics for Services
:*:[jdld::JDLink Dashboard :*:[bas::Basics, AutoTrac, and Section Control
:*:[jdl2::JDLink Dashboard 2.0 :*:[sf4::SF-RTK
:*:[jdlc::JDLink Connect :*:[jlb::JDLink Boost
:*:[jdla::JDLink Access
:*:[jdls::JDLink Abonnement
:*:[jdll::JDLink
:*:[jdp::JDParts :*:[jdp::JDParts
:*:[mjd::MyJohnDeere :*:[mjd::MyJohnDeere
:*:[opsc::Einsatzzentrale :*:[opsc::Einsatzzentrale
@@ -602,38 +320,83 @@ SetTitleMatchMode, 2
:*:[hlo::Originales HarvestLab :*:[hlo::Originales HarvestLab
:*:[bin::Virtuellen Bestand :*:[bin::Virtuellen Bestand
:*:[warrep::Warranty Reports :*:[warrep::Warranty Reports
:*:[tp::TouchPoint
:*:[tcsm::Technischer Bezirksleiter :*:[tcsm::Technischer Bezirksleiter
:*:[macrep::Machine Reports
:*:[jdsm::John Deere Software Manager :*:[jdsm::John Deere Software Manager
:*:[jddm::John Deere Data Manager :*:[jddm::John Deere Data Manager
:*:[serva::Service Advisor :*:[serva::Service Advisor
:*:[muc::Master Unlock Code :*:[muc::Master Unlock Code
:*:[deg::{ASC 248} :*:[asmn::Asset Manager
:*:[eq::{ASC 247} :*:[bsm::Base Station Manager
#If :*:[lm::License Manager
:*:[sns::See & Spray
:*:[s4::SF-RTK
:*:[ls::Lizenz
:*:[agt::AgTech Code
#HotIf
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; QoL Improvements ; QoL Improvements
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
:*:]me::
#j:: :*:[me::
Run, C:\Users\%racf%\Downloads ; Open the downloads folder on Win+J
Return
#w::
if WinActive("ahk_exe Explorer.EXE") ; If windows explorer is focused
{ {
Send !d ; Focus the address bar Send StrUpper(A_UserName)
Send C:\Users\%racf%\Documents\Work_Docs\Cases\2020-01 - 06 ; current folder, would love to use a var instead, but Run doesn't like it
Send {Enter}
Return
} }
Run, C:\Users\%racf%\Documents\Work_Docs\Cases\2020-01 - 06 ; Open the documentation folder on Win+W
Return
#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"))
}
:*:[deg::{ASC 248}
:*:]deg::{ASC 248}
:*:[eq::{ASC 247}
:*:]eq::{ASC 247}
:*:[shrug::
:*:]shrug::
{
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
-33
View File
@@ -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
+62 -123
View File
@@ -1,152 +1,91 @@
#Include, func.ahk #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")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Create GUI ; 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 myGui.Add("Edit", "w200 vEmail", settings["Email"]).OnEvent("LoseFocus", ProcessUserInput) ; settings["Email"]
Gui, Add, Edit, x12 y15 w60 h20 vformRACF gRACF, %RACF%
Gui, Add, GroupBox, x8 y40 w207 h37, Email Address myGui.Add("Text",, "Documentation file:") ; settings["DocFile"]
Gui, Add, Edit, x12 y53 w200 h20 vformEmail gEmail, %Email% myGui.Add("Text",, settings["DocFile"])
myGui.Add("Button",, "Pick a different file").OnEvent("Click", DocSelect)
Gui, Add, GroupBox, x77 y2 w207 h37, Documentation File myGui.Add("Text", "Section", "Text Replacement")
Gui, Add, Text, x81 y19 w200 h20 gDocFile, %docfile% 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 switch settings["msmv"] {
Gui, Add, CheckBox, x12 y95 w100 h30 vformMansol Checked%mansol% gMansol, ManSol case "always-running": ; run at refresh of d3k, currently running
Gui, Add, CheckBox, x12 y125 w100 h30 vformMJDPaste Checked%mjdpaste% gMJDPaste, MJDPaste msmv_check := 1
Gui, Add, CheckBox, x12 y155 w100 h30 vformCaseFormatter Checked%caseformatter% gCaseFormatter, Case Formatter case "always-stopped": ; run at refresh, currently stopped
Gui, Add, CheckBox, x25 y178 w75 h30 vformCFmail Checked%cfmail% gCFmail, Email option msmv_check := 1
GuiControl, show%caseformatter%, formCFmail ; only shows the check box for emails if the Case Formatter box is checked 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 myGui.Add("Checkbox", "vMsmv Checked" . msmv_check, "Mouse Mover: silently start on startup").OnEvent("Click", ProcessUserInput)
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)
Gui, Add, Link, x132 y190 w150 h23 gHelp, <a href="https://daviddaily.dev/david/d3k/wiki">Click here for help</a> (v%d3k_version%) myGui.Add("Link",, "<a href=`"https://daviddaily.dev/david/d3k/wiki`">Click here for help</a>")
myGui.Add("Text",, "AHK Version: " . A_AhkVersion)
Gui, Show, h225 w295, David 3000 Settings myGui.Add("Text",, "D3K version " . d3k_version)
myGui.Title := "D3K settings"
MyGui.OnEvent("Close", ProcessUserInput)
myGui.OnEvent("Escape", End)
myGui.Show("AutoSize")
Return Return
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Edit ini ; Edit ini
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
/* /*
Default ini, sections are in []: (0 is off, 1 is on) Default ini, sections are in []: (0 is off, 1 is on)
[USpec]
RACF=LF01234
[email protected] [email protected]
DocFile=Select File DocFile=Select File
[Main]
Mansol=1
MJDPaste=1
CaseFormatter=1
CFmail=0
[Replacement]
JDProductNames=1 JDProductNames=1
GloVar=0 GloVar=0
[Language]
German=0 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: ProcessUserInput(*)
Gui, Submit, NoHide {
ini_write(ini, "Email", formEmail) Saved := MyGui.Submit(0) ; Save the contents of named controls into an object.
Return 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: DocSelect(*)
Gui, Submit {
FileSelectFile, SelectedFile, 3, , Open a file, Text Documents (*.txt; *.doc) oSaved := myGui.Submit()
if SelectedFile = SelectedFile := FileSelect(3,, "Open a file", "Text Documents (*.txt)")
MsgBox, You have not selected a file, this will break some things. if !(SelectedFile)
MsgBox("You have not selected a file, this will break some things.")
else else
ini_write(ini, "DocFile", SelectedFile) ini_write(sett_ini, "DocFile", SelectedFile)
docfile := ini_get(ini, "USpec", "DocFile") Run("Settings.ahk")
Gui, Show, h225 w295, David 3000 Settings }
Return
Mansol: End(*)
Gui, Submit, NoHide {
ini_write(ini, "Mansol", formMansol) ProcessUserInput()
Return ExitApp
}
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
-33
View File
@@ -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
-4
View File
@@ -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 xID Email Name Demo Username Dealer Org
2 X1 [email protected] Person 1 User 1 554866
3 X2 [email protected] Person 2 User 2 69983
4 X3 [email protected] Person 3 4832
+76 -88
View File
@@ -1,54 +1,11 @@
#SingleInstance force ; Only one instance at a time #Requires AutoHotkey v2 ; v2 only
SendMode, Input #SingleInstance force ; Only one instance at a time
FileEncoding, UTF-8 ; Makes sure the special characters dont break stuff FileEncoding("UTF-8") ; Makes sure the special characters dont break stuff
SetWorkingDir, %A_MyDocuments%\D3K ; Make sure we can find the .ahks linked below 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 ; INI Manipulation that supports UTF-8
@@ -56,56 +13,87 @@ GetInfo(xID)
ini_load(location) ini_load(location)
{ {
File := FileOpen(location, "r") temp := FileOpen(location, "r")
out := {} 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 Loop
{ {
Line := File.ReadLine() Line := temp.ReadLine()
RegExMatch(Line, "(?<=\[).*(?=\])", _RESection) ; Matches section name RegExMatch(Line, "(?<Section>(?<=\[).*(?=\]))|(?<Key>.*)=(?<Value>.*)", &r) ; Key = r.Key, Value = r.Value, Section = r.Section
RegExMatch(Line, "(?<Key>.*)=(?<Value>.*)", _) ; Key = _Key, Value = _Value If (r.Section)
If (_RESection)
{ {
_RESection := StrReplace(_RESection, " ", "_") out[r.Section] := Map()
out[_RESection]:={} curr_section := r.Section
currentSection := _RESection } Else
} Else { {
If (_Value) If (curr_section)
{ {
_Key := StrReplace(_Key, " ", "_") out[curr_section].Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n"))
out[currentSection][_Key] := _Value } Else
{
out.Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n")) ; this handles things with no section
} }
} }
} Until (File.AtEOF) } Until (temp.AtEOF)
File.Close() temp.Close()
Return out 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 := FileOpen(location, "r")
ini_loaded := ini_load(location) temp := ini.Read()
ini.Close()
inSec := StrReplace(inSec, " ", "_") temp := RegExReplace(temp, "(?<=" inKey "=).*", inValue)
inKey := StrReplace(inKey, " ", "_") ini := FileOpen(location, "w")
ini.Write(temp)
needed := ini_loaded[inSec][inKey] ini.Close()
if (needed) ; Without this it doesn't know what to return and gets stuck
{
Return needed
} Else Return false
} }
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% ini := FileOpen(sett_ini, "w")
needle := inKey . "=.*" writethis := "
replacement := inKey . "=" . inValue ( LTrim
tempini := RegExReplace(tempini, needle, replacement,, 1) Email=LastnameFirstname@JohnDeere.com
tempini := RegExReplace(tempini, "\R+\R", "`r`n") DocFile=0
WinWaitNotActive, GloVar.ini JDProductNames=1
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file GloVar=0
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents German=0
FileDelete, tempini ; Delete the fixed temporary ini 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"]
+4 -12
View File
@@ -1,16 +1,8 @@
[Serial Numbers] [Serial Numbers]
1= 1=
ch= v=
2= cm=
MTG= do=
VIN= co=
[Operations Center]
usr=
org=
[Info] [Info]
case= case=
dorg=
dus=
dnm=
dem=
xID=
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

+92
View File
@@ -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
}
-6
View File
@@ -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.