2020-05-19 10:16:33 -05:00
#Include , func . ahk
2019-12-17 10:57:15 -06:00
Menu , Tray , Icon , shell32 . dll , 283 ; Set the tray icon to a keyboard
2020-05-18 16:32:10 -05:00
Menu , Tray , Add , MouseMover ; Add item to the tray to move the mouse
2019-12-17 10:57:15 -06:00
;------------------------------------------------------------------------------
; Make sure the settings file exists, if not, create it
;------------------------------------------------------------------------------
If ! FileExist ( ini ) ; Check if the ini doesn't exist
{
FileAppend ,
(
; 0 is off, 1 is on
[ USpec ]
RACF = LF01234
Email = LastnameFirstname@JohnDeere . com
2020-03-27 14:04:32 -05:00
Name = Firstname
2019-12-17 10:57:15 -06:00
DocFile = Select File
[ Main ]
Mansol = 1
MJDPaste = 1
CaseFormatter = 1
2020-02-19 09:09:10 -06:00
CFmail = 0
2019-12-17 10:57:15 -06:00
[ 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:
2020-02-03 02:54:31 -06:00
racf := ini_get ( ini , " USpec " , " RACF " )
email := ini_get ( ini , " USpec " , " Email " )
2020-03-27 14:04:32 -05:00
name := ini_get ( ini , " USpec " , " Name " )
2020-02-03 02:54:31 -06:00
docfile := ini_get ( ini , " USpec " , " DocFile " )
2019-12-17 10:57:15 -06:00
; General Settings
2020-02-03 02:54:31 -06:00
mansol := ini_get ( ini , " Main " , " Mansol " )
supadmin := ini_get ( ini , " Main " , " Supadmin " )
mjdpaste := ini_get ( ini , " Main " , " MJDPaste " )
caseformatter := ini_get ( ini , " Main " , " CaseFormatter " )
2019-12-17 10:57:15 -06:00
; Replacement
2020-02-03 02:54:31 -06:00
jdpn := ini_get ( ini , " Replacement " , " JDProductNames " )
glovar := ini_get ( ini , " Replacement " , " GloVar " )
2019-12-17 10:57:15 -06:00
; Language
2020-02-03 02:54:31 -06:00
ger := ini_get ( ini , " Language " , " German " )
2019-12-17 10:57:15 -06:00
;------------------------------------------------------------------------------
; Global Variables
;------------------------------------------------------------------------------
If ( glovar = 1 )
{
2020-02-03 02:54:31 -06:00
glovarini := A_MyDocuments " \GloVar.ini " ; Location of the ini that the user modifies
2019-12-17 10:57:15 -06:00
2020-05-18 16:32:10 -05:00
glovarstart := " #SingleInstance force`n`n "
2020-01-09 06:58:36 -06:00
2019-12-17 10:57:15 -06:00
SetTimer , GloVar , 2000 ; Check every 2 seconds
2020-01-08 09:07:42 -06:00
GloVar:
2019-12-17 10:57:15 -06:00
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
{
2020-01-02 05:31:40 -06:00
FileGetTime , gvModNew , %glovarini%
if ! ( gvModNew = gvMod ) ; Those two lines mean the rest of this only executes if there were changes to the ini.
2019-12-17 10:57:15 -06:00
{
2020-01-02 05:31:40 -06:00
gvMod := gvModNew
2019-12-17 10:57:15 -06:00
FileDelete , glovar . ahk ; Start with a clean slate
2020-01-09 06:58:36 -06:00
FileAppend , %glovarstart% , glovar . ahk ; makes sure we only have one instance of the script running at a time
2019-12-17 10:57:15 -06:00
RESection := " " ; Make sure that its clear
2020-01-24 03:23:31 -06:00
file := FileOpen ( glovarini , " r " )
Loop ; Read one line at a time
2019-12-17 10:57:15 -06:00
{
2020-01-24 03:23:31 -06:00
Line := file . ReadLine ( )
RegExMatch ( Line , " (?<=\[).*(?=\]) " , RESection ) ; explained above
RegExMatch ( Line , " ^(?<Key>.*)=(?<Value>.*) " , RE ) ; Key = REKey, Value = REValue
2019-12-17 10:57:15 -06:00
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
{
2020-02-03 02:54:31 -06:00
ini_write ( glovarini , REKey , REValue )
2020-01-02 05:31:40 -06:00
FileGetTime , gvMod , %glovarini%
2019-12-17 10:57:15 -06:00
}
}
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
{
2020-02-03 02:54:31 -06:00
ini_write ( glovarini , REKey , REValue ) ; Writes the properly formatted case number to glovar.ini
2020-01-02 05:31:40 -06:00
FileGetTime , gvMod , %glovarini%
2019-12-17 10:57:15 -06:00
}
}
}
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
{
2020-02-03 02:54:31 -06:00
ini_write ( glovarini , REKey , REMatch ) ; Writes the properly formatted case number to glovar.ini
2020-01-02 05:31:40 -06:00
FileGetTime , gvMod , %glovarini%
2019-12-17 10:57:15 -06:00
}
REValue := REMatch
} Else {
WinWaitNotActive , GloVar . ini
{
2020-02-03 02:54:31 -06:00
ini_write ( glovarini , REKey , REValue ) ; Writes the properly formatted case number to glovar.ini
2020-01-02 05:31:40 -06:00
FileGetTime , gvMod , %glovarini%
2019-12-17 10:57:15 -06:00
}
}
}
2020-01-08 09:07:42 -06:00
writethis := " :*:$ " REKey " :: " REValue " `n " ; Save the hotstring to a variable
FileAppend , %writethis% , glovar . ahk ; Write the variable to glovar.ahk
2019-12-17 10:57:15 -06:00
}
2020-01-24 03:23:31 -06:00
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"
2020-02-03 02:54:31 -06:00
2020-03-27 14:04:32 -05:00
writethis := " Case on " . CurrTime . " `n `n `n " . doctemp . " `n `n " . initemp ; Save the current time, what was in the doc file, and glovarini to a variable
FileAppend , % " `n `n " writethis " `n `n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " , %A_MyDocuments% / D3KLog . txt ; Write a few new lines , the content, and a line underneath
2020-02-03 02:54:31 -06:00
FileAppend , , temptemp
2020-01-24 03:23:31 -06:00
FileCopy , glovarsource , %glovarini% , 1 ; Copies and replaces any text in glovar.ini with the template
2020-02-03 02:54:31 -06:00
FileCopy , temptemp , %docfile% , 1 ; These two this close together makes it look like they get cleared at the same time
FileDelete , temptemp
2020-01-24 03:23:31 -06:00
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
2020-02-03 02:54:31 -06:00
2020-01-24 03:23:31 -06:00
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
}
2020-02-03 02:54:31 -06:00
Return
2020-01-24 03:23:31 -06:00
}
}
} Until ( file . AtEOF )
file . Close ( )
2020-01-02 05:31:40 -06:00
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
2019-12-20 07:42:46 -06:00
If FileExist ( " glovar.ahk " )
2020-01-03 09:12:30 -06:00
{
Run glovar . ahk
}
2019-12-17 10:57:15 -06:00
}
}
Return
}
;------------------------------------------------------------------------------
; Settings window
;------------------------------------------------------------------------------
! + \: : Run Settings . ahk ; Alt+Shift+\
2020-05-18 16:32:10 -05:00
MouseMover:
Run , msmv . ahk
Return
2019-12-17 10:57:15 -06:00
;------------------------------------------------------------------------------
; DTAC Solution Opener
;------------------------------------------------------------------------------
#If , mansol = " 1 " ; checks from the variable thats set from the .ini file
!+S:: Run Mansol_Opener . ahk ; Alt+Shift+S
#If ; these are to make sure one "if" doesn't influence the next accidentially
;------------------------------------------------------------------------------
; Case Formatter
;------------------------------------------------------------------------------
#If , CaseFormatter = " 1 "
Pause : : Run Case_Formatter . ahk ; The Pause|Break key
#If
;-------------------------------------------------------------------------------
; Special Characters
;-------------------------------------------------------------------------------
#If , ger = " 1 "
; scharfes s / Eszett / ß
!s:: Send { U + 00 DF } ;Alt+S
; ä
!a:: Send { U + 00E4 } ;Alt+a
; ö
!o:: Send { U + 00 F6 } ;Alt+o
; ü
!u:: Send { U + 00 FC } ;Alt+u
; Ä
+!A:: Send { U + 00 C4 } ;Alt+A
; Ö
+!O:: Send { U + 00 D6 } ;Alt+O
; Ü
+!U:: Send { U + 00 DC } ;Alt+U
#If
;-------------------------------------------------------------------------------
; Capitalise dates
;-------------------------------------------------------------------------------
: : monday : : Monday
: : tuesday : : Tuesday
: : wednesday : : Wednesday
: : thursday : : Thursday
: : friday : : Friday
: : saturday : : Saturday
: : sunday : : Sunday
: : january : : January
: : february : : February
; ::march::March ; Commented out because it matches the common word "march".
: : april : : April
; ::may::May ; Commented out because it matches the common word "may".
: : june : : June
: : july : : July
: : august : : August
: : september : : September
: : october : : October
: : november : : November
: : december : : December
; German
#If , ger = " 1 "
::montag:: Montag
::dienstag:: Dienstag
::mittwoch:: Mittwoch
::donnerstag:: Donnerstag
::freitag:: Freitag
::samstag:: Samstag
::sonntag:: Sonntag
::januar:: Januar
::februar:: Februar
::märz:: März
::mai:: Mai
::juni:: Juni
::juli:: Juli
::oktober:: Oktober
::dezebmer:: Dezember
#If
;------------------------------------------------------------------------------
; Copypastas
;------------------------------------------------------------------------------
2020-03-27 14:04:32 -05:00
;STWA Applied
: * : ] cms : :
2020-05-18 16:32:10 -05:00
Send STWA applied { Enter 2 } Status : Providing information { Enter 2 } Comments : { Space } { Enter 2 } Thank you , { Enter } %name% { Enter 2 } Tier 2 internal steps : { Space } { Up 5 } { End }
2019-12-17 10:57:15 -06:00
Return
;------------------------------------------------------------------------------
; Email
;------------------------------------------------------------------------------
; Regular
: * : ] email : :
2020-03-10 15:38:31 -05:00
Send Hello , { Enter 2 } { Space 3 }
2019-12-17 10:57:15 -06:00
Return
2020-03-10 15:38:31 -05:00
; Cases
2019-12-17 10:57:15 -06:00
: * : ] cms : :
2020-03-27 14:04:32 -05:00
Send Hello , { Enter 2 } { Space 3 } { Enter } { Home down } { Shift up } { Home up } { Enter } Thank you , { Enter } %name% { Up 3 } { End }
2019-12-17 10:57:15 -06:00
Return
#If
2020-03-10 15:38:31 -05:00
2019-12-17 10:57:15 -06:00
; German
#If , ger = " 1 "
; Regular
: * : [ email : :
2020-03-10 15:38:31 -05:00
Send Hallo , { Enter 2 } { Space 3 }
2019-12-17 10:57:15 -06:00
Return
2020-03-10 15:38:31 -05:00
; Case
2019-12-17 10:57:15 -06:00
: * : [ cms : :
2020-03-27 14:04:32 -05:00
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 }
2019-12-17 10:57:15 -06:00
Return
#If
;------------------------------------------------------------------------------
; Profile email paste
;------------------------------------------------------------------------------
; So when editing Profiles, it won't let you paste in the email field. We don't like that. Make sure to let go of all keys immediatley after pressing this
#If , mjdpaste = " 1 "
#v::
sleep , 750
Send %clipboard%
sleep , 500
send # ; to make sure the start menu isn't open for some reason
return
#If
;------------------------------------------------------------------------------
; Common Terms autocorrect and replacement
;------------------------------------------------------------------------------
#If , not ( racf = " LF01234 " ) ; So that it doesn't put the fake RACF from the default ini file
: * : ] me : :
Send , %racf%
return
: * : [ me : :
Send , %racf%
return
#If
2019-12-20 07:42:46 -06:00
#If , not ( email = " LastnameFirstname@JohnDeere.com " ) ; Same as above
2019-12-17 10:57:15 -06:00
: * : @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
: * : ] at : : AutoTrac
: * : ] sf : : StarFire
: * : ] jdlw : : JDLink Web
: * : ] jdld : : JDLink Dashboard
: * : ] jdl2 : : JDLink Dashboard 2.0
: * : ] jdlc : : JDLink Connect
: * : ] jdla : : JDLink Access
: * : ] jdls : : JDLink Subscription
: * : ] jdll : : JDLink
: * : ] jdp : : JDParts
: * : ] mjd : : MyJohnDeere
: * : ] opsc : : Operations Center
: * : ] seccon : : Section Control
: * : ] gs : : GreenStar
: * : ] cc : : CommandCenter
: * : ] fc : : Field Connect
: * : ] rs : : RowSense
: * : ] sub : : subscription
: * : ] ss : : Stellar Support
: * : ] tman : : Technical Manual
2020-02-27 02:42:00 -06:00
: * : ] oman : : Operator 's Manual
2019-12-17 10:57:15 -06:00
: * : ] hl3 : : HarvestLab 3000
: * : ] hlo : : Original HarvestLab
: * : ] bin : : Virtual Inventory
: * : ] 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
2020-03-27 14:04:32 -05:00
: * : ] asmn : : Asset Manager
2019-12-17 10:57:15 -06:00
::rowsense:: RowSense
::comar:: COMAR
::mrtk:: mRTK
::rda:: RDA
::rtk:: RTK
::autotrac:: AutoTrac
::ccms:: CCMS
::dtac:: DTAC
::tcsm:: TCSM
::itec:: iTEC Pro
::ssu:: SSU
::atu:: ATU
: * : mtg : : MTG
::wdt:: WDT
::itc:: iTC
2020-03-10 15:38:31 -05:00
: * : vin : : VIN
2019-12-17 10:57:15 -06:00
::gs2:: GS2
::gs3:: GS3
::sf1:: SF1
::sf2:: SF2
::sf3:: SF3
::sf4:: SF4
::xid:: xID
::pmcalc:: PMCalc
::vat:: VAT
2020-01-14 08:37:11 -06:00
: * : racf : : RACF
2020-01-21 05:05:31 -06:00
::igrade:: iGrade
2019-12-17 10:57:15 -06:00
; German
#If , ger = " 1 "
: * : [ at : : AutoTrac
: * : [ sf : : StarFire
: * : [ jdlw : : JDLink Web
: * : [ jdld : : JDLink Dashboard
: * : [ jdl2 : : JDLink Dashboard 2.0
: * : [ jdlc : : JDLink Connect
: * : [ jdla : : JDLink Access
: * : [ jdls : : JDLink Abonnement
: * : [ jdll : : JDLink
: * : [ jdp : : JDParts
: * : [ mjd : : MyJohnDeere
: * : [ opsc : : Einsatzzentrale
: * : [ seccon : : Teilbreitensteuerung
: * : [ gs : : GreenStar
: * : [ cc : : CommandCenter
: * : [ fc : : Field Connect
: * : [ rs : : RowSense
: * : [ sub : : Abonnement
: * : [ ss : : Stellar Support
: * : [ tman : : Technische Betriebsanleitung
: * : [ oman : : Betriebsanleitung
: * : [ hl3 : : HarvestLab 3000
: * : [ hlo : : Originales HarvestLab
: * : [ bin : : Virtuellen Bestand
: * : [ warrep : : Warranty Reports
: * : [ tp : : TouchPoint
: * : [ tcsm : : Technischer Bezirksleiter
: * : [ macrep : : Machine Reports
: * : [ jdsm : : John Deere Software Manager
: * : [ jddm : : John Deere Data Manager
: * : [ serva : : Service Advisor
: * : [ muc : : Master Unlock Code
2020-03-27 14:04:32 -05:00
: * : [ asmn : : Asset Manager
2019-12-17 10:57:15 -06:00
#If
;------------------------------------------------------------------------------
; QoL Improvements
;------------------------------------------------------------------------------
2020-03-10 15:38:31 -05:00
#j:: ; Open the downloads folder on Win+J
Run , C : \Users \%racf% \Downloads
2019-12-17 10:57:15 -06:00
Return
2020-02-19 09:09:10 -06:00
2020-03-10 15:38:31 -05:00
#w:: ; Open My Documents folder on Win+W
2020-01-24 03:23:31 -06:00
if WinActive ( " ahk_exe Explorer.EXE " ) ; If windows explorer is focused
{
Send ! d ; Focus the address bar
2020-03-10 15:38:31 -05:00
Send C : \Users \%racf% \Documents
2020-01-24 03:23:31 -06:00
Send { Enter }
Return
}
2020-03-10 15:38:31 -05:00
Run , C : \Users \%racf% \Documents
Return
2020-03-31 13:17:19 -05:00
: * : [ deg : : { ASC 248 }
: * : ] deg : : { ASC 248 }
: * : [ eq : : { ASC 247 }
: * : ] eq : : { ASC 247 }
: * : [ shrug : : ¯ \_ ( ツ ) _ / ¯
: * : ] shrug : : ¯ \_ ( ツ ) _ / ¯
2020-05-19 10:16:33 -05:00
asciiart ( art )
{
For index , value in art
2020-03-31 13:17:19 -05:00
{
SendInput , %value% { ShiftDown } { Enter } { ShiftUp }
}
2020-05-19 10:16:33 -05:00
Return
}
: * : ] yee : :
asc_yee := [ " ░░░░░░░░░░░░░▄███▄▄▄░░░░░░░ " , " ░░░░░░░░░▄▄▄██▀▀▀▀███▄░░░░░ " , " ░░░░░░░▄▀▀░░░░░░░░░░░▀█░░░░ " , " ░░░░▄▄▀░░░░░░░░░░░░░░░▀█░░░ " , " ░░░█░░░░░▀▄░░▄▀░░░░░░░░█░░░ " , " ░░░▐██▄░░▀▄▀▀▄▀░░▄██▀░▐▌░░░ " , " ░░░█▀█░▀░░░▀▀░░░▀░█▀░░▐▌░░░ " , " ░░░█░░▀▐░░░░░░░░▌▀░░░░░█░░░ " , " ░░░█░░░░░░░░░░░░░░░░░░░█░░░ " , " ░░░░█░░▀▄░░░░▄▀░░░░░░░░█░░░ " , " ░░░░█░░░░░░░░░░░▄▄░░░░█░░░░ " , " ░░░░░█▀██▀▀▀▀██▀░░░░░░█░░░░ " , " ░░░░░█░░▀████▀░░░░░░░█░░░░░ " , " ░░░░░░█░░░░░░░░░░░░▄█░░░░░░ " , " ░░░░░░░██░░░░░█▄▄▀▀░█░░░░░░ " , " ░░░░░░░░▀▀█▀▀▀▀░░░░░░█░░░░░ " , " yee ░░░░░█░░░░░░░░░░░░█░░░░ " ]
asciiart ( asc_yee )
Return
: * : ] micmute : :
mic_mute := [ " ░░░░░░░░░░░░░░░░░░░░░░░░░░ " , " ░░░░░░░░█▄░▄█░█░█▀▀░░░░░░░ " , " ░░░░░░░░█░▀░█░█░█░░░░░░░░░ " , " ░░░░░░░░▀░░░▀░▀░▀▀▀░░░░░░░ " , " ░░█▄░▄█░█░░█░▀█▀░█▀▀░█▀▄░░ " , " ░░█░▀░█░█░░█░░█░░█▀▀░█░█░░ " , " ░░▀░░░▀░▀▀▀▀░░▀░░▀▀▀░▀▀░░░ " , " ░░░░░░░░░░░░░░░░░░░░░░░░░░ " ]
asciiart ( mic_mute )
Return
: * : ] sunglass : :
sunglass := [ " ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ " , " █░░░░░░░░▀█▄▀▄▀██████░▀█▄▀▄▀██████░ " , " ░░░░░░░░░░░▀█▄█▄███▀░░░▀██▄█▄███▀░ " ]
asciiart ( sunglass )
Return