90 Commits
d3k ... 3
Author SHA1 Message Date
david 84f9a6b603 Merge branch 'tier2' 2026-09-09 20:27:23 -05:00
david 0cefd963b6 Update D3K.ahk 2026-09-09 14:14:03 -05:00
david bbfbaf4034 Update func.ahk 2026-09-09 14:13:29 -05:00
david a54571f6cd Update msmv.ahk 2026-08-28 12:29:53 -05:00
david ec815b5314 Delete emails.example.csv 2026-08-28 12:29:32 -05:00
david 5aa7108086 Update glovarsource 2026-08-28 12:29:20 -05:00
david 409f6b9b4c Delete directory 'standalones' 2026-08-28 12:28:29 -05:00
david 32a5b74f71 Delete icons/manual.ico 2026-08-28 12:27:48 -05:00
david 9fd247681a Update func.ahk 2026-08-28 12:27:28 -05:00
david 946e4b7be8 no longer needed 2026-08-28 12:26:42 -05:00
david 2129e733d1 Update Settings.ahk 2026-08-28 12:18:25 -05:00
david c9ef223131 no longer needed 2026-08-28 12:18:05 -05:00
david 03f34dd75e upgrade to ahk v2 2026-08-28 12:17:30 -05:00
david a704be9088 Delete Case_Formatter.ahk 2026-08-28 12:15:27 -05:00
david 31ab7b9c59 Update .gitignore 2026-08-28 12:14:42 -05:00
david 748e3ab321 update to AHK v2 2026-07-08 11:54:28 -05:00
david 9e8ed05b4e update to AHK v2 2026-06-17 12:09:10 -05:00
David Daily 9b9405c7d1 minor changes 2023-07-17 12:30:38 -05:00
David Daily 0fb614940f update regex for ini key search 2023-07-14 11:10:18 -05:00
David Daily de5e7b88e6 yes 2023-07-14 10:27:33 -05:00
David Daily 82ef19a67d Merge branch 'local' into tier2 2023-07-14 10:27:26 -05:00
David Daily 97f2d2382b init 2023-07-14 10:14:26 -05:00
david d02ef808f8 update to new function 2023-02-13 16:21:14 -06:00
david e10c04c253 minor updates 2023-02-13 16:20:22 -06:00
david d537a9bf7b Update 'D3K.ahk' 2023-02-01 14:43:37 -06:00
david 5a4d36ff44 make everything better 2023-02-01 14:42:26 -06:00
david 2eff8ca4ad improve everything 2023-02-01 14:41:14 -06:00
david ab12192837 add date function 2022-03-29 14:33:19 -05:00
david e851dc5c3c add date function 2022-03-29 14:32:47 -05:00
david d434dc3f1e Update 'standalones/Mansol_Opener - standalone.ahk' 2022-01-13 14:21:49 -06:00
david 5ba0c5a215 replace CCMS with Service Advisor 2022-01-13 13:48:09 -06:00
david 2a4cf2dbda replace ugly CCMS link with Service Advisor 2022-01-13 13:47:41 -06:00
david 0d596fd2d4 replace ugly CCMS link with Service Advisor link 2022-01-13 13:47:10 -06:00
david 7d0838567e remove unused code 2021-10-05 09:26:28 -05:00
david f19018ff70 Update 'D3K.ahk' 2021-07-20 10:24:19 -05:00
david 83bd0d3e6c add tooltip to let you know when glovar's been updated 2021-02-02 10:57:36 -06:00
david c7d3567790 compressed code, improved some logic 2020-05-22 13:41:42 -05:00
david b73be18a62 add functionality to GloVar for giving other people guest admin access 2020-05-22 13:01:26 -05:00
david ab8f81db2c add some ascii art 2020-05-19 10:16:33 -05:00
david b4637072a2 Add MouseMover, available through right click of tray icon 2020-05-18 16:56:41 -05:00
david 9b7d00648e add Mouse Mover, available under right click menu 2020-05-18 16:32:10 -05:00
david cc3863b0d2 Correct GSC Prepared
also, alphabetized lists of shortcuts
2020-04-10 10:17:44 -05:00
david dcb2e97426 Merge pull request 'mrlangford-patch-1' (#2) from mrlangford-patch-1 into master
Reviewed-on: #2
2020-04-10 10:07:30 -05:00
david 9c1b4c85f4 GSC Prepared hinzufügen 2020-04-10 10:04:56 -05:00
MrLangford 4efd802be3 grammatik richten 2020-04-10 09:55:31 -05:00
david 65b040054a Minor improvements 2020-03-31 13:17:19 -05:00
david 7e3f293f8c Different case text
Removed the german version since only internal comments are used,
updated to T2 format
2020-03-27 14:04:32 -05:00
david 5bbbbad247 adding support for a different first name, because of that an improvement to the settings dialog was needed 2020-03-11 10:55:20 -05:00
david 52e9d99a2d initial commit 2020-03-10 15:38:31 -05:00
david bcfad04ecb Merge branch 'master' of https://daviddaily.dev/david/d3k
yep
2020-03-06 09:11:28 -06:00
david 6204f7f803 Add readme for standalone ManSol Opener 2020-03-06 09:08:29 -06:00
David Daily 21b9715abe Correct shortcut for Operator's Manual 2020-02-27 02:42:00 -06:00
David Daily 5fa6935537 Merge pull request '2.9 improvements' (#1) from dev into master
Reviewed-on: #1
2020-02-20 04:11:21 -06:00
david ba0b26b768 file created in wrong dir... 2020-02-20 04:09:57 -06:00
david 487cd91888 make sure the check box for email is unchecked when hidden 2020-02-20 04:08:03 -06:00
david f4d9a35e51 update exe to match ahk 2020-02-19 09:21:23 -06:00
david 4c8942ce48 updating since we don't really take emails, adding links to wikis instead of built-in stuff 2020-02-19 09:09:10 -06:00
David Daily f936b26c98 change location of emails.csv 2020-02-07 03:31:25 -06:00
David Daily a2dcf8387e change location of emails.csv 2020-02-07 03:29:43 -06:00
david cf7dc49533 making sure everything is up to date 2020-02-05 08:37:32 -06:00
David Daily 9802fc7af0 Upload files to '' 2020-02-03 07:37:42 -06:00
david c3c2da7120 abandoning csv modification project 2020-02-03 02:54:31 -06:00
David Daily 2bf4b8e8a9 Upload files to 'old_versions'
Used to care about keeping track of how much break time I have left, now I don't
2020-01-27 08:19:52 -06:00
David Daily e89b64463f Get xID from ini, write to the ini so that it updates with the entered info automagically 2020-01-24 09:26:29 -06:00
David Daily 6f2dc0d44e Update 'Settings.ahk' 2020-01-24 03:24:46 -06:00
David Daily 7adfefb670 Update 'func.ahk' 2020-01-24 03:24:06 -06:00
David Daily 03cfca5549 rolling back changes, making it use a file object instead of the default way 2020-01-24 03:23:31 -06:00
David Daily 6acd69fd87 Update 'Settings.ahk' 2020-01-24 02:12:54 -06:00
David Daily a90f2077b6 Update 'D3K.ahk' 2020-01-23 08:47:09 -06:00
David Daily e6bd22263e Update 'func.ahk' 2020-01-23 08:46:40 -06:00
David Daily 67dd119939 Add support for updating the dealer information
wrote a new function for this, check func.ahk: f6d0981b3b
2020-01-23 06:10:05 -06:00
David Daily 98ec36cd5c New way to process emails.csv
updated the function to use an object instead of just reading lines, added a function to write to the csv as well so I can update it without manually modifying it
2020-01-23 06:08:29 -06:00
David Daily f0f149e1c9 reorganize for better scripting 2020-01-23 05:34:58 -06:00
David Daily c9fced6b6d Add support for updating the dealer information
wrote a new function for this, check func.ahk: f6d0981b3b
2020-01-23 05:34:20 -06:00
David Daily f6d0981b3b New way to process emails.csv
updated the function to use an object instead of just reading lines, added a function to write to the csv as well so I can update it without actually modifying it
2020-01-23 05:33:53 -06:00
David Daily ba54476683 Old Telegram message proof of concept
was originally gonna have it let me know when my break was over, but I stopped caring about that
2020-01-22 09:27:10 -06:00
David Daily 545bdeb506 Update 'emails.example.csv' 2020-01-21 05:09:55 -06:00
David Daily 330f7f63e7 Update 'func.ahk'
forgot to change the version...
2020-01-21 05:07:29 -06:00
David Daily 0dd3dc2353 Add dealer org 2020-01-21 05:06:21 -06:00
David Daily ea4ddc9f42 add dealer org 2020-01-21 05:05:59 -06:00
David Daily fef7d1e376 Add dealer org, fix ini updating 2020-01-21 05:05:31 -06:00
David Daily ace6f712cd add function to remove extra empty lines from ini when writing 2020-01-14 10:53:05 -06:00
David Daily 64d7d9dc0a Update 'Settings.ahk' 2020-01-14 10:05:02 -06:00
David Daily 0a25a0262a Update 'emails.example.csv' 2020-01-14 09:29:17 -06:00
David Daily f182bc2bf2 Update 'emails.example.csv' 2020-01-14 09:18:19 -06:00
David Daily 6a803b887a Update 'Case_Formatter.ahk' 2020-01-14 09:17:42 -06:00
David Daily 4d848c4613 Update 'func.ahk' 2020-01-14 09:16:37 -06:00
David Daily da3ddfc759 Update 'Settings.ahk' 2020-01-14 09:15:53 -06:00
David Daily 65d0427f53 Update 'addemail.ahk' 2020-01-14 09:14:48 -06:00
David Daily 49138d3bea Update 'README.md' 2020-01-14 08:41:05 -06:00
15 changed files with 967 additions and 956 deletions
+6
View File
@@ -0,0 +1,6 @@
*.code-workspace
SmartGooey/*
Projects/*
emails.example.csv
.gitignore
.zip
-170
View File
@@ -1,170 +0,0 @@
#Include, func.ahk
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
Gui,+AlwaysOnTop
Gui, +ToolWindow
IniRead, docfile, %ini%, USpec, DocFile, 0
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, 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 y23 w60 h20, &German
Gui, Add, Radio, x82 y3 w60 h20 Group vContact Checked, E-&Mail ; Second group of Radio buttons
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, Show, h70 w210, Contact
;GuiControl, Hide, Hidden ; Hide the button to be hidden
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
}
+264 -492
View File
@@ -1,210 +1,99 @@
#Include, func.ahk #Include "func.ahk"
Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard DetectHiddenWindows true
SetWorkingDir, %A_MyDocuments%\D3K ; Make sure we can find the .ahks linked below A_TrayMenu.Add("&Mouse Mover", MsMv) ; Add item to the tray to move the mouse
A_TrayMenu.Add("&Settings", D3K_Settings) ; Add item to the tray for the settings window
ini = %A_MyDocuments%\D3Ksettings.ini ; Where the settings ini is A_TrayMenu.Add(A_AhkVersion, docs)
ini_writeValue(ini, "Version", "2.6")
;------------------------------------------------------------------------------
; 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
DocFile=Select File
[Main]
Mansol=1
MJDPaste=1
CaseFormatter=1
[Replacement]
JDProductNames=1
GloVar=0
[Language]
German=0
[Info]
Version=2.6
), %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_getValue(ini, "USpec", "RACF")
email := ini_getValue(ini, "USpec", "Email")
docfile := ini_getValue(ini, "USpec", "DocFile")
; General Settings
mansol := ini_getValue(ini, "Main", "Mansol")
supadmin := ini_getValue(ini, "Main", "Supadmin")
mjdpaste := ini_getValue(ini, "Main", "MJDPaste")
caseformatter := ini_getValue(ini, "Main", "CaseFormatter")
; Replacement
jdpn := ini_getValue(ini, "Replacement", "JDProductNames")
glovar := ini_getValue(ini, "Replacement", "GloVar")
; Language
ger := ini_getValue(ini, "Language", "German")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; Global Variables ; Global Variables
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
If (settings["GloVar"])
{
global glovarini := A_MyDocuments "\GloVar.ini" ; Location of the ini that the user modifies
global gvMod := FileGetTime(glovarini)
SetTimer(GloVar, 2000) ; Check every 2 seconds
If (glovar = 1) GloVar(*){
If !(WinActive("GloVar.ini")){ ; Only run when the window isn't active, prevents accidential editing by the script while the user is editing
gvModNew := FileGetTime(glovarini)
If !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini.
{ {
glovarini = %A_MyDocuments%\GloVar.ini ; Location of the ini that the user modifies glovarscript := A_Temp "\GloVar.ahk" ; self-contained, no reference to any other AHK scripts
glovarstart := "#Requires AutoHotkey v2`n#SingleInstance force`n#NoTrayIcon`n"
glovarstart := "#SingleInstance force`n`n:*:$dus::`n:*:$dnm::`n:*:$dem::`n:*:$xid::`n" hotstrings := "" ; Stop ahk from complaining about it not having a value. Just ignore it bro
SetTimer(GloVar, 0) ; Stop the timer while we work on the file
SetTimer, GloVar, 2000 ; Check every 2 seconds glovar_map := ini_load(glovarini)
For section in glovar_map {
GloVar: For key, value in glovar_map[section]
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% Switch section, 0
if !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini.
{ {
gvMod := gvModNew Case "Serial Numbers":
FileDelete, glovar.ahk ; Start with a clean slate value := StrUpper(value) ; Makes it uppercase
FileAppend, %glovarstart%, glovar.ahk ; makes sure we only have one instance of the script running at a time ini_write(glovarini, key, value)
Case "Info":
RESection := "" ; Make sure that its clear If (key = "case")
Loop, Read, %glovarini% ; Read one line at a time
{ {
RegExMatch(A_LoopReadLine, "(?<=\[).*(?=\])", RESection) ; explained above value := StrUpper(value) ; Makes it uppercase, just in case it was manually typed
RegExMatch(A_LoopReadLine, "^(?<Key>.*)=(?<Value>.*)", RE) ; Key = REKey, Value = REValue ini_write(glovarini, key, value) ; Writes the properly formatted case number to glovar.ini
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 Case "Clear": ; Will clear the ini and save its and the documentation file's contents to a log
temp := FileOpen(settings["DocFile"], "r")
doctemp := temp.Read()
temp.Close()
temp := FileOpen(glovarini, "r")
initemp := temp.Read()
temp.Close()
initemp := RegExReplace(initemp, "i)(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info, case insensitive
temp := FileOpen(A_MyDocuments "/D3KLog.txt", "a")
writethis := "Case on " FormatTime(A_NowUTC, "yyyy-MM-dd") "`n`n" doctemp "`n`n" initemp ; Save the current time, what was in the doc file, and glovarini to a variable
temp.Write("`n`n" writethis "`n`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
temp.Close()
temp := FileOpen("glovarsource", "r")
glovarsource := temp.Read()
temp.Close()
temp := FileOpen(glovarini, "w")
temp.Write(glovarsource) ; Overwrite .ini for a clean slate
temp.Close()
temp := FileOpen(settings["DocFile"], "w") ; Overwrites documentation for a clean slate
temp.Close()
script := FileOpen(glovarscript, "w")
script.Encoding := "UTF-8"
script.Write(glovarstart)
script.Close()
Run(glovarscript) ; Just in case. Don't want an old version running.
ToolTip("Cleared")
Sleep(500)
ToolTip()
global gvMod := FileGetTime(glovarini) ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code
SetTimer(GloVar, 2000) ; Check every 2 seconds
Return
}
If (value){ ; skip trying to write a hotstring that doesn't do anything
hotstrings .= "`n:*:$" key "::" value
}
}}
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
{ {
StringUpper, REValue, REValue ; Makes it uppercase A_TrayMenu.Check("&Mouse Mover")
WinWaitNotActive, GloVar.ini ; Just to make sure } else { ; have to include ampersand to refer to it by name!
{ A_TrayMenu.UnCheck("&Mouse Mover")
ini_writeValue(glovarini, REKey, REValue)
FileGetTime, gvMod, %glovarini%
}
}
If InStr(StoredSection, "Operations Center") ; If the section is "Operations Center" and the Key "un", make it uppercase
{
If InStr(REKey, "usr")
{
StringUpper, REValue, REValue ; Makes it uppercase
WinWaitNotActive, GloVar.ini
{
ini_writeValue(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_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 (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
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
}
}
}
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
}
} }
} }
}}
Return Return
} }
@@ -212,79 +101,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
@@ -292,12 +166,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
@@ -306,9 +177,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
@@ -325,311 +195,213 @@ 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
#If, mjdpaste = "1"
#v:: #v::
sleep, 750 {
Send %clipboard% Sleep(750)
sleep, 500 SendInput(A_Clipboard)
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
:*:]jdsm::John Deere Software Manager
:*:]macrep::Machine Reports
:*:]mjd::MyJohnDeere :*:]mjd::MyJohnDeere
:*:]muc::Master Unlock Code
:*:]oman::Operator's Manual
:*:]opsc::Operations Center :*:]opsc::Operations Center
:*:]rs::RowSense
:*:]seccon::Section Control :*:]seccon::Section Control
:*:]gs::GreenStar :*:]gs::GreenStar
:*:]cc::CommandCenter :*:]cc::CommandCenter
:*:]fc::Field Connect :*:]fc::Field Connect
:*:]rs::RowSense :*:]rs::RowSense
:*:]sub::subscription
:*:]ss::Stellar Support :*:]ss::Stellar Support
:*:]sub::subscription
:*:]tcsm::Territory Customer Support Manager
:*:]tman::Technical Manual :*:]tman::Technical Manual
:*:]operm::Operator's Manual :*:]tp::TouchPoint
:*:]hl3::HarvestLab 3000
:*:]hlo::Original HarvestLab
:*:]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
::autotrac::AutoTrac ::autotrac::AutoTrac
::ccms::CCMS ::ccms::CCMS
::comar::COMAR
::dtac::DTAC ::dtac::DTAC
::tcsm::TCSM ::tcsm::TCSM
::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
::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 :*:[jdsm::John Deere Software Manager
:*:[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 :*:[macrep::Machine Reports
:*:[mjd::MyJohnDeere
:*:[muc::Master Unlock Code
:*:[oman::Betriebsanleitung
:*:[opsc::Einsatzzentrale
:*:[rs::RowSense
:*:[seccon::Teilbreitensteuerung
:*:[serva::Service Advisor
:*:[sf::StarFire
:*:[ss::Stellar Support
:*:[sub::Abonnement
:*:[tcsm::Technischer Bezirksleiter
:*:[tman::Technische Betriebsanleitung
:*:[tp::TouchPoint
:*:[warrep::Warranty Reports
:*:[tcsm::Technischer Bezirksleiter
:*:[jdsm::John Deere Software Manager :*:[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
+3 -3
View File
@@ -1,6 +1,6 @@
# Welcome To David3000 # Welcome To David3000
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). This was by me to replace text and do text correction at work. 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)
+65 -127
View File
@@ -1,154 +1,92 @@
#SingleInstance force ; Only one instance at a time #Include "func.ahk"
SendMode, Input
FileEncoding, UTF-8 ; Makes sure the special characters don't break stuff
#Include, func.ahk
Menu, Tray, Icon, shell32.dll, 283
;------------------------------------------------------------------------------
; 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
*/
; User Specific things:
racf := ini_getValue(ini, "USpec", "RACF")
email := ini_getValue(ini, "USpec", "Email")
docfile := ini_getValue(ini, "USpec", "DocFile")
; General Settings
mansol := ini_getValue(ini, "Main", "Mansol")
mjdpaste := ini_getValue(ini, "Main", "MJDPaste")
caseformatter := ini_getValue(ini, "Main", "CaseFormatter")
; Replacement
jdpn := ini_getValue(ini, "Replacement", "JDProductNames")
glovar := ini_getValue(ini, "Replacement", "GloVar")
; Language
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
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
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 h105, 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
msmv_check := 1
case "no-running": ; don't run at refresh, currently running
msmv_check := 0
case "no-stopped": ; don't run at refresh, currently stopped
msmv_check := 0
default:
MsgBox("Unexpected value `"" settings["msmv"] "`" in D3Ksettings.ini")
Reload
}
Gui, Add, GroupBox, x128 y83 w157 h105, 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 vformSymb Checked%symb% gSymb, Symbols
Gui, Add, CheckBox, x132 y125 w150 h30 vformJdpn Checked%jdpn% gJdpn, JD Product Names
Gui, Add, CheckBox, x132 y155 w150 h30 vformGlovar Checked%glovar% gGlovar, Global Variables
Gui, Add, CheckBox, x12 y187 w100 h30 vformGer Checked%ger% gGer, DE ([ as prefix) myGui.Add("Link",, "<a href=`"https://daviddaily.dev/david/d3k/wiki`">Click here for help</a>")
Gui, Add, Button, x132 y190 w150 h23 gHelp, Click here for help (v%d3k_version%) myGui.Add("Text",, "AHK Version: " . A_AhkVersion)
myGui.Add("Text",, "D3K version " . d3k_version)
Gui, Show, h225 w295, David 3000 Settings 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 []:
[USpec] /*
RACF=LF01234 Default ini, sections are in []: (0 is off, 1 is on)
[email protected] [email protected]
DocFile= Name=Firstname
[Main] DocFile=Select File
Mansol=1
MJDPaste=1
CaseFormatter=1
[Replacement]
JDProductNames=1 JDProductNames=1
GloVar=0 GloVar=0
[Language]
German=0 German=0
[Info]
Version=2.5
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_writeValue(ini, "RACF", formRACF)
Return
Email: ProcessUserInput(*)
Gui, Submit, NoHide {
ini_writeValue(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_writeValue(ini, "DocFile", SelectedFile) ini_write(sett_ini, "DocFile", SelectedFile)
docfile := ini_getValue(ini, "USpec", "DocFile") Run("Settings.ahk")
Gui, Show, h225 w295, David 3000 Settings }
Return
Mansol: End(*)
Gui, Submit, NoHide {
ini_writeValue(ini, "Mansol", formMansol) ProcessUserInput()
Return ExitApp
}
MJDPaste:
Gui, Submit, NoHide
ini_writeValue(ini, "MJDPaste", formMJDPaste)
Return
CaseFormatter:
Gui, Submit, NoHide
ini_writeValue(ini, "CaseFormatter", formCaseFormatter)
Return
Jdpn:
Gui, Submit, NoHide
ini_writeValue(ini, "JDProductNames", formJdpn)
Return
Glovar:
Gui, Submit, NoHide
ini_writeValue(ini, "GloVar", formGlovar)
Return
Ger:
Gui, Submit, NoHide
ini_writeValue(ini, "German", formGer)
Return
Help:
Gui, Submit
Run, https://daviddaily.dev/david/d3k/wiki
Return
GuiClose:
GuiEscape:
Run D3K.ahk
ExitApp ; Closes the app when escape or the exit button is pressed
-31
View File
@@ -1,31 +0,0 @@
#Include, func.ahk
Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard
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
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text, x2 y2 w60 h17 +Center, xID
Gui, Add, Text, x65 y2 w120 h17 +Center, Name
Gui, Add, Text, x190 y2 w100 h17 +Center, Email
Gui, Add, Edit, x2 y17 w60 h20 vXid
Gui, Add, Edit, x65 y17 w120 h20 vName
Gui, Add, Edit, x190 y17 w100 h20 vEmail
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%
Clipboard := Xid
Return
GuiEscape:
GuiClose:
ExitApp
-4
View File
@@ -1,4 +0,0 @@
xID,Email,Name,Demo Username
X1,[email protected],Person 1,User 1
X2,[email protected],Person 2,User 2
X3,[email protected],Person 3
1 xID,Email,Name,Demo Username
2 X1,[email protected],Person 1,User 1
3 X2,[email protected],Person 2,User 2
4 X3,[email protected],Person 3
+78 -74
View File
@@ -1,48 +1,10 @@
#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.5 ; The current version global d3k_version := 3 ; The current version
settini = %A_MyDocuments%\D3Ksettings.ini ; Where the settings ini is
GetDateTime(lang)
{
UTCTimestamp := A_NowUTC ; Grab the current time and 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
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) ; Accept what is passed here as the variable "xID" in the script
{
if (xID)
{
Loop, Read, %A_MyDocuments%\Work_Docs\emails.csv ; read every line of "emails.csv"
{
Array := StrSplit(A_LoopReadLine,",") ; 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,
Break ; stop searching
}
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
Return Test
}
if !(xID)
{
Return
}
}
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@@ -51,47 +13,89 @@ GetInfo(xID) ; Accept what is passed here as the variable "xID" in the script
ini_load(location) ini_load(location)
{ {
out := {} temp := FileOpen(location, "r")
Loop, Read, %location% 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
{ {
RegExMatch(A_LoopReadLine, "(?<=\[).*(?=\])", _RESection) ; Matches section name Line := temp.ReadLine()
RegExMatch(A_LoopReadLine, "(?<Key>.*)=(?<Value>.*)", _) ; Key = _Key, Value = _Value if (Line){
RegExMatch(Line, "(?<Section>(?<=\[).*(?=\]))|(?<Key>.*)=(?<Value>.*)", &r) ; Key = r.Key, Value = r.Value, Section = r.Section
If (_RESection) If (r.Section)
{ {
_RESection := StrReplace(_RESection, " ", "_") out[r.Section] := Map()
out[_RESection]:={} curr_section := r.Section
currentSection := _RESection } Else
} Else {
If (_Value)
{ {
_Key := StrReplace(_Key, " ", "_") If (curr_section)
out[currentSection][_Key] := _Value {
out[curr_section].Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n"))
} Else
{
out.Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n")) ; this handles things with no section
} }
} }
} }
} Until (temp.AtEOF)
temp.Close()
Return out Return out
} }
ini_getValue(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)
Return ini_loaded[inSec][inKey] ini.Close()
} }
ini_writeValue(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
WinWaitNotActive, GloVar.ini DocFile=0
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file JDProductNames=1
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents GloVar=0
FileDelete, tempini ; Delete the fixed temporary ini German=0
msmv=always
msmv_status=stopped
)"
ini.Write(writethis)
ini.Close()
Run("Settings.ahk") ; Runs the GUI for changing the settings, accessible with Alt+Shift+\ (also easy way to restart this script)
} }
;------------------------------------------------------------------------------
; Read the sett_ini
;------------------------------------------------------------------------------
; This is the part that reads the file to see what your settings are.
global settings := ini_load(sett_ini)
; started as global variables, keeping this commented out in case there's some old script where I need to replace something
; User Specific things:
;global email := settings["Email"]
;global docfile := settings["DocFile"]
;global jdpn := settings["JDProductNames"]
;global glovar := settings["GloVar"]
;global ger := settings["German"]
+4 -11
View File
@@ -1,15 +1,8 @@
[Serial Numbers] [Serial Numbers]
1= 1=
ch= v=
2= cm=
MTG= do=
VIN= co=
[Operations Center]
usr=
org=
[Info] [Info]
case= case=
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()
}
@@ -0,0 +1,306 @@
#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
+145
View File
@@ -0,0 +1,145 @@
; 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.
@@ -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:
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
GuiClose:
GuiEscape:
Gui, Destroy
Return
}