autoit-scripts – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | #NoTrayIcon |
2 | #Region ;**** Directives created by AutoIt3Wrapper_GUI **** |
||
3 | #AutoIt3Wrapper_Icon=favicon.ico |
||
4 | #AutoIt3Wrapper_Outfile=Release\x86\AutoRun.exe |
||
5 | #AutoIt3Wrapper_Outfile_x64=Release\x64\AutoRun_x64.exe |
||
6 | #AutoIt3Wrapper_Compression=0 |
||
7 | #AutoIt3Wrapper_Res_Comment=Hold shift key down in order to simulate autorun for games that do not have an autorun feature. |
||
8 | #AutoIt3Wrapper_Res_Description=Hold shift key down in order to simulate autorun for games that do not have an autorun feature. |
||
9 | #AutoIt3Wrapper_Res_Fileversion=1.0.0.7 |
||
10 | #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y |
||
11 | #AutoIt3Wrapper_Res_Fileversion_First_Increment=y |
||
12 | #AutoIt3Wrapper_Res_ProductName=AutoRun |
||
13 | #AutoIt3Wrapper_Res_ProductVersion=1.0 |
||
14 | #AutoIt3Wrapper_Res_CompanyName=Wizardry and Steamworks |
||
15 | #AutoIt3Wrapper_Res_LegalCopyright=Copyright © 2018 Wizardry and Steamworks |
||
16 | #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker |
||
17 | #AutoIt3Wrapper_Res_Field=Made By|Wizardry and Steamworks |
||
18 | #AutoIt3Wrapper_Res_Field=Email|office@grimore.org |
||
19 | #AutoIt3Wrapper_Res_Field=AutoIt Version|%AutoItVer% |
||
20 | #AutoIt3Wrapper_Res_Field=Compile Date|%date% %time% |
||
21 | #AutoIt3Wrapper_AU3Check_Stop_OnWarning=y |
||
22 | #AutoIt3Wrapper_AU3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 |
||
23 | #AutoIt3Wrapper_Run_After=for %I in ("%in%" "directives.au3") do copy %I "C:\Program Files (x86)\autoit3\SciTE\AutoIt3Wrapper" |
||
24 | #AutoIt3Wrapper_Run_Tidy=y |
||
25 | #Tidy_Parameters=/sort_funcs /reel |
||
26 | #AutoIt3Wrapper_Run_Au3Stripper=y |
||
27 | #Au3Stripper_Parameters=/debug |
||
28 | #AutoIt3Wrapper_Versioning=v |
||
29 | #AutoIt3Wrapper_Versioning_Parameters=/Comments %fileversionnew% |
||
30 | #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** |
||
31 | |||
32 | ; Copyright 2018 Wizardry and Steamworks - MIT LICENSE |
||
33 | ; |
||
34 | ; Permission is hereby granted, free of charge, to any person obtaining a |
||
35 | ; copy of this software and associated documentation files (the Software), |
||
36 | ; to deal in the Software without restriction, including without |
||
37 | ; limitation the rights to use, copy, modify, merge, publish, distribute, |
||
38 | ; sublicense, and/or sell copies of the Software, and to permit persons to |
||
39 | ; whom the Software is furnished to do so, subject to the following |
||
40 | ; conditions: |
||
41 | ; |
||
42 | ; The above copyright notice and this permission notice shall be included |
||
43 | ; in all copies or substantial portions of the Software. |
||
44 | ; |
||
45 | ; THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||
46 | ; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||
47 | ; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||
48 | ; THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
||
49 | ; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
||
50 | ; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
||
51 | ; OTHER DEALINGS IN THE SOFTWARE. |
||
52 | |||
53 | Global Const $VERSION = "1.0.0.7" |
||
54 | #AutoIt3Wrapper_Testing=n |
||
55 | #pragma compile(AutoItExecuteAllowed, true) |
||
56 | #AutoIt3Wrapper_ShowProgress=n |
||
57 | |||
58 | #include <WinAPISys.au3> |
||
59 | #include <WinAPIFiles.au3> |
||
60 | #include <WinAPIvkeysConstants.au3> |
||
61 | #include <File.au3> |
||
62 | #include <FileConstants.au3> |
||
63 | #include <MsgBoxConstants.au3> |
||
64 | #include <AutoItConstants.au3> |
||
65 | #include <StringConstants.au3> |
||
66 | ; Required for the $TRAY_CHECKED and $TRAY_ICONSTATE_SHOW constants. |
||
67 | #include <TrayConstants.au3> |
||
68 | ; Base64 encoder / decoder by J2TEAM (https://github.com/J2TEAM) |
||
69 | #include "Base64.au3" |
||
70 | |||
71 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
72 | ;; INTERNALS ;; |
||
73 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
74 | |||
75 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
76 | ;; MAIN LOOP ;; |
||
77 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
78 | |||
79 | ; Setup termination handler. |
||
80 | OnAutoItExitRegister("Terminate") |
||
81 | |||
82 | ; Setup tray icon menu. |
||
83 | Opt("TrayMenuMode", 3) |
||
84 | Opt("TrayOnEventMode", 1) |
||
85 | Opt("SendCapslockMode", 0) |
||
86 | |||
87 | TrayCreateItem("On", -1, -1, $TRAY_ITEM_RADIO) |
||
88 | TrayItemSetState(-1, $TRAY_CHECKED) |
||
89 | TrayItemSetOnEvent(-1, "TrayMenuOn") |
||
90 | TrayCreateItem("Off", -1, -1, $TRAY_ITEM_RADIO) |
||
91 | TrayItemSetOnEvent(-1, "TrayMenuOff") |
||
92 | TrayCreateItem("") |
||
93 | TrayCreateItem("About") |
||
94 | TrayItemSetOnEvent(-1, "TrayMenuAbout") |
||
95 | TrayCreateItem("Exit", -1, -1) |
||
96 | TrayItemSetOnEvent(-1, "TrayMenuExit") |
||
97 | |||
98 | ; -5 for EXE |
||
99 | TraySetIcon(@ScriptFullPath, -5) |
||
100 | TraySetState($TRAY_ICONSTATE_SHOW) |
||
101 | |||
102 | Global $capsState = 0, $scriptEnabled = 1 |
||
103 | |||
104 | ; Run main event loop. |
||
105 | While 1 |
||
106 | If $scriptEnabled == 1 Then |
||
107 | ToggleAutoRun() |
||
108 | EndIf |
||
109 | Sleep(100) |
||
110 | WEnd |
||
111 | |||
112 | Func _GetCaps() |
||
113 | Local $aOnOff[2] = ['OFF', 'ON'] |
||
114 | Return $aOnOff[BitAND(_WinAPI_GetKeyState($VK_CAPITAL), 1)] |
||
115 | EndFunc ;==>_GetCaps |
||
116 | |||
117 | ; Function definitions |
||
118 | |||
119 | Func Terminate() |
||
120 | ConsoleWrite("Terminating..." & @CRLF) |
||
121 | Send("{LSHIFT UP}") |
||
122 | EndFunc ;==>Terminate |
||
123 | |||
124 | Func ToggleAutoRun() |
||
125 | Switch _GetCaps() |
||
126 | Case "ON" |
||
127 | If $capsState == 0 Then |
||
128 | ConsoleWrite("Activating Auto Run" & @CRLF) |
||
129 | Send("{LSHIFT DOWN}") |
||
130 | $capsState = 1 |
||
131 | EndIf |
||
132 | Case "OFF" |
||
133 | If $capsState == 1 Then |
||
134 | ConsoleWrite("Deactivating Auto Run." & @CRLF) |
||
135 | Send("{LSHIFT UP}") |
||
136 | $capsState = 0 |
||
137 | EndIf |
||
138 | EndSwitch |
||
139 | EndFunc ;==>ToggleAutoRun |
||
140 | |||
141 | Func TrayMenuAbout() |
||
142 | MsgBox($MB_SYSTEMMODAL, "", "AutoRun ~ Hold down shift button." & @CRLF & @CRLF & _ |
||
143 | "Version: " & FileGetVersion(@ScriptFullPath) & @CRLF & _ |
||
144 | "Install Path: " & StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", $STR_NOCASESENSEBASIC, -1) - 1)) |
||
145 | EndFunc ;==>TrayMenuAbout |
||
146 | |||
147 | Func TrayMenuExit() |
||
148 | Exit |
||
149 | EndFunc ;==>TrayMenuExit |
||
150 | |||
151 | Func TrayMenuOff() |
||
152 | $scriptEnabled = 0 |
||
153 | If $capsState == 1 Then |
||
154 | Send("{LSHIFT UP}") |
||
155 | EndIf |
||
156 | EndFunc ;==>TrayMenuOff |
||
157 | |||
158 | Func TrayMenuOn() |
||
159 | $scriptEnabled = 1 |
||
160 | EndFunc ;==>TrayMenuOn |