From 5bbbbad247402d2cc67cf99f296c187a170fa6db Mon Sep 17 00:00:00 2001 From: david Date: Wed, 11 Mar 2020 10:55:20 -0500 Subject: [PATCH 01/10] adding support for a different first name, because of that an improvement to the settings dialog was needed --- D3K.ahk | 49 ++++++++++++++++--------------------------------- Settings.ahk | 21 +++++++++++++++++---- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/D3K.ahk b/D3K.ahk index 61527ed..0b2ddce 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -14,6 +14,7 @@ FileAppend, [USpec] RACF=LF01234 Email=LastnameFirstname@JohnDeere.com +Name=Firstname DocFile=Select File [Main] Mansol=1 @@ -37,6 +38,7 @@ Run Settings.ahk ; Runs the GUI for changing the settings, also accessible with ; User Specific things: racf := ini_get(ini, "USpec", "RACF") email := ini_get(ini, "USpec", "Email") +name := ini_get(ini, "USpec", "Name") docfile := ini_get(ini, "USpec", "DocFile") ; General Settings @@ -421,47 +423,28 @@ SetTitleMatchMode, 2 ; Regular :*:]email:: - Send Hello,{Enter 2} {Shift down}{Enter}{Shift up}Please contact us if you have any questions.{Up}{End} + Send Hello,{Enter 2}{Space 3} Return -; 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 +; Cases :*:]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} + Send Hello,{Enter 2}{Space 3}{Enter}{Home down}{Shift up}{Home up}{Enter}Thank you,{Enter}%name%{Up 3}{End} Return #If + ; German #If, ger = "1" ; Regular :*:[email:: - Send Hallo,{Enter 2} {Shift down}{Enter}{Shift up}Für Rückfragen stehen wir gerne zur Verfügung.{Up}{End} + Send Hallo,{Enter 2}{Space 3} 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 +; 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} + Send Hallo,{Enter 2}{Space 3}{Enter}{Home down}{Shift down}{Home up}{Shift up}{Enter}Mit freundlichen Grüßen,{Enter}%name%{Up 3}{End} Return #If @@ -561,7 +544,7 @@ SetTitleMatchMode, 2 :*:mtg::MTG ::wdt::WDT ::itc::iTC - ::vin::VIN + :*:vin::VIN ::gs2::GS2 ::gs3::GS3 ::sf1::SF1 @@ -621,19 +604,19 @@ SetTitleMatchMode, 2 ; QoL Improvements ;------------------------------------------------------------------------------ -#j:: -Run, C:\Users\%racf%\Downloads ; Open the downloads folder on Win+J +#j:: ; Open the downloads folder on Win+J +Run, C:\Users\%racf%\Downloads Return -#w:: +#w:: ; Open My Documents folder on Win+W if WinActive("ahk_exe Explorer.EXE") ; If windows explorer is focused { Send !d ; Focus the address bar - 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 C:\Users\%racf%\Documents Send {Enter} Return } -Run, C:\Users\%racf%\Documents\Work_Docs\Cases\2020-01 - 06 ; Open the documentation folder on Win+W -Return \ No newline at end of file +Run, C:\Users\%racf%\Documents +Return diff --git a/Settings.ahk b/Settings.ahk index 070d3b5..2090b18 100644 --- a/Settings.ahk +++ b/Settings.ahk @@ -11,6 +11,7 @@ This is the part that reads the file to see what your settings are. Variables in ; User Specific things: racf := ini_get(ini, "USpec", "RACF") email := ini_get(ini, "USpec", "Email") +name := ini_get(ini, "USpec", "Name") docfile := ini_get(ini, "USpec", "DocFile") ; General Settings @@ -34,18 +35,22 @@ Gui, -MaximizeBox -MinimizeBox ; Remove the max+min buttons Gui, Add, GroupBox, x8 y2 w67 h37, RACF Gui, Add, Edit, x12 y15 w60 h20 vformRACF gRACF, %RACF% +Gui, Add, GroupBox, x85 y2 w200 h37, First Name +Gui, Add, Edit, x89 y15 w193 h20 vformName gName, %Name% + Gui, Add, GroupBox, x8 y40 w207 h37, Email Address Gui, Add, Edit, x12 y53 w200 h20 vformEmail gEmail, %Email% -Gui, Add, GroupBox, x77 y2 w207 h37, Documentation File -Gui, Add, Text, x81 y19 w200 h20 gDocFile, %docfile% - Gui, Add, GroupBox, x8 y83 w107 h130, Main Gui, Add, CheckBox, x12 y95 w100 h30 vformMansol Checked%mansol% gMansol, ManSol Gui, Add, CheckBox, x12 y125 w100 h30 vformMJDPaste Checked%mjdpaste% gMJDPaste, MJDPaste Gui, Add, CheckBox, x12 y155 w100 h30 vformCaseFormatter Checked%caseformatter% gCaseFormatter, Case Formatter Gui, Add, CheckBox, x25 y178 w75 h30 vformCFmail Checked%cfmail% gCFmail, Email option GuiControl, show%caseformatter%, formCFmail ; only shows the check box for emails if the Case Formatter box is checked +Gui, Add, GroupBox, x8 y215 w277 h40 vformDocFile, Documentation File +Gui, Add, Text, x15 y231 w260 h20 vformDocFile2 gDocFile, %docfile% + GuiControl, show%caseformatter%, formDocFile ; only shows the documentation file field if the Case Formatter box is checked + GuiControl, show%caseformatter%, formDocFile2 Gui, Add, GroupBox, x128 y83 w157 h75, Text Replacement Gui, Add, CheckBox, x132 y95 w150 h30 vformJdpn Checked%jdpn% gJdpn, JD Product Names @@ -54,7 +59,7 @@ Gui, Add, CheckBox, x132 y155 w100 h30 vformGer Checked%ger% gGer, DE ([ as pref Gui, Add, Link, x132 y190 w150 h23 gHelp, Click here for help (v%d3k_version%) -Gui, Show, h225 w295, David 3000 Settings +Gui, Show, h263 w295, David 3000 Settings Return ;------------------------------------------------------------------------------ @@ -65,6 +70,7 @@ Default ini, sections are in []: (0 is off, 1 is on) [USpec] RACF=LF01234 Email=LastnameFirstname@JohnDeere.com +Name=Firstname DocFile=Select File [Main] Mansol=1 @@ -88,6 +94,11 @@ RACF: ini_write(ini, "RACF", formRACF) Return +Name: + Gui, Submit, NoHide + ini_write(ini, "Name", formName) +Return + Email: Gui, Submit, NoHide ini_write(ini, "Email", formEmail) @@ -117,6 +128,8 @@ Return CaseFormatter: Gui, Submit, NoHide GuiControl, show%formCaseFormatter%, formCFmail ; only shows the check box for emails if the Case Formatter box is checked + GuiControl, show%formCaseFormatter%, formDocFile + GuiControl, show%formCaseFormatter%, formDocFile2 GuiControl,, formCFmail, 0 ini_write(ini, "CaseFormatter", formCaseFormatter) ini_write(ini, "CFmail", "0") ; if you're toggling this, its either on or off, doesn't hurt to set it here From 4efd802be386d7c4aadd09732e90f8dfae44822a Mon Sep 17 00:00:00 2001 From: MrLangford Date: Fri, 10 Apr 2020 09:55:31 -0500 Subject: [PATCH 02/10] grammatik richten --- Case_Formatter.ahk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Case_Formatter.ahk b/Case_Formatter.ahk index 42a76bf..b4a83a8 100644 --- a/Case_Formatter.ahk +++ b/Case_Formatter.ahk @@ -158,15 +158,15 @@ Write: Else If (Act = "1") ; Warrant { - FileAppend,Händler rief an für Garantieübertragung`nAlte SN: `nNeue SN: `nAuthentisierungscode: `n`n, %docfile% + FileAppend,Händler rief an für eine 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% + FileAppend,Händler rief an für eine Demo`nSN: `nAuthentisierungscode: `n`n, %docfile% } } } ExitApp -} +} \ No newline at end of file From 9c1b4c85f40245c2d5a829c1715f712997cf727b Mon Sep 17 00:00:00 2001 From: David Daily Date: Fri, 10 Apr 2020 10:04:56 -0500 Subject: [PATCH 03/10] =?UTF-8?q?GSC=20Prepared=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- D3K.ahk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/D3K.ahk b/D3K.ahk index 0b2ddce..b2be4a5 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -526,6 +526,7 @@ SetTitleMatchMode, 2 :*:]jddm::John Deere Data Manager :*:]serva::Service Advisor :*:]muc::Master Unlock Code + :*:]gsc::GSC-Prepared :*:]deg::{ASC 248} :*:]eq::{ASC 247} @@ -592,6 +593,7 @@ SetTitleMatchMode, 2 :*:[jddm::John Deere Data Manager :*:[serva::Service Advisor :*:[muc::Master Unlock Code + :*:[gsc::GSC-Prepared :*:[deg::{ASC 248} :*:[eq::{ASC 247} #If From cc3863b0d27a5ca295ebad67e617b96d73ed8d9f Mon Sep 17 00:00:00 2001 From: David Daily Date: Fri, 10 Apr 2020 10:17:44 -0500 Subject: [PATCH 04/10] Correct GSC Prepared also, alphabetized lists of shortcuts --- D3K.ahk | 158 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/D3K.ahk b/D3K.ahk index b2be4a5..81f1461 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -495,107 +495,107 @@ SetTitleMatchMode, 2 ; 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 - :*:]oman::Operator's Manual - :*:]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 - :*:]gsc::GSC-Prepared + :*:]cc::CommandCenter :*:]deg::{ASC 248} :*:]eq::{ASC 247} + :*:]fc::Field Connect + :*:]gs::GreenStar + :*:]gp::GSC-Prepared + :*:]hl3::HarvestLab 3000 + :*:]hlo::Original HarvestLab + :*:]jddm::John Deere Data Manager + :*:]jdl2::JDLink Dashboard 2.0 + :*:]jdla::JDLink Access + :*:]jdlc::JDLink Connect + :*:]jdld::JDLink Dashboard + :*:]jdll::JDLink + :*:]jdls::JDLink Subscription + :*:]jdlw::JDLink Web + :*:]jdp::JDParts + :*:]jdsm::John Deere Software Manager + :*:]macrep::Machine Reports + :*:]mjd::MyJohnDeere + :*:]muc::Master Unlock Code + :*:]oman::Operator's Manual + :*:]opsc::Operations Center + :*:]rs::RowSense + :*:]seccon::Section Control + :*:]serva::Service Advisor + :*:]sf::StarFire + :*:]ss::Stellar Support + :*:]sub::subscription + :*:]tcsm::Territory Customer Support Manager + :*:]tman::Technical Manual + :*:]tp::TouchPoint + :*:]warrep::Warranty Reports - ::rowsense::RowSense - ::comar::COMAR - ::mrtk::mRTK - ::rda::RDA - ::rtk::RTK + :*:mtg::MTG + :*:racf::RACF + :*:vin::VIN + ::atu::ATU ::autotrac::AutoTrac ::ccms::CCMS + ::comar::COMAR ::dtac::DTAC - ::tcsm::TCSM - ::itec::iTEC Pro - ::ssu::SSU - ::atu::ATU - :*:mtg::MTG - ::wdt::WDT - ::itc::iTC - :*:vin::VIN ::gs2::GS2 ::gs3::GS3 + ::igrade::iGrade + ::itc::iTC + ::itec::iTEC Pro + ::mrtk::mRTK + ::pmcalc::PMCalc + ::rda::RDA + ::rowsense::RowSense + ::rtk::RTK ::sf1::SF1 ::sf2::SF2 ::sf3::SF3 ::sf4::SF4 - ::xid::xID - ::pmcalc::PMCalc + ::ssu::SSU + ::tcsm::TCSM ::vat::VAT - :*:racf::RACF - ::igrade::iGrade + ::wdt::WDT + ::xid::xID ; 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 - :*:[gsc::GSC-Prepared + :*:[cc::CommandCenter :*:[deg::{ASC 248} :*:[eq::{ASC 247} + :*:[fc::Field Connect + :*:[gs::GreenStar + :*:[gp::GSC-Prepared + :*:[hl3::HarvestLab 3000 + :*:[hlo::Originales HarvestLab + :*:[jddm::John Deere Data Manager + :*:[jdl2::JDLink Dashboard 2.0 + :*:[jdla::JDLink Access + :*:[jdlc::JDLink Connect + :*:[jdld::JDLink Dashboard + :*:[jdll::JDLink + :*:[jdls::JDLink Abonnement + :*:[jdlw::JDLink Web + :*:[jdp::JDParts + :*:[jdsm::John Deere Software Manager + :*:[macrep::Machine Reports + :*:[mjd::MyJohnDeere + :*:[muc::Master Unlock Code + :*:[oman::Betriebsanleitung + :*:[opsc::Einsatzzentrale + :*:[rs::RowSense + :*:[seccon::Teilbreitensteuerung + :*:[serva::Service Advisor + :*:[sf::StarFire + :*:[ss::Stellar Support + :*:[sub::Abonnement + :*:[tcsm::Technischer Bezirksleiter + :*:[tman::Technische Betriebsanleitung + :*:[tp::TouchPoint + :*:[warrep::Warranty Reports #If From b4637072a2430228cbaeed8ef0d7aabc436aca1c Mon Sep 17 00:00:00 2001 From: david Date: Mon, 18 May 2020 16:56:41 -0500 Subject: [PATCH 05/10] Add MouseMover, available through right click of tray icon --- D3K.ahk | 4 ++++ msmv.ahk | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 msmv.ahk diff --git a/D3K.ahk b/D3K.ahk index 81f1461..06c635a 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -1,6 +1,7 @@ #Include, func.ahk Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard +Menu, Tray, Add, MouseMover ; Add item to tray icon right click for mouse mover ;------------------------------------------------------------------------------ ; Make sure the settings file exists, if not, create it @@ -220,6 +221,9 @@ If (glovar = 1) !+\::Run Settings.ahk ; Alt+Shift+\ +MouseMover: + Run, msmv.ahk +Return ;------------------------------------------------------------------------------ ; DTAC Solution Opener diff --git a/msmv.ahk b/msmv.ahk new file mode 100644 index 0000000..14f782f --- /dev/null +++ b/msmv.ahk @@ -0,0 +1,31 @@ +#SingleInstance, force + +Gui, +AlwaysOnTop +ToolWindow + +Gui, Add, Button, x3 y3 w55 h20 gStart vStart +Center, Start +Gui, Add, Button, x3 y3 w55 h20 gStop vStop +Center, Stop +Gui, Show, h28 w60, msmv +GuiControl, Hide, Stop +Return + +Start: + GuiControl, Hide, Start + SetTimer, Msmv, 480000 + GuiControl, Show, Stop +Return + +Stop: + GuiControl, Hide, Stop + SetTimer, Msmv, off + GuiControl, Show, Start +Return + +Msmv: + MouseMove, 100, 0 + Sleep, 240000 + MouseMove, 0, 0 +Return + +GuiClose: +GuiEscape: +ExitApp ; Closes the app when escape or the exit button is pressed From c7d3567790a49f07b9d58cba5a9f7a4426c7c660 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 22 May 2020 13:41:42 -0500 Subject: [PATCH 06/10] compressed code, improved some logic --- D3K.ahk | 251 ++++++++++++++++++++++++++------------------------------ 1 file changed, 116 insertions(+), 135 deletions(-) diff --git a/D3K.ahk b/D3K.ahk index 06c635a..847c259 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -62,153 +62,134 @@ ger := ini_get(ini, "Language", "German") If (glovar = 1) { glovarini := A_MyDocuments "\GloVar.ini" ; Location of the ini that the user modifies - glovarstart := "#SingleInstance force`n`n:*:$dorg::`n:*:$dus::`n:*:$dnm::`n:*:$dem::`n:*:$xid::`n" - SetTimer, GloVar, 2000 ; Check every 2 seconds GloVar: WinWaitNotActive, GloVar.ini ; So that we don't get any problems with the file on disk being out of date. I use VSCode with the "Save on lose focus" option on, YMMV + FileGetTime, gvModNew, %glovarini% + if !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini. { - FileGetTime, gvModNew, %glovarini% - if !(gvModNew = gvMod) ; Those two lines mean the rest of this only executes if there were changes to the ini. + gvMod := gvModNew + FileDelete, glovar.ahk ; Start with a clean slate + FileAppend, %glovarstart%, glovar.ahk ; makes sure we only have one instance of the script running at a time + RESection := "" ; Make sure that its clear + file := FileOpen(glovarini, "r") + Loop ; Read one line at a time { - gvMod := gvModNew - FileDelete, glovar.ahk ; Start with a clean slate - FileAppend, %glovarstart%, glovar.ahk ; makes sure we only have one instance of the script running at a time + Line := file.ReadLine() + RegExMatch(Line, "(?<=\[).*(?=\])", RESection) ; explained above + RegExMatch(Line, "^(?.*)=(?.*)", RE) ; Key = REKey, Value = REValue - RESection := "" ; Make sure that its clear - file := FileOpen(glovarini, "r") - Loop ; Read one line at a time + If (RESection && InStr(StoredSection := RESection, "clear")) ; Found a clear section { - Line := file.ReadLine() - RegExMatch(Line, "(?<=\[).*(?=\])", RESection) ; explained above - RegExMatch(Line, "^(?.*)=(?.*)", RE) ; Key = REKey, Value = REValue - - If !(RESection) ; If the RegEx doesn't find antything, its empty + ; Will clear the ini and save its and the documentation file's contents to a log + FileRead, doctemp, %docfile% ; Read documentation file, set in settings + FileRead, initemp, %glovarini% ; Read the ini + initemp := RegExReplace(initemp, "(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info + CurrTime := GetDateTime("en") ; get the current date and time as "YYYY-MM-DD at HH:MM GMT" + writethis := "Case on " . CurrTime . "`n" . doctemp . "`n`n" . initemp ; Save the current time, what was in the doc file, and glovarini to a variable + FileAppend, % "`n`n`n`n" writethis "`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", %A_MyDocuments%/D3KLog.txt ; Write a few new lines , the content, and a line underneath + FileAppend,, temptemp + FileCopy, glovarsource, %glovarini%, 1 ; Copies and replaces any text in glovar.ini with the template + FileCopy, temptemp, %docfile%, 1 ; These two this close together makes it look like they get cleared at the same time + FileDelete, temptemp + fileread, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code + FileDelete, glovar.ahk ; THE CLEAN SLATE + FileAppend, %glovarstart%, glovar.ahk + Sleep, 500 + FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code + If FileExist("glovar.ahk") { - If !(REValue) ; If there is no value for the key, skip it (Continue the loop at the next line) - { - Continue - } - If InStr(StoredSection, "Serial Numbers") ; If the section is "Serial Numbers", make everything uppercase - { - StringUpper, REValue, REValue ; Makes it uppercase - WinWaitNotActive, GloVar.ini ; Just to make sure - { - ini_write(glovarini, REKey, REValue) - FileGetTime, gvMod, %glovarini% - } - } - If InStr(StoredSection, "Operations Center") ; If the section is "Operations Center" and the Key "un", make it uppercase - { - If InStr(REKey, "usr") - { - StringUpper, REValue, REValue ; Makes it uppercase - WinWaitNotActive, GloVar.ini - { - ini_write(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini - FileGetTime, gvMod, %glovarini% - } - } - } - If InStr(REKey, "case") ; If a key contains "case". Case numbers are all in the format "LETTERS-NUMBERS". - { - StringUpper, REValue, REValue ; Makes it uppercase - RegExMatch(REValue, "(?<=\().*(?=\))", REMatch) ; Match everything but the parenthesis. When the case numbers are shown they have parenthesis, and those are annoying. - If (REMatch) ; If there's anything there - { - WinWaitNotActive, GloVar.ini - { - ini_write(glovarini, REKey, REMatch) ; Writes the properly formatted case number to glovar.ini - FileGetTime, gvMod, %glovarini% - } - REValue := REMatch - } Else { - WinWaitNotActive, GloVar.ini - { - ini_write(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini - FileGetTime, gvMod, %glovarini% - } - } - } - If InStr(REKey, "xid") ; If an xID is entered. Unique identifier for people - { - dealinfo := GetInfo(REValue) ; Gets information, see function for details - StringUpper, REValue, REValue ; Makes xID uppercase - - if !(REValue = dealinfo.xid) - { - run addemail.ahk - Continue - } - - ; Replace the data in glovar.ahk with the data from the ini - FileRead, tempglovar, glovar.ahk - tempglovar := RegExReplace(tempglovar, "(?<=\$xid::).*", dealinfo.xid) - tempglovar := RegExReplace(tempglovar, "(?<=\$dem::).*", dealinfo.email) - tempglovar := RegExReplace(tempglovar, "(?<=\$dnm::).*", dealinfo.name) - tempglovar := RegExReplace(tempglovar, "(?<=\$dus::).*", dealinfo.user) - tempglovar := RegExReplace(tempglovar, "(?<=\$dorg::).*", dealinfo.org) - FileAppend, %tempglovar%, tempglovar - FileCopy, tempglovar, glovar.ahk,1 - FileDelete, tempglovar - - WinWaitNotActive, GloVar.ini - { - ini_write(glovarini, "xID", dealinfo.xid) ; Writes the xID - ini_write(glovarini, "dem", dealinfo.email) ; Writes email address (incredibly useful) - ini_write(glovarini, "dnm", dealinfo.name) ; Writes Name (useful for when referring to that person) - ini_write(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful) - ini_write(glovarini, "dorg", dealinfo.org) - } - FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code - Continue - } - If (InStr(REKey, "dem") or InStr(REKey, "dnm") or InStr(REKey, "dus")) - { - ; Do not process xID related info, that is done above - Continue - } - writethis := ":*:$" REKey "::" REValue "`n" ; Save the hotstring to a variable - FileAppend, %writethis%, glovar.ahk ; Write the variable to glovar.ahk + Run glovar.ahk } - If (RESection) ; If we have a section - { - StoredSection := RESection - If InStr(RESection, "clear") ; Will clear the ini and save its and the documentation file's contents to a log - { - FileRead, doctemp, %docfile% ; Read documentation file, set in settings - FileRead, initemp, %glovarini% ; Read the ini - initemp := RegExReplace(initemp, "(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info - CurrTime := GetDateTime("en") ; get the current date and time as "YYYY-MM-DD at HH:MM GMT" - - writethis := "Case on " . CurrTime . "`n" . doctemp . "`n`n" . initemp ; Save the current time, what was in the doc file, and glovarini to a variable - FileAppend, % "`n`n`n`n" writethis "`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", %A_MyDocuments%/D3KLog.txt ; Write a few new lines , the content, and a line underneath - FileAppend,, temptemp - FileCopy, glovarsource, %glovarini%, 1 ; Copies and replaces any text in glovar.ini with the template - FileCopy, temptemp, %docfile%, 1 ; These two this close together makes it look like they get cleared at the same time - FileDelete, temptemp - fileread, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code - FileDelete, glovar.ahk ; THE CLEAN SLATE - FileAppend, %glovarstart%, glovar.ahk - - Sleep, 500 - FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code - If FileExist("glovar.ahk") - { - Run glovar.ahk - } - Return - } - } - } Until (file.AtEOF) - file.Close() - FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code - If FileExist("glovar.ahk") - { - Run glovar.ahk + Return + } else if (RESection) { ; found a different section + StoredSection := RESection + continue } + If !(RESection) ; If the RegEx doesn't find antything, its empty + { + If !(REValue) ; If there is no value for the key, skip it (Continue the loop at the next line) + { + Continue + } + If InStr(StoredSection, "Serial Numbers") ; If the section is "Serial Numbers", make everything uppercase + { + StringUpper, REValue, REValue ; Makes it uppercase + WinWaitNotActive, GloVar.ini ; Just to make sure + ini_write(glovarini, REKey, REValue) + FileGetTime, gvMod, %glovarini% + MsgBox, test + } + If InStr(StoredSection, "Operations Center") ; If the section is "Operations Center" and the Key "un", make it uppercase + { + If InStr(REKey, "usr") + { + StringUpper, REValue, REValue ; Makes it uppercase + WinWaitNotActive, GloVar.ini + ini_write(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini + FileGetTime, gvMod, %glovarini% + } + } + If InStr(REKey, "case") ; If a key contains "case". Case numbers are all in the format "LETTERS-NUMBERS". + { + StringUpper, REValue, REValue ; Makes it uppercase + RegExMatch(REValue, "(?<=\().*(?=\))", REMatch) ; Match everything but the parenthesis. When the case numbers are shown they have parenthesis, and those are annoying. + If (REMatch) ; If there's anything there + { + WinWaitNotActive, GloVar.ini + ini_write(glovarini, REKey, REMatch) ; Writes the properly formatted case number to glovar.ini + FileGetTime, gvMod, %glovarini% + REValue := REMatch + } Else { + WinWaitNotActive, GloVar.ini + ini_write(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini + FileGetTime, gvMod, %glovarini% + } + } + If InStr(REKey, "xid") ; If an xID is entered. Unique identifier for people + { + dealinfo := GetInfo(REValue) ; Gets information, see function for details + StringUpper, REValue, REValue ; Makes xID uppercase + if !(REValue = dealinfo.xid) + { + run addemail.ahk + Continue + } + ; Replace the data in glovar.ahk with the data from the ini + FileRead, tempglovar, glovar.ahk + tempglovar := RegExReplace(tempglovar, "(?<=\$xid::).*", dealinfo.xid) + tempglovar := RegExReplace(tempglovar, "(?<=\$dem::).*", dealinfo.email) + tempglovar := RegExReplace(tempglovar, "(?<=\$dnm::).*", dealinfo.name) + tempglovar := RegExReplace(tempglovar, "(?<=\$dus::).*", dealinfo.user) + tempglovar := RegExReplace(tempglovar, "(?<=\$dorg::).*", dealinfo.org) + FileAppend, %tempglovar%, tempglovar + FileCopy, tempglovar, glovar.ahk,1 + FileDelete, tempglovar + WinWaitNotActive, GloVar.ini + ini_write(glovarini, "xID", dealinfo.xid) ; Writes the xID + ini_write(glovarini, "dem", dealinfo.email) ; Writes email address (incredibly useful) + ini_write(glovarini, "dnm", dealinfo.name) ; Writes Name (useful for when referring to that person) + ini_write(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful) + ini_write(glovarini, "dorg", dealinfo.org) + FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code + Continue + } + If (InStr(REKey, "dem") or InStr(REKey, "dnm") or InStr(REKey, "dus")) + { + ; Do not process xID related info, that is done above + Continue + } + writethis := ":*:$" REKey "::" REValue "`n" ; Save the hotstring to a variable + FileAppend, %writethis%, glovar.ahk ; Write the variable to glovar.ahk + } + } Until (file.AtEOF) + file.Close() + FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code + If FileExist("glovar.ahk") + { + Run glovar.ahk } } Return From 0d596fd2d4db90a8967e6b018fd67bac63eaea43 Mon Sep 17 00:00:00 2001 From: David Daily Date: Thu, 13 Jan 2022 13:47:10 -0600 Subject: [PATCH 07/10] replace ugly CCMS link with Service Advisor link --- standalones/Mansol_Opener - standalone.ahk | 80 +++++++++++----------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/standalones/Mansol_Opener - standalone.ahk b/standalones/Mansol_Opener - standalone.ahk index 81e3e3e..2146d62 100644 --- a/standalones/Mansol_Opener - standalone.ahk +++ b/standalones/Mansol_Opener - standalone.ahk @@ -1,40 +1,40 @@ -#SingleInstance force - -; The exe this is compiled into has manual.ico set as its icon. - -!+S::gui() - -gui() -{ - static Number - static Hidden - - Gui, +AlwaysOnTop +ToolWindow - - Gui, Add, Edit, x2 y3 w78 h20 vNumber +Left, - Gui, Add, Button, x22 y43 w70 h20 Default vHidden, Ok - Gui, Add, Button, x81 y3 w17 h20 gHelp +Center, ? - Gui, Show, h28 w100, ManSol - GuiControl, Hide, Hidden - - Return - - ButtonOk: - Gui, submit ; I have no idea what the regex means any more... - If RegExMatch(Number, "[[:alpha:]]+") - run, % "http://serviceadvisor.deere.com/WebSA/manuals/" . Number - Else If RegExMatch(Number, "[[:digit:]]+") - run, % "https://ccms.deere.com/prweb/PRServletCustomAuth/ZDate_MgiNPn1ccL6O6pyBurDs0hjFQ8*/!STANDARD?pyActivity=SolutionsSnapStart&Action=showHarness&className=Deere-Int-Solr-Docs&Purpose=SolutionDescriptionNew&SolutionID=" . Number . "&Language=Default" - ExitApp -Return - - - Help: - Run, https://daviddaily.dev/david/d3k/wiki/ManSol - Return - - GuiClose: - GuiEscape: - Gui, Destroy - Return -} +#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://serviceadvisor.deere.com/WebSA/solutions/en/" . Number + ExitApp +Return + + + Help: + Run, https://daviddaily.dev/david/d3k/wiki/ManSol + Return + + GuiClose: + GuiEscape: + Gui, Destroy + Return +} From 2a4cf2dbda24fa968790ce74288f5174a259416d Mon Sep 17 00:00:00 2001 From: David Daily Date: Thu, 13 Jan 2022 13:47:41 -0600 Subject: [PATCH 08/10] replace ugly CCMS link with Service Advisor --- Mansol_Opener.ahk | 64 +++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Mansol_Opener.ahk b/Mansol_Opener.ahk index 4d5a5b6..d3aee3e 100644 --- a/Mansol_Opener.ahk +++ b/Mansol_Opener.ahk @@ -1,33 +1,33 @@ -#SingleInstance force ; Only one instance at a time -SendMode, Input -FileEncoding, UTF-8 ; Makes sure the special characters don't break stuff - -Menu, Tray, Icon, %A_MyDocuments%\D3K\icons\manual.ico - -Gui, +AlwaysOnTop +ToolWindow - -Gui, Add, Edit, x2 y3 w78 h20 vNumber +Left, -Gui, Add, Button, x22 y43 w70 h20 Default vHidden, Ok -Gui, Add, Button, x81 y3 w17 h20 gHelp +Center, ? -Gui, Show, h28 w100, ManSol -GuiControl, Hide, Hidden - -Return - -ButtonOk: - Gui, submit ; I have no idea what the regex means any more... - If RegExMatch(Number, "[[:alpha:]]+") - run, % "http://serviceadvisor.deere.com/WebSA/manuals/" . Number - Else If RegExMatch(Number, "[[:digit:]]+") - run, % "https://ccms.deere.com/prweb/PRServletCustomAuth/ZDate_MgiNPn1ccL6O6pyBurDs0hjFQ8*/!STANDARD?pyActivity=SolutionsSnapStart&Action=showHarness&className=Deere-Int-Solr-Docs&Purpose=SolutionDescriptionNew&SolutionID=" . Number . "&Language=Default" - ExitApp -Return - - -Help: - MsgBox, 262176, Maual & Solution opener, Input the TM/OM SKU (easily ofund on TechPubs) or the DTAC solution number to open it in your default browser.`nTMs & OMs open in Service Advisor. -Return - -GuiClose: -GuiEscape: +#SingleInstance force ; Only one instance at a time +SendMode, Input +FileEncoding, UTF-8 ; Makes sure the special characters don't break stuff + +Menu, Tray, Icon, %A_MyDocuments%\D3K\icons\manual.ico + +Gui, +AlwaysOnTop +ToolWindow + +Gui, Add, Edit, x2 y3 w78 h20 vNumber +Left, +Gui, Add, Button, x22 y43 w70 h20 Default vHidden, Ok +Gui, Add, Button, x81 y3 w17 h20 gHelp +Center, ? +Gui, Show, h28 w100, ManSol +GuiControl, Hide, Hidden + +Return + +ButtonOk: + Gui, submit ; I have no idea what the regex means any more... + If RegExMatch(Number, "[[:alpha:]]+") + run, % "http://serviceadvisor.deere.com/WebSA/manuals/" . Number + Else If RegExMatch(Number, "[[:digit:]]+") + run, % "https://serviceadvisor.deere.com/WebSA/solutions/en/" . Number + ExitApp +Return + + +Help: + MsgBox, 262176, Maual & Solution opener, Input the TM/OM SKU (easily ofund on TechPubs) or the DTAC solution number to open it in your default browser.`nTMs & OMs open in Service Advisor. +Return + +GuiClose: +GuiEscape: ExitApp \ No newline at end of file From d434dc3f1eba706aacff142b47ff13b2efff1bcb Mon Sep 17 00:00:00 2001 From: David Daily Date: Thu, 13 Jan 2022 14:21:49 -0600 Subject: [PATCH 09/10] Update 'standalones/Mansol_Opener - standalone.ahk' --- standalones/Mansol_Opener - standalone.ahk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/standalones/Mansol_Opener - standalone.ahk b/standalones/Mansol_Opener - standalone.ahk index 2146d62..1e2f853 100644 --- a/standalones/Mansol_Opener - standalone.ahk +++ b/standalones/Mansol_Opener - standalone.ahk @@ -1,4 +1,5 @@ #SingleInstance force +Menu, Tray, Add, Open Manual/Solution, gui ; The exe this is compiled into has manual.ico set as its icon. @@ -30,7 +31,7 @@ Return Help: - Run, https://daviddaily.dev/david/d3k/wiki/ManSol + Run, https://daviddaily.dev/david/d3k/wiki/ManSol-Opener-Standalone Return GuiClose: From 5a4d36ff44ac9801b983af9bf7c4d8cef3ccb237 Mon Sep 17 00:00:00 2001 From: David Daily Date: Wed, 1 Feb 2023 14:42:26 -0600 Subject: [PATCH 10/10] make everything better --- msmv.ahk | 50 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 9 deletions(-) diff --git a/msmv.ahk b/msmv.ahk index 14f782f..b95b9dc 100644 --- a/msmv.ahk +++ b/msmv.ahk @@ -1,16 +1,30 @@ #SingleInstance, force +CoordMode, Mouse, Screen +waittime := 180000 + +Switch A_Args[1] +{ +Case "on": + Menu, Tray, NoIcon + Goto, Start +Case "off": + ExitApp +} + +Menu, Tray, Add, Hide GUI, GuiToggle ; Adds a button to toggle the gui +Menu, Tray, Add, Exit, GuiClose ; Exit button +Menu, Tray, NoStandard ; None of the standard tray buttons Gui, +AlwaysOnTop +ToolWindow - -Gui, Add, Button, x3 y3 w55 h20 gStart vStart +Center, Start -Gui, Add, Button, x3 y3 w55 h20 gStop vStop +Center, Stop +Gui, Add, Button, x3 y3 w55 h20 gStart +Center, Start +Gui, Add, Button, x3 y3 w55 h20 gStop +Center, Stop Gui, Show, h28 w60, msmv -GuiControl, Hide, Stop +GuiControl, Hide, Stop ; Since we want the Start button to show first Return Start: GuiControl, Hide, Start - SetTimer, Msmv, 480000 + SetTimer, Msmv, %waittime% ; Checks if the has been input in the last 2 minutes every 30 secs, easier to stop a loop with SetTimer GuiControl, Show, Stop Return @@ -21,11 +35,29 @@ Stop: Return Msmv: - MouseMove, 100, 0 - Sleep, 240000 - MouseMove, 0, 0 + If (A_TimeIdle > waittime) ; https://www.autohotkey.com/docs/Variables.htm#User_Idle_Time + { + Random, x,, %A_ScreenWidth% + Random, y,, %A_ScreenHeight% + MouseMove %x%, %y% + } +Return + +GuiToggle: + If !nogui + { + Gui, Hide + Menu, Tray, Check, Hide GUI + nogui := True + } + Else + { + Menu, Tray, uncheck, Hide GUI + nogui := False + Gui, Show + } Return GuiClose: GuiEscape: -ExitApp ; Closes the app when escape or the exit button is pressed +ExitApp ; Closes the app when escape or the exit button is pressed \ No newline at end of file