autoit-scripts – Blame information for rev 2

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