Compare commits

..

No commits in common. "master" and "d3k" have entirely different histories.
master ... d3k

15 changed files with 404 additions and 962 deletions

View File

@ -1,14 +1,14 @@
#Include, func.ahk #Include, func.ahk
SetTitleMatchMode, 2 SetTitleMatchMode, 2
ini = %A_MyDocuments%\D3Ksettings.ini
; 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 ; 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,+AlwaysOnTop
Gui, +ToolWindow Gui, +ToolWindow
docfile := ini_get(ini, "USpec", "DocFile") IniRead, docfile, %ini%, USpec, DocFile, 0
cfmail := ini_get(ini, "Main", "CFmail")
Contact := 2
CurrTimeEN := GetDateTime("en") CurrTimeEN := GetDateTime("en")
CurrTimeDE := GetDateTime("de") CurrTimeDE := GetDateTime("de")
@ -18,24 +18,22 @@ CurrTimeDE := GetDateTime("de")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; 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" ; 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, Text, x75 y46 w150 h20 gTime, %CurrTimeEN%
Gui, Add, Radio, x12 y3 w60 h20 Group vLang Checked, &English ; First group of Radio buttons 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, x12 y23 w60 h20, &German
Gui, Add, Radio, x82 y3 w60 h20 Group vAct, &Warrant Gui, Add, Radio, x82 y3 w60 h20 Group vContact Checked, E-&Mail ; Second group of Radio buttons
Gui, Add, Radio, x82 y23 w60 h20, &Demo Gui, Add, Radio, x82 y23 w60 h20, &Call
Gui, Add, Radio, x142 y3 w80 h20 Group vAct, &Warrant
Gui, Add, Radio, x142 y23 w80 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. 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.
Gui, Show, h70 w210, Contact
if (cfmail) ;GuiControl, Hide, Hidden ; Hide the button to be hidden
{
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 Return
Time: Time:
@ -133,7 +131,7 @@ Write:
FileAppend, Call received %CurrTimeEN%.`n`n, %docfile% FileAppend, Call received %CurrTimeEN%.`n`n, %docfile%
If (Act = "0") ; Not an activation If (Act = "0") ; Not an activation
{ {
FileAppend,Dealer called for , %docfile% FileAppend,Dealer called for, %docfile%
} }
Else If (Act = "1") ; Warrant Else If (Act = "1") ; Warrant
@ -153,17 +151,17 @@ Write:
If (Act = "0") ; Not an activation If (Act = "0") ; Not an activation
{ {
FileAppend,Händler rief an mit , %docfile% FileAppend,Händler rief an mit, %docfile%
} }
Else If (Act = "1") ; Warrant Else If (Act = "1") ; Warrant
{ {
FileAppend,Händler rief an für eine Garantieübertragung`nAlte SN: `nNeue SN: `nAuthentisierungscode: `n`n, %docfile% FileAppend,Händler rief an für Garantieübertragung`nAlte SN: `nNeue SN: `nAuthentisierungscode: `n`n, %docfile%
} }
Else If (Act = "2") ; Demo Else If (Act = "2") ; Demo
{ {
FileAppend,Händler rief an für eine Demo`nSN: `nAuthentisierungscode: `n`n, %docfile% FileAppend,Händler rief an für Demo`nSN: `nAuthentisierungscode: `n`n, %docfile%
} }
} }
} }

466
D3K.ahk
View File

@ -1,7 +1,12 @@
#Include, func.ahk #Include, func.ahk
Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard
Menu, Tray, Add, MouseMover ; Add item to tray icon right click for mouse mover
SetWorkingDir, %A_MyDocuments%\D3K ; Make sure we can find the .ahks linked below
ini = %A_MyDocuments%\D3Ksettings.ini ; Where the settings ini is
ini_writeValue(ini, "Version", "2.6")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Make sure the settings file exists, if not, create it ; Make sure the settings file exists, if not, create it
@ -15,18 +20,18 @@ FileAppend,
[USpec] [USpec]
RACF=LF01234 RACF=LF01234
Email=LastnameFirstname@JohnDeere.com Email=LastnameFirstname@JohnDeere.com
Name=Firstname
DocFile=Select File DocFile=Select File
[Main] [Main]
Mansol=1 Mansol=1
MJDPaste=1 MJDPaste=1
CaseFormatter=1 CaseFormatter=1
CFmail=0
[Replacement] [Replacement]
JDProductNames=1 JDProductNames=1
GloVar=0 GloVar=0
[Language] [Language]
German=0 German=0
[Info]
Version=2.6
), %ini% ), %ini%
Run Settings.ahk ; Runs the GUI for changing the settings, also accessible with Alt+Shift+\ (also easy way to restart this script) Run Settings.ahk ; Runs the GUI for changing the settings, also accessible with Alt+Shift+\ (also easy way to restart this script)
} }
@ -37,23 +42,22 @@ Run Settings.ahk ; Runs the GUI for changing the settings, also accessible with
; 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 ; 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: ; User Specific things:
racf := ini_get(ini, "USpec", "RACF") racf := ini_getValue(ini, "USpec", "RACF")
email := ini_get(ini, "USpec", "Email") email := ini_getValue(ini, "USpec", "Email")
name := ini_get(ini, "USpec", "Name") docfile := ini_getValue(ini, "USpec", "DocFile")
docfile := ini_get(ini, "USpec", "DocFile")
; General Settings ; General Settings
mansol := ini_get(ini, "Main", "Mansol") mansol := ini_getValue(ini, "Main", "Mansol")
supadmin := ini_get(ini, "Main", "Supadmin") supadmin := ini_getValue(ini, "Main", "Supadmin")
mjdpaste := ini_get(ini, "Main", "MJDPaste") mjdpaste := ini_getValue(ini, "Main", "MJDPaste")
caseformatter := ini_get(ini, "Main", "CaseFormatter") caseformatter := ini_getValue(ini, "Main", "CaseFormatter")
; Replacement ; Replacement
jdpn := ini_get(ini, "Replacement", "JDProductNames") jdpn := ini_getValue(ini, "Replacement", "JDProductNames")
glovar := ini_get(ini, "Replacement", "GloVar") glovar := ini_getValue(ini, "Replacement", "GloVar")
; Language ; Language
ger := ini_get(ini, "Language", "German") ger := ini_getValue(ini, "Language", "German")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Global Variables ; Global Variables
@ -61,135 +65,144 @@ ger := ini_get(ini, "Language", "German")
If (glovar = 1) If (glovar = 1)
{ {
glovarini := A_MyDocuments "\GloVar.ini" ; Location of the ini that the user modifies 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"
glovarstart := "#SingleInstance force`n`n:*:$dus::`n:*:$dnm::`n:*:$dem::`n:*:$xid::`n"
SetTimer, GloVar, 2000 ; Check every 2 seconds SetTimer, GloVar, 2000 ; Check every 2 seconds
GloVar: GloVar:
WinWaitNotActive, GloVar.ini ; So that we don't get any problems with the file on disk being out of date. I use VSCode with the "Save on lose focus" option on, YMMV 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 FileGetTime, gvModNew, %glovarini%
FileDelete, glovar.ahk ; Start with a clean slate if !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini.
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
{ {
Line := file.ReadLine() gvMod := gvModNew
RegExMatch(Line, "(?<=\[).*(?=\])", RESection) ; explained above FileDelete, glovar.ahk ; Start with a clean slate
RegExMatch(Line, "^(?<Key>.*)=(?<Value>.*)", RE) ; Key = REKey, Value = REValue FileAppend, %glovarstart%, glovar.ahk ; makes sure we only have one instance of the script running at a time
If (RESection && InStr(StoredSection := RESection, "clear")) ; Found a clear section RESection := "" ; Make sure that its clear
Loop, Read, %glovarini% ; Read one line at a time
{ {
; Will clear the ini and save its and the documentation file's contents to a log RegExMatch(A_LoopReadLine, "(?<=\[).*(?=\])", RESection) ; explained above
FileRead, doctemp, %docfile% ; Read documentation file, set in settings RegExMatch(A_LoopReadLine, "^(?<Key>.*)=(?<Value>.*)", RE) ; Key = REKey, Value = REValue
FileRead, initemp, %glovarini% ; Read the ini
initemp := RegExReplace(initemp, "(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info If !(RESection) ; If the RegEx doesn't find antything, its empty
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 If !(REValue) ; If there is no value for the key, skip it (Continue the loop at the next line)
}
Return
} else if (RESection) { ; found a different section
StoredSection := RESection
continue
}
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%
MsgBox, test
}
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 Continue
} }
; Replace the data in glovar.ahk with the data from the ini If InStr(StoredSection, "Serial Numbers") ; If the section is "Serial Numbers", make everything uppercase
FileRead, tempglovar, glovar.ahk {
tempglovar := RegExReplace(tempglovar, "(?<=\$xid::).*", dealinfo.xid) StringUpper, REValue, REValue ; Makes it uppercase
tempglovar := RegExReplace(tempglovar, "(?<=\$dem::).*", dealinfo.email) WinWaitNotActive, GloVar.ini ; Just to make sure
tempglovar := RegExReplace(tempglovar, "(?<=\$dnm::).*", dealinfo.name) {
tempglovar := RegExReplace(tempglovar, "(?<=\$dus::).*", dealinfo.user) ini_writeValue(glovarini, REKey, REValue)
tempglovar := RegExReplace(tempglovar, "(?<=\$dorg::).*", dealinfo.org) FileGetTime, gvMod, %glovarini%
FileAppend, %tempglovar%, tempglovar }
FileCopy, tempglovar, glovar.ahk,1 }
FileDelete, tempglovar If InStr(StoredSection, "Operations Center") ; If the section is "Operations Center" and the Key "un", make it uppercase
WinWaitNotActive, GloVar.ini {
ini_write(glovarini, "xID", dealinfo.xid) ; Writes the xID If InStr(REKey, "usr")
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) StringUpper, REValue, REValue ; Makes it uppercase
ini_write(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful) WinWaitNotActive, GloVar.ini
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 ini_writeValue(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini
Continue 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_writeValue(glovarini, REKey, REMatch) ; Writes the properly formatted case number to glovar.ini
FileGetTime, gvMod, %glovarini%
}
REValue := REMatch
} Else {
WinWaitNotActive, GloVar.ini
{
ini_writeValue(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
Break
}
; Replace the data in glovar.ahk with the data from the ini
FileRead, tempglovar, glovar.ahk
tempglovar := RegExReplace(tempglovar, "(?<=\$dem::).*", dealinfo.email)
tempglovar := RegExReplace(tempglovar, "(?<=\$dnm::).*", dealinfo.name)
tempglovar := RegExReplace(tempglovar, "(?<=\$dus::).*", dealinfo.user)
tempglovar := RegExReplace(tempglovar, "(?<=\$xid::).*", dealinfo.xid)
FileAppend, %tempglovar%, tempglovar
FileCopy, tempglovar, glovar.ahk,1
FileDelete, tempglovar
WinWaitNotActive, GloVar.ini
{
ini_writeValue(glovarini, "xID", REValue) ; Writes the xID entered, but uppercase
ini_writeValue(glovarini, "dem", dealinfo.email) ; Writes email address (incredibly useful)
ini_writeValue(glovarini, "dnm", dealinfo.name) ; Writes Name (useful for when referring to that person)
ini_writeValue(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful)
}
FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code
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 (InStr(REKey, "dem") or InStr(REKey, "dnm") or InStr(REKey, "dus")) If (RESection) ; If we have a section
{ {
; Do not process xID related info, that is done above StoredSection := RESection
Continue 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
FileCopy, glovarsource, %glovarini%, 1 ; Copies and replaces any text in glovar.ini with the template
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
}
Break
}
} }
writethis := ":*:$" REKey "::" REValue "`n" ; Save the hotstring to a variable
FileAppend, %writethis%, glovar.ahk ; Write the variable to glovar.ahk
} }
} Until (file.AtEOF) 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
file.Close() If FileExist("glovar.ahk")
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
{ }
Run glovar.ahk
} }
} }
Return Return
@ -202,9 +215,6 @@ If (glovar = 1)
!+\::Run Settings.ahk ; Alt+Shift+\ !+\::Run Settings.ahk ; Alt+Shift+\
MouseMover:
Run, msmv.ahk
Return
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; DTAC Solution Opener ; DTAC Solution Opener
@ -408,28 +418,47 @@ SetTitleMatchMode, 2
; Regular ; Regular
:*:]email:: :*:]email::
Send Hello,{Enter 2}{Space 3} Send Hello,{Enter 2} {Shift down}{Enter}{Shift up}Please contact us if you have any questions.{Up}{End}
Return Return
; Cases ; 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:: :*:]cms::
Send Hello,{Enter 2}{Space 3}{Enter}{Home down}{Shift up}{Home up}{Enter}Thank you,{Enter}%name%{Up 3}{End} 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 Return
#If #If
; German ; German
#If, ger = "1" #If, ger = "1"
; Regular ; Regular
:*:[email:: :*:[email::
Send Hallo,{Enter 2}{Space 3} Send Hallo,{Enter 2} {Shift down}{Enter}{Shift up}Für Rückfragen stehen wir gerne zur Verfügung.{Up}{End}
Return Return
; Case ; 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:: :*:[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} 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 Return
#If #If
@ -480,107 +509,104 @@ SetTitleMatchMode, 2
; English ; English
:*:]at::AutoTrac :*:]at::AutoTrac
:*:]bin::Virtual Inventory :*:]sf::StarFire
:*:]cc::CommandCenter :*:]jdlw::JDLink Web
:*:]deg::{ASC 248} :*:]jdld::JDLink Dashboard
:*:]eq::{ASC 247} :*:]jdl2::JDLink Dashboard 2.0
:*:]fc::Field Connect :*:]jdlc::JDLink Connect
:*:]jdla::JDLink Access
:*:]jdls::JDLink Subscription
:*:]jdll::JDLink
:*:]jdp::JDParts
:*:]mjd::MyJohnDeere
:*:]opsc::Operations Center
:*:]seccon::Section Control
:*:]gs::GreenStar :*:]gs::GreenStar
:*:]gp::GSC-Prepared :*:]cc::CommandCenter
:*:]fc::Field Connect
:*:]rs::RowSense
:*:]sub::subscription
:*:]ss::Stellar Support
:*:]tman::Technical Manual
:*:]operm::Operator's Manual
:*:]hl3::HarvestLab 3000 :*:]hl3::HarvestLab 3000
:*:]hlo::Original HarvestLab :*:]hlo::Original HarvestLab
:*:]jddm::John Deere Data Manager :*:]bin::Virtual Inventory
:*:]jdl2::JDLink Dashboard 2.0
:*:]jdla::JDLink Access
:*:]jdlc::JDLink Connect
:*:]jdld::JDLink Dashboard
:*:]jdll::JDLink
:*:]jdls::JDLink Subscription
:*:]jdlw::JDLink Web
:*:]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
:*:]serva::Service Advisor
:*:]sf::StarFire
:*:]ss::Stellar Support
:*:]sub::subscription
:*:]tcsm::Territory Customer Support Manager
:*:]tman::Technical Manual
:*:]tp::TouchPoint
:*:]warrep::Warranty Reports :*:]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
:*:]deg::{ASC 248}
:*:]eq::{ASC 247}
:*:mtg::MTG ::rowsense::RowSense
:*:racf::RACF ::comar::COMAR
:*:vin::VIN ::mrtk::mRTK
::atu::ATU ::rda::RDA
::rtk::RTK
::autotrac::AutoTrac ::autotrac::AutoTrac
::ccms::CCMS ::ccms::CCMS
::comar::COMAR
::dtac::DTAC ::dtac::DTAC
::tcsm::TCSM
::itec::iTEC Pro
::ssu::SSU
::atu::ATU
:*:mtg::MTG
::wdt::WDT
::itc::iTC
::vin::VIN
::gs2::GS2 ::gs2::GS2
::gs3::GS3 ::gs3::GS3
::igrade::iGrade
::itc::iTC
::itec::iTEC Pro
::mrtk::mRTK
::pmcalc::PMCalc
::rda::RDA
::rowsense::RowSense
::rtk::RTK
::sf1::SF1 ::sf1::SF1
::sf2::SF2 ::sf2::SF2
::sf3::SF3 ::sf3::SF3
::sf4::SF4 ::sf4::SF4
::ssu::SSU
::tcsm::TCSM
::vat::VAT
::wdt::WDT
::xid::xID ::xid::xID
::pmcalc::PMCalc
::vat::VAT
:*:racf::RACF
; German ; German
#If, ger = "1" #If, ger = "1"
:*:[at::AutoTrac :*:[at::AutoTrac
:*:[bin::Virtuellen Bestand :*:[sf::StarFire
:*:[cc::CommandCenter :*:[jdlw::JDLink Web
:*:[deg::{ASC 248} :*:[jdld::JDLink Dashboard
:*:[eq::{ASC 247} :*:[jdl2::JDLink Dashboard 2.0
:*:[fc::Field Connect :*:[jdlc::JDLink Connect
:*:[jdla::JDLink Access
:*:[jdls::JDLink Abonnement
:*:[jdll::JDLink
:*:[jdp::JDParts
:*:[mjd::MyJohnDeere
:*:[opsc::Einsatzzentrale
:*:[seccon::Teilbreitensteuerung
:*:[gs::GreenStar :*:[gs::GreenStar
:*:[gp::GSC-Prepared :*:[cc::CommandCenter
:*:[fc::Field Connect
:*:[rs::RowSense
:*:[sub::Abonnement
:*:[ss::Stellar Support
:*:[tman::Technische Betriebsanleitung
:*:[oman::Betriebsanleitung
:*:[hl3::HarvestLab 3000 :*:[hl3::HarvestLab 3000
:*:[hlo::Originales HarvestLab :*:[hlo::Originales HarvestLab
:*:[jddm::John Deere Data Manager :*:[bin::Virtuellen Bestand
:*:[jdl2::JDLink Dashboard 2.0
:*:[jdla::JDLink Access
:*:[jdlc::JDLink Connect
:*:[jdld::JDLink Dashboard
:*:[jdll::JDLink
:*:[jdls::JDLink Abonnement
:*:[jdlw::JDLink Web
:*:[jdp::JDParts
:*:[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 :*:[warrep::Warranty Reports
:*:[tp::TouchPoint
:*:[tcsm::Technischer Bezirksleiter
:*:[macrep::Machine Reports
:*:[jdsm::John Deere Software Manager
:*:[jddm::John Deere Data Manager
:*:[serva::Service Advisor
:*:[muc::Master Unlock Code
:*:[deg::{ASC 248}
:*:[eq::{ASC 247}
#If #If
@ -591,19 +617,19 @@ SetTitleMatchMode, 2
; QoL Improvements ; QoL Improvements
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
#j:: ; Open the downloads folder on Win+J #j::
Run, C:\Users\%racf%\Downloads Run, C:\Users\%racf%\Downloads ; Open the downloads folder on Win+J
Return Return
#w:: ; Open My Documents folder on Win+W #w::
if WinActive("ahk_exe Explorer.EXE") ; If windows explorer is focused if WinActive("ahk_exe Explorer.EXE") ; If windows explorer is focused
{ {
Send !d ; Focus the address bar Send !d ; Focus the address bar
Send C:\Users\%racf%\Documents 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} Send {Enter}
Return Return
} }
Run, C:\Users\%racf%\Documents Run, C:\Users\%racf%\Documents\Work_Docs\Cases\2020-01 - 06 ; Open the documentation folder on Win+W
Return Return

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://serviceadvisor.deere.com/WebSA/solutions/en/" . Number
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

View File

@ -1,6 +1,6 @@
# Welcome To David3000 # Welcome To David3000
This was by me to replace text and do text correction at work. All Credit for the name goes to William Cross (RIP). This was made By David Daily to replace text and do text correction for John Deere GSC Employees. All Credit for the name goes to William Cross (RIP).
## **`Alt+Shift+\` to open a settings window to easily change your settings** **`Alt+Shift+\` to open a settings window to easily change your settings**
### You can find the rest of the info in [the wiki tab up there](https://daviddaily.dev/david/d3k/wiki) You can find the rest of the info in [the wiki tab up there](https://daviddaily.dev/david/d3k/wiki)

View File

@ -1,31 +1,37 @@
#SingleInstance force ; Only one instance at a time
SendMode, Input
FileEncoding, UTF-8 ; Makes sure the special characters don't break stuff
#Include, func.ahk #Include, func.ahk
Menu, Tray, Icon, shell32.dll, 283 Menu, Tray, Icon, shell32.dll, 283
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Read ini ; Read ini
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
ini = %A_MyDocuments%\D3Ksettings.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 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: ; User Specific things:
racf := ini_get(ini, "USpec", "RACF") racf := ini_getValue(ini, "USpec", "RACF")
email := ini_get(ini, "USpec", "Email") email := ini_getValue(ini, "USpec", "Email")
name := ini_get(ini, "USpec", "Name") docfile := ini_getValue(ini, "USpec", "DocFile")
docfile := ini_get(ini, "USpec", "DocFile")
; General Settings ; General Settings
mansol := ini_get(ini, "Main", "Mansol") mansol := ini_getValue(ini, "Main", "Mansol")
mjdpaste := ini_get(ini, "Main", "MJDPaste") mjdpaste := ini_getValue(ini, "Main", "MJDPaste")
caseformatter := ini_get(ini, "Main", "CaseFormatter") caseformatter := ini_getValue(ini, "Main", "CaseFormatter")
cfmail := ini_get(ini, "Main", "CFmail")
; Replacement ; Replacement
jdpn := ini_get(ini, "Replacement", "JDProductNames") jdpn := ini_getValue(ini, "Replacement", "JDProductNames")
glovar := ini_get(ini, "Replacement", "GloVar") glovar := ini_getValue(ini, "Replacement", "GloVar")
; Language ; Language
ger := ini_get(ini, "Language", "German") ger := ini_getValue(ini, "Language", "German")
; Info
d3k_version := ini_getValue(ini, "Info", "Version")
d3k_version := RTrim(d3k_version, "0") ; it was returning the value with appended zeroes, that's not neccesary.
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Create GUI ; Create GUI
@ -35,73 +41,65 @@ Gui, -MaximizeBox -MinimizeBox ; Remove the max+min buttons
Gui, Add, GroupBox, x8 y2 w67 h37, RACF Gui, Add, GroupBox, x8 y2 w67 h37, RACF
Gui, Add, Edit, x12 y15 w60 h20 vformRACF gRACF, %RACF% Gui, Add, Edit, x12 y15 w60 h20 vformRACF gRACF, %RACF%
Gui, Add, GroupBox, x85 y2 w200 h37, First Name
Gui, Add, Edit, x89 y15 w193 h20 vformName gName, %Name%
Gui, Add, GroupBox, x8 y40 w207 h37, Email Address Gui, Add, GroupBox, x8 y40 w207 h37, Email Address
Gui, Add, Edit, x12 y53 w200 h20 vformEmail gEmail, %Email% Gui, Add, Edit, x12 y53 w200 h20 vformEmail gEmail, %Email%
Gui, Add, GroupBox, x8 y83 w107 h130, Main Gui, Add, GroupBox, x77 y2 w207 h37, Documentation File
Gui, Add, Text, x81 y19 w200 h20 gDocFile, %docfile%
Gui, Add, GroupBox, x8 y83 w107 h105, Main
Gui, Add, CheckBox, x12 y95 w100 h30 vformMansol Checked%mansol% gMansol, ManSol 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 y125 w100 h30 vformMJDPaste Checked%mjdpaste% gMJDPaste, MJDPaste
Gui, Add, CheckBox, x12 y155 w100 h30 vformCaseFormatter Checked%caseformatter% gCaseFormatter, Case Formatter 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
Gui, Add, GroupBox, x8 y215 w277 h40 vformDocFile, Documentation File
Gui, Add, Text, x15 y231 w260 h20 vformDocFile2 gDocFile, %docfile%
GuiControl, show%caseformatter%, formDocFile ; only shows the documentation file field if the Case Formatter box is checked
GuiControl, show%caseformatter%, formDocFile2
Gui, Add, GroupBox, x128 y83 w157 h75, Text Replacement Gui, Add, GroupBox, x128 y83 w157 h105, Text Replacement
Gui, Add, CheckBox, x132 y95 w150 h30 vformJdpn Checked%jdpn% gJdpn, JD Product Names Gui, Add, CheckBox, x132 y95 w150 h30 vformSymb Checked%symb% gSymb, Symbols
Gui, Add, CheckBox, x132 y125 w150 h30 vformGlovar Checked%glovar% gGlovar, Global Variables Gui, Add, CheckBox, x132 y125 w150 h30 vformJdpn Checked%jdpn% gJdpn, JD Product Names
Gui, Add, CheckBox, x132 y155 w100 h30 vformGer Checked%ger% gGer, DE ([ as prefix) Gui, Add, CheckBox, x132 y155 w150 h30 vformGlovar Checked%glovar% gGlovar, Global Variables
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, Add, CheckBox, x12 y187 w100 h30 vformGer Checked%ger% gGer, DE ([ as prefix)
Gui, Add, Button, x132 y190 w150 h23 gHelp, Click here for help (v%d3k_version%)
Gui, Show, h263 w295, David 3000 Settings Gui, Show, h225 w295, David 3000 Settings
Return Return
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Edit ini ; Edit ini
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
/* /*
Default ini, sections are in []: (0 is off, 1 is on) Default ini, sections are in []:
[USpec] [USpec]
RACF=LF01234 RACF=LF01234
Email=LastnameFirstname@JohnDeere.com Email=LastnameFirstname@JohnDeere.com
Name=Firstname DocFile=
DocFile=Select File
[Main] [Main]
Mansol=1 Mansol=1
MJDPaste=1 MJDPaste=1
CaseFormatter=1 CaseFormatter=1
CFmail=0
[Replacement] [Replacement]
JDProductNames=1 JDProductNames=1
GloVar=0 GloVar=0
[Language] [Language]
German=0 German=0
[Info]
Version=2.5
format for below: format for below:
Button G-label (executes when clicked): Button G-label (executes when clicked):
Submit the gui so that it can change and don't hide it 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 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: RACF:
Gui, Submit, NoHide Gui, Submit, NoHide
ini_write(ini, "RACF", formRACF) ini_writeValue(ini, "RACF", formRACF)
Return
Name:
Gui, Submit, NoHide
ini_write(ini, "Name", formName)
Return Return
Email: Email:
Gui, Submit, NoHide Gui, Submit, NoHide
ini_write(ini, "Email", formEmail) ini_writeValue(ini, "Email", formEmail)
Return Return
DocFile: DocFile:
@ -110,53 +108,44 @@ DocFile:
if SelectedFile = if SelectedFile =
MsgBox, You have not selected a file, this will break some things. MsgBox, You have not selected a file, this will break some things.
else else
ini_write(ini, "DocFile", SelectedFile) ini_writeValue(ini, "DocFile", SelectedFile)
docfile := ini_get(ini, "USpec", "DocFile") docfile := ini_getValue(ini, "USpec", "DocFile")
Gui, Show, h225 w295, David 3000 Settings Gui, Show, h225 w295, David 3000 Settings
Return Return
Mansol: Mansol:
Gui, Submit, NoHide Gui, Submit, NoHide
ini_write(ini, "Mansol", formMansol) ini_writeValue(ini, "Mansol", formMansol)
Return Return
MJDPaste: MJDPaste:
Gui, Submit, NoHide Gui, Submit, NoHide
ini_write(ini, "MJDPaste", formMJDPaste) ini_writeValue(ini, "MJDPaste", formMJDPaste)
Return Return
CaseFormatter: CaseFormatter:
Gui, Submit, NoHide Gui, Submit, NoHide
GuiControl, show%formCaseFormatter%, formCFmail ; only shows the check box for emails if the Case Formatter box is checked ini_writeValue(ini, "CaseFormatter", formCaseFormatter)
GuiControl, show%formCaseFormatter%, formDocFile
GuiControl, show%formCaseFormatter%, formDocFile2
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 Return
CFmail:
Gui, Submit, NoHide
ini_write(ini, "CFmail", formCFmail)
Return
Jdpn: Jdpn:
Gui, Submit, NoHide Gui, Submit, NoHide
ini_write(ini, "JDProductNames", formJdpn) ini_writeValue(ini, "JDProductNames", formJdpn)
Return Return
Glovar: Glovar:
Gui, Submit, NoHide Gui, Submit, NoHide
ini_write(ini, "GloVar", formGlovar) ini_writeValue(ini, "GloVar", formGlovar)
Return Return
Ger: Ger:
Gui, Submit, NoHide Gui, Submit, NoHide
ini_write(ini, "German", formGer) ini_writeValue(ini, "German", formGer)
Return Return
Help: Help:
Gui, Submit Gui, Submit
Run, https://daviddaily.dev/david/d3k/wiki
Return Return
GuiClose: GuiClose:

View File

@ -1,19 +1,17 @@
#Include, func.ahk #Include, func.ahk
Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard
csv = %A_MyDocuments%\emails.csv ; Where the email CSV is SetWorkingDir, %A_MyDocuments%\D3K ; Make sure we can find the .ahks linked below
csv = %A_MyDocuments%\Work_Docs\emails.csv ; Where the email CSV is
glovarini := A_MyDocuments "\GloVar.ini"
Xid := ini_get(glovarini, "Info", "xID")
Gui, +AlwaysOnTop +ToolWindow Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text, x2 y2 w60 h17 +Center, xID Gui, Add, Text, x2 y2 w60 h17 +Center, xID
Gui, Add, Text, x65 y2 w120 h17 +Center, Email Gui, Add, Text, x65 y2 w120 h17 +Center, Name
Gui, Add, Text, x190 y2 w100 h17 +Center, Name Gui, Add, Text, x190 y2 w100 h17 +Center, Email
Gui, Add, Edit, x2 y17 w60 h20 vXid, %Xid% Gui, Add, Edit, x2 y17 w60 h20 vXid
Gui, Add, Edit, x65 y17 w120 h20 vEmail Gui, Add, Edit, x65 y17 w120 h20 vName
Gui, Add, Edit, x190 y17 w100 h20 vName Gui, Add, Edit, x190 y17 w100 h20 vEmail
Gui, Add, Button, x172 y89 w70 h30 Default, OK Gui, Add, Button, x172 y89 w70 h30 Default, OK
@ -24,7 +22,7 @@ ButtonOK:
Gui, Submit Gui, Submit
writethis := Xid . "," . Email . "," . Name writethis := Xid . "," . Email . "," . Name
FileAppend, % "`n" writethis, %csv% FileAppend, % "`n" writethis, %csv%
ini_write(A_MyDocuments "\GloVar.ini", "dem", Email) Clipboard := Xid
Return Return

View File

@ -1,4 +1,4 @@
xID,Email,Name,Demo Username,Dealer Org xID,Email,Name,Demo Username
X1,test1@example.com,Person 1,User 1,554866 X1,test1@example.com,Person 1,User 1
X2,test2@example.com,Person 2,User 2,69983 X2,test2@example.com,Person 2,User 2
X3,test3@example.com,Person 3,,4832 X3,test3@example.com,Person 3
1 xID xID,Email,Name,Demo Username Email Name Demo Username Dealer Org
2 X1 X1,test1@example.com,Person 1,User 1 test1@example.com Person 1 User 1 554866
3 X2 X2,test2@example.com,Person 2,User 2 test2@example.com Person 2 User 2 69983
4 X3 X3,test3@example.com,Person 3 test3@example.com Person 3 4832

View File

@ -3,14 +3,14 @@ SendMode, Input
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
d3k_version = 2.9 ; The current version d3k_version = 2.5 ; The current version
ini = %A_MyDocuments%\D3Ksettings.ini ; Where the settings ini is settini = %A_MyDocuments%\D3Ksettings.ini ; Where the settings ini is
GetDateTime(lang) GetDateTime(lang)
{ {
UTCTimestamp := A_NowUTC ; Grab the current time and date UTCTimestamp := A_NowUTC ; Grab the current time and date
UTCFormatStr := "yyyy-MM-dd" ; The Date UTCFormatStr := "yyyy-MM-dd" ; This is what we want it to look like
FormatTime, DateStr, %UTCTimestamp%, %UTCFormatStr% ; format it to make it look like the Date we want FormatTime, DateStr, %UTCTimestamp%, %UTCFormatStr% ; format it to make it look like the Date we want
UTCFormatStr := "H:mm' GMT'" ; The time UTCFormatStr := "H:mm' GMT'" ; The time
FormatTime, TimeStr, %UTCTimestamp%, %UTCFormatStr% ; Format the string to be better FormatTime, TimeStr, %UTCTimestamp%, %UTCFormatStr% ; Format the string to be better
@ -25,44 +25,37 @@ GetDateTime(lang)
} }
} }
GetInfo(xID) GetInfo(xID) ; Accept what is passed here as the variable "xID" in the script
{ {
if (xID) if (xID)
{ {
File := FileOpen(A_MyDocuments "\emails.csv", "r") Loop, Read, %A_MyDocuments%\Work_Docs\emails.csv ; read every line of "emails.csv"
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 Array := StrSplit(A_LoopReadLine,",") ; split the line at its separating commas to get separate "columns" AKA elements
File.Close() ; Close the file if InStr(Array[1],xID) ; if at the specified element (1) the specified content (dealers xID) has been found,
Return Test ; Return the array with the deets that we found Break ; stop searching
} }
} Until (File.AtEOF) Test:= {xid: Array[1], email: Array[2], name: Array[3], user: Array[4]} ; Return the array so we can do {variable}.email and so on
File.Close() Return Test
Return false
} }
if !(xID) if !(xID)
{ {
Return false Return
} }
} }
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; INI Manipulation that supports UTF-8 ; INI Manipulation that supports UTF-8
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
ini_load(location) ini_load(location)
{ {
File := FileOpen(location, "r")
out := {} out := {}
Loop Loop, Read, %location%
{ {
Line := File.ReadLine() RegExMatch(A_LoopReadLine, "(?<=\[).*(?=\])", _RESection) ; Matches section name
RegExMatch(Line, "(?<=\[).*(?=\])", _RESection) ; Matches section name RegExMatch(A_LoopReadLine, "(?<Key>.*)=(?<Value>.*)", _) ; Key = _Key, Value = _Value
RegExMatch(Line, "(?<Key>.*)=(?<Value>.*)", _) ; Key = _Key, Value = _Value
If (_RESection) If (_RESection)
{ {
@ -76,12 +69,11 @@ ini_load(location)
out[currentSection][_Key] := _Value out[currentSection][_Key] := _Value
} }
} }
} Until (File.AtEOF) }
File.Close()
Return out Return out
} }
ini_get(location, inSec, inKey) ini_getValue(location, inSec, inKey)
{ {
ini_loaded := {} ini_loaded := {}
ini_loaded := ini_load(location) ini_loaded := ini_load(location)
@ -89,21 +81,15 @@ ini_get(location, inSec, inKey)
inSec := StrReplace(inSec, " ", "_") inSec := StrReplace(inSec, " ", "_")
inKey := StrReplace(inKey, " ", "_") inKey := StrReplace(inKey, " ", "_")
needed := ini_loaded[inSec][inKey] Return ini_loaded[inSec][inKey]
if (needed) ; Without this it doesn't know what to return and gets stuck
{
Return needed
} Else Return false
} }
ini_write(location, inKey, inValue) ini_writeValue(location, inKey, inValue)
{ {
FileRead, tempini, %location% FileRead, tempini, %location%
needle := inKey . "=.*" needle := inKey . "=.*"
replacement := inKey . "=" . inValue replacement := inKey . "=" . inValue
tempini := RegExReplace(tempini, needle, replacement,, 1) tempini := RegExReplace(tempini, needle, replacement,, 1)
tempini := RegExReplace(tempini, "\R+\R", "`r`n")
WinWaitNotActive, GloVar.ini WinWaitNotActive, GloVar.ini
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file FileAppend, %tempini%, tempini ; Append the fixed ini to a new file
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents

View File

@ -9,7 +9,6 @@ usr=
org= org=
[Info] [Info]
case= case=
dorg=
dus= dus=
dnm= dnm=
dem= dem=

View File

@ -1,63 +0,0 @@
#SingleInstance, force
CoordMode, Mouse, Screen
waittime := 180000
Switch A_Args[1]
{
Case "on":
Menu, Tray, NoIcon
Goto, Start
Case "off":
ExitApp
}
Menu, Tray, Add, Hide GUI, GuiToggle ; Adds a button to toggle the gui
Menu, Tray, Add, Exit, GuiClose ; Exit button
Menu, Tray, NoStandard ; None of the standard tray buttons
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Button, x3 y3 w55 h20 gStart +Center, Start
Gui, Add, Button, x3 y3 w55 h20 gStop +Center, Stop
Gui, Show, h28 w60, msmv
GuiControl, Hide, Stop ; Since we want the Start button to show first
Return
Start:
GuiControl, Hide, Start
SetTimer, Msmv, %waittime% ; Checks if the has been input in the last 2 minutes every 30 secs, easier to stop a loop with SetTimer
GuiControl, Show, Stop
Return
Stop:
GuiControl, Hide, Stop
SetTimer, Msmv, off
GuiControl, Show, Start
Return
Msmv:
If (A_TimeIdle > waittime) ; https://www.autohotkey.com/docs/Variables.htm#User_Idle_Time
{
Random, x,, %A_ScreenWidth%
Random, y,, %A_ScreenHeight%
MouseMove %x%, %y%
}
Return
GuiToggle:
If !nogui
{
Gui, Hide
Menu, Tray, Check, Hide GUI
nogui := True
}
Else
{
Menu, Tray, uncheck, Hide GUI
nogui := False
Gui, Show
}
Return
GuiClose:
GuiEscape:
ExitApp ; Closes the app when escape or the exit button is pressed

View File

@ -1,306 +0,0 @@
#SingleInstance force ; We only want one of these running at a time...
FileEncoding, UTF-8
Menu, Tray, Icon, %A_MyDocuments%\D3K\icons\coffeecup.ico
DetectHiddenWindows, On ; This is so that it can identIfy that the window exists since we have it not show up in the taskbar
Total := 60 ; Total break time in minutes
KeepThis := 1 ; Just a variable to save things
winx := 1 ; When these two are set to 1, it puts the window at the center
winy := 1
ugly := False
If FileExist("T_Msg.ahk")
{
#Include T_Msg.ahk
}
;------------------------------------------------------------------------------
; Main GUI creation
;------------------------------------------------------------------------------
ShowGUI: ; Easy way to recreate the window for the pretty color
Gui, main:+AlwaysOnTop
Gui, main:+ToolWindow ; Removes the minimize and maximize buttons, removes it from the taskbar
Gui, main:Add, Progress, x2 y1 w110 h14 Range0-60 -Smooth vProgress, %Total% ; Slider at the top, a nice visual
Gui, main:Add, Text, x43 y23 w27 h20 vTotal +Center, %Total% ; The total time left
Gui, main:Add, Edit, x72 y20 w30 h20 +Number vInput +Center, ; Input box for the length of your break
Gui, main:Add, Button, x2 y20 w40 h20 gLock, Lock ; Button to lock PC
Gui, main:Add, Text, x2 y23 w40 h20 vLocked, Locked ; Text that confirmes that your PC is locked
Gui, main:Add, Button, x2 y20 w40 h20 gBreakButton vBrek, Break ; Button to start break
Gui, main:Add, Button, x2 y20 w40 h20 gEnd, End ; Button to end break
Gui, main:Add, Button, x21 y83 w70 h30 Default gLength, Length ; Button that is default so that when you press enter on the input field it puts you on that long of a break and also locks the PC
; Hide the things we don't want to see when it starts up
GuiControl, Hide, Subtract
GuiControl, Hide, Lock
GuiControl, Hide, Locked
GuiControl, Hide, End
If (ugly = True){
GuiControl, -cGreen, Progress
}
; AI to make it show the window where it was before (explained later)
If (winx="1" And winy="1"){ ; The default values assigned at the beginning of the script
WinLoc := "Center" ; Shows the window in the center of the screen (basically only on startup)
}
Else{
WinLoc = x%winx% y%winy% ; Saved further down in the script when clicking on End
}
Gui, main:Show, h45 w115 %WinLoc%, Break time ; Show the GUI
Return
GuiClose:
ExitApp ; Make sure that it doesn't keep running when the close button is clicked
Return
;------------------------------------------------------------------------------
; Main GUI buttons
;------------------------------------------------------------------------------
Length:
LWD := True
Goto, GuiContextMenu
Return
BreakButton: ; Starts your break for the length you entered in the field
GuiControl, Hide, Brek ; Hide the Break button
Send, #+B ; Hotkey for default Break Time (10 mins)
Gui, main:submit, NoHide
GuiControl, Show, Lock ; Show the Lock button
uploop := True ; Set this to true so that it doesn't exit after one run
BreakLength = 10 ; Default break length
BegWarned = False
HalfBreakLength := BreakLength // 2
HBWarned = False
WarnLength := BreakLength - 2
EBWarned = False
SetTimer, UpTimer, 1000 ; Function for updating the graphics
StartTime := A_TickCount ; Saves the time that we started at in Milliseconds
KeepThis := Total ; Saves the current total to a dIfferent variable so that If there are errors while it is updating, it doesn't mess with anything else
GuiControl, +cRed, Progress ; Changes the color of the progress bar to red. It is the entire reason that the GUI needs to be destroyed and then recreated
Sleep, 3000 ; Show the lock button for 2 seconds
GuiControl, Hide, Lock ; Remove the lock button
GuiControl, Show, End ; Show the end button
Return
Lock: ; Locks the PC
Gui, main:submit, NoHide
GuiControl, Hide, Lock ; If you can't figure this one out by now, you might need to RTFM
GuiControl, Show, Locked
Run rundll32.exe user32.dll`,LockWorkStation ; Locks PC by calling the DLL. just sending Win+L sadly doesn't work
Sleep, 1000
GuiControl, Hide, Locked
GuiControl, Show, End
uploop := True ; No real reason to do this, but it can't hurt
Return
End: ; Ends your break
Send, #+B ; Break hotkey
GuiControl, Hide, End
SetTimer, UpTimer, Off ; Stop the live updating loop
ElapsedTime := A_TickCount - StartTime ; grabs the current time in MS, and subtracts it from the TickCount that we recorded earlier
ELSeconds := ElapsedTime/1000 ; Convert to seconds
ELMins := ELSeconds/60 ; Convert to minutes
ELMins := Round(ELMins, 2) ; Round it off to 2 places
Total := (KeepThis-ELMins) ; Subtract the elapsed minutes (in ##.##0000) from the total
Total := SubStr(Total, 1, 2) ; Trim off the total cause it now has a bunch of useless zeros at the end, and we don't want to see those
WinGetActiveStats, Title, Width, Height, winx, winy ; Save the current position to variables, first three are there cause it is required
SetTimer, UpTimer, Off ; Make sure the dang thing turns off
Gui, main:Destroy ; I couldn't find a way to get the default Win10 green with the flashing part back, so we're just gonna destroy it and make a new one at the exact same place
Goto, ShowGUI ; Just goes to the top to create the GUI again, but this time at the locations saved from earlier.
GuiControl,, Total, %Total% ; ModIfy the time at the bottom and progress bar to be accurate
GuiControl,, Progress, %Total%
If (ugly = True)
{
GuiControl, -cGreen, Progress
}
Sleep, 1000 ; A little bit of break time so that you don't immediatley go back into break accidentially
GuiControl, Show, Brek
uploop := False ; Make sure the dang thing turns off
; Delete previous message
Return
GuiContextMenu:
mousegetpos,,,, name
If InStr(name, "Button")
{
Return
}
;Since there isn't a return here, right clicking anywhere other than the button will show the second GUI, as well as pressing Escape
;------------------------------------------------------------------------------
; Second GUI
;------------------------------------------------------------------------------
GuiEscape:
Gui, 2: Destroy ; Just in case there is one open already
WinGetActiveStats, Title, Width, Height, winx, winy ; Save the current position to variables, other ones are there cause it was required
Gui, 2: +AlwaysOnTop
Gui, 2: +ToolWindow
Gui, 2: Add, Edit, x2 y2 w40 h20 +Number vSubInput +Center, ; Input box for when you manually do a break
Gui, 2: Add, Button, x21 y83 w70 h30 Default gSubtract, Subtract
winy += 75
winx += 35
Win2Loc = x%winx% y%winy% ; Makes the little popup show up centered below the break window
Gui, 2: Show, w45 h25 %Win2Loc%, Subtract from Total time ; Show the GUI
Return
;------------------------------------------------------------------------------
; Second GUI buttons
;------------------------------------------------------------------------------
Subtract: ; The default button, subtracts the time you entered into the field from the total
gui, 2:submit, Hide ; Makes sure the GUI doesn't dissapear when you submit it
Total := (Total - SubInput) ; Subtracts what you entered from the total time
GuiControl,, Total, %Total% ; ModIfy the time at the bottom and progress bar to be accurate
GuiControl,, Progress, %Total%
Gui, 2:Destroy
WinActivate, Break Time
WinGetActiveStats, Title, Width, Height, winx, winy ; Save the current position to variables, first three are there cause it is required
Gui, main:Destroy
Goto, ShowGUI ; Just goes to the top to create the GUI again, but this time at the locations saved from earlier.
Return
2GuiClose: ; From the close button
2GuiEscape: ; From pressing escape
Gui, 2: Destroy
Return
;------------------------------------------------------------------------------
; GUI to remove green color
;------------------------------------------------------------------------------
2GuiContextMenu: ; Because one nested GUI isn't enough
MsgBox, 4148, Color Change, Remove the flashing green?
IfMsgBox, Yes
{
GuiControl, -cGreen, Progress
ugly := True
}
Return
UpTimer:
ElapsedTime := A_TickCount - StartTime ; grabs the current time in MS, and subtracts it from the time that we recorded earlier
ELSeconds := ElapsedTime // 1000 ; Convert to seconds
ELMins := ELSeconds // 60 ; Convert to minutes
ELMins := Round(ELMins) ; Round it off to nearest Intreger
Update := (Total-ELMins) ; Subtract the elapsed minutes from the total
GuiControl,, Progress, %Update% ; Update the time left at the bottom and progress bar
GuiControl,, Total, %Update%
If FileExist("T_Msg.ahk")
{
If (BegWarned = "False")
{
If (HalfBreakLength >= WarnLength)
{
BegWarned = True
HBWarned = True
T_SendMsg("info",1,BreakLength " Minute break started, will warn on " HalfBreakLength " mins left.`n<code>" Total " mins of break time left</code>")
}
If (HalfBreakLength < WarnLength)
{
BegWarned = True
T_SendMsg("info",1,BreakLength " Minute break started, will warn on " HalfBreakLength " mins and " WarnLength " mins elapsed.`n<code>" Total " mins of break time left</code>")
}
Temp := Update
}
}
If FileExist("T_Msg.ahk")
{
If !(Temp > Update)
{
Temp := Update
If (HBWarned = "False")
{
If (ELMins = HalfBreakLength)
{
; Delete previous message
T_SendMsg("alert", 1, "Break is half over, " HalfBreakLength " mins left.`n<code>" Update " mins of break time left</code>")
HBWarned = True
}
If (HalfBreakLength >= WarnLength)
{
T_Edit("info",1,BreakLength " Minute break started, will warn on " HalfBreakLength " mins left.`n<code>" Update " mins of total break time left</code>")
}
If (HalfBreakLength < WarnLength)
{
T_Edit("info",1,BreakLength " Minute break started, will warn on " HalfBreakLength " mins and " WarnLength " mins elapsed.`n<code>" Update " mins of total break time left</code>")
}
}
If (HBWarned = "True")
{
If (HalfBreakLength >= WarnLength)
{
T_Edit("info",1,BreakLength " Minute break started, warned on " HalfBreakLength " mins left.`n<code>" Update " mins of total break time left</code>")
}
If (HalfBreakLength < WarnLength)
{
T_Edit("info",1,BreakLength " Minute break started, warned on " HalfBreakLength " mins, will warn again on " WarnLength " mins elapsed.`n<code>" Update " mins of total break time left</code>")
}
}
If (EBWarned = "False")
{
If (ELMins = WarnLength)
{
T_SendMsg("hand", 3, "<b>Break is almost over, 2 mins left of your " BreakLength " minute break!</b>`n<code>" Update " mins of break time left</code>")
EBWarned = True
}
Else
{
If (HalfBreakLength >= WarnLength)
{
T_Edit("info",1,BreakLength " Minute break started, will warn on " HalfBreakLength " mins left.`n<code>" Update " mins of total break time left</code>")
}
If (HalfBreakLength < WarnLength)
{
T_Edit("info",1,BreakLength " Minute break started, will warn on " HalfBreakLength " mins and " WarnLength " mins elapsed.`n<code>" Update " mins of total break time left</code>")
}
}
}
If (EBWarned = "True")
{
If (HalfBreakLength >= WarnLength)
{
T_Edit("hand", 3, "<b>Break is almost over, 2 mins left of your " BreakLength " minute break!</b>`n<code>" Update " mins of total break time left</code>")
}
If (HalfBreakLength < WarnLength)
{
T_Edit("hand", 3, "<b>Break is almost over, 2 mins left of your " BreakLength " minute break!</b>`n<code>" Update " mins of total break time left</code>")
}
}
}
}
Return

View File

@ -1,145 +0,0 @@
; Sauce: https://www.autohotkey.com/boards/viewtopic.php?t=24919
T_SendMsg(Option,EmojiPosition,Text)
{
ini = %A_MyDocuments%\D3Ksettings.ini ; Where the ini is
IniRead, TelegramBotToken, %ini%, Info, TBToken, 0
IniRead, TelegramBotChatID, %ini%, Info, TBChatID, 0
if !(TelegramBotToken)
{
Return
}
if (Option = "hand")
{
TelegramIconString := "%E2%9D%8C"
}
if (Option = "question")
{
TelegramIconString := "%E2%9D%94"
}
if (Option = "alert")
{
TelegramIconString := "%E2%9A%A0%EF%B8%8F"
}
if (Option = "info")
{
TelegramIconString := "%E2%84%B9%EF%B8%8F"
}
IfInString, Option, `%
TelegramIconString := Option
Text := StrReplace(Text, "`n", "%0A")
If (EmojiPosition = 1)
{
Text = %TelegramIconString% %Text%
}
If (EmojiPosition = 2)
{
Text = %Text% %TelegramIconString%
}
If (EmojiPosition = 3)
{
Text = %TelegramIconString% %Text% %TelegramIconString%
}
loop 3
{
UrlDownloadToFile https://api.telegram.org/bot%TelegramBotToken%/sendmessage?chat_id=%TelegramBotChatID%&parse_mode=HTML&text=%Text%, %A_ScriptDir%\Tlog
sleep 1000
ifexist %A_ScriptDir%\Tlog
{
break
}
if A_index = 3
{
MsgBox, 16,, Something went wrong with sending the Telegram message.
}
}
}
T_Edit(Option,EmojiPosition,Text)
{
ini = %A_MyDocuments%\D3Ksettings.ini ; Where the ini is
IniRead, TelegramBotToken, %ini%, Info, TBToken, 0
IniRead, TelegramBotChatID, %ini%, Info, TBChatID, 0
if !(TelegramBotToken)
{
Return
}
if (Option = "hand")
{
TelegramIconString := "%E2%9D%8C"
}
if (Option = "question")
{
TelegramIconString := "%E2%9D%94"
}
if (Option = "alert")
{
TelegramIconString := "%E2%9A%A0%EF%B8%8F"
}
if (Option = "info")
{
TelegramIconString := "%E2%84%B9%EF%B8%8F"
}
IfInString, Option, `%
TelegramIconString := Option
Text := StrReplace(Text, "`n", "%0A")
If (EmojiPosition = 1)
{
Text = %TelegramIconString% %Text%
}
If (EmojiPosition = 2)
{
Text = %Text% %TelegramIconString%
}
If (EmojiPosition = 3)
{
Text = %TelegramIconString% %Text% %TelegramIconString%
}
FileRead, Tlog, %A_ScriptDir%/Tlog
RegExMatch(Tlog, "(?<=""ok"":).", success)
If (success = "t") ; Check to see if message editing succeeded
{
RegExMatch(Tlog, "(?<=""message_id"":)...", message_id)
}
If (success = "f") ; Check to see if message editing succeeded
{
RegExMatch(Tlog, "(?<=""description"":"").+(?="")", error_msg)
MsgBox, %error_msg%
Return
}
loop 3
{
UrlDownloadToFile https://api.telegram.org/bot%TelegramBotToken%/editMessageText?chat_id=%TelegramBotChatID%&message_id=%message_id%&parse_mode=HTML&text=%Text%, %A_ScriptDir%\Tlog
sleep 1000
ifexist %A_ScriptDir%\Tlog
{
break
}
if A_index = 3
{
MsgBox, 16,, Something went wrong with updating the Telegram message.
}
}
}

Binary file not shown.

View File

@ -1,5 +1,4 @@
#SingleInstance force #SingleInstance force
Menu, Tray, Add, Open Manual/Solution, gui
; The exe this is compiled into has manual.ico set as its icon. ; The exe this is compiled into has manual.ico set as its icon.
@ -25,13 +24,13 @@ gui()
If RegExMatch(Number, "[[:alpha:]]+") If RegExMatch(Number, "[[:alpha:]]+")
run, % "http://serviceadvisor.deere.com/WebSA/manuals/" . Number run, % "http://serviceadvisor.deere.com/WebSA/manuals/" . Number
Else If RegExMatch(Number, "[[:digit:]]+") Else If RegExMatch(Number, "[[:digit:]]+")
run, % "https://serviceadvisor.deere.com/WebSA/solutions/en/" . Number 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 ExitApp
Return Return
Help: Help:
Run, https://daviddaily.dev/david/d3k/wiki/ManSol-Opener-Standalone MsgBox, 262176, Manual & Solution opener, Press Alt+Shift+S to open the window.`nInput the TM/OM SKU (easily found on TechPubs) or the DTAC solution number to open it in your default browser.`nTMs & OMs open in Service Advisor.
Return Return
GuiClose: GuiClose:

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.