├── Help.chm ├── RLIcon.ico ├── FontFunctions.ahk ├── FontSelector.ahk ├── FontSelector.txt ├── Rocket Chat.exe ├── dx9_overlay.dll ├── RocketChatIcon.ico ├── exe ├── Rocket Chat.exe └── RocketChatInstaller.exe ├── RocketChatInstaller.exe ├── README.md ├── KnownBugs.txt ├── DefaultOverlay ├── DefaultMessages ├── RocketChatInstaller.ahk ├── overlay.ahk └── RocketChatMain.ahk /Help.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/Help.chm -------------------------------------------------------------------------------- /RLIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/RLIcon.ico -------------------------------------------------------------------------------- /FontFunctions.ahk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/FontFunctions.ahk -------------------------------------------------------------------------------- /FontSelector.ahk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/FontSelector.ahk -------------------------------------------------------------------------------- /FontSelector.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/FontSelector.txt -------------------------------------------------------------------------------- /Rocket Chat.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/Rocket Chat.exe -------------------------------------------------------------------------------- /dx9_overlay.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/dx9_overlay.dll -------------------------------------------------------------------------------- /RocketChatIcon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/RocketChatIcon.ico -------------------------------------------------------------------------------- /exe/Rocket Chat.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/exe/Rocket Chat.exe -------------------------------------------------------------------------------- /RocketChatInstaller.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/RocketChatInstaller.exe -------------------------------------------------------------------------------- /exe/RocketChatInstaller.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OneMooreByte/RocketChat/HEAD/exe/RocketChatInstaller.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RocketChat 2 | RocketChat may be seen as a cheating software by some games, notably PUBG, and could result in a ban 3 | -------------------------------------------------------------------------------- /KnownBugs.txt: -------------------------------------------------------------------------------- 1 | Overlay is sometimes half populated 2 | Overlay sometimes not visible 3 | Some users can never get overlay 4 | Sometimes a long message will lose some characters 5 | The program can be seen as a cheating by some other games "Anti-cheat" software, notably PUBG. Please close this when running other games. 6 | -------------------------------------------------------------------------------- /DefaultOverlay: -------------------------------------------------------------------------------- 1 | [Settings] 2 | OverlayON=1 3 | OverlayX=20 4 | OverlayY=250 5 | FontSize=10 6 | BgColor=1B4667 7 | BgOpac=80 8 | BgWidth=100 9 | MenuTimerON=1 10 | MsgColor=B0FFFF 11 | MsgFont=Arial 12 | MsgModifier=1 13 | TeamColor=B0FFFF 14 | TeamFont=Arial 15 | TeamModifier=1 16 | TeamFlatOffset=2 17 | OverlayCharLim=20 18 | LabelsON=1 19 | LblColor=B0FFFF 20 | LblFont=Arial 21 | LblModifier=1 22 | LblArrow=1 23 | -------------------------------------------------------------------------------- /DefaultMessages: -------------------------------------------------------------------------------- 1 | [Chat] 2 | UpUp=I got it! 3 | TeamUpUp=1 4 | UpLeft=Centering... 5 | TeamUpLeft=1 6 | UpRight=Take the shot! 7 | TeamUpRight=1 8 | UpDown=Defending... 9 | TeamUpDown=1 10 | LeftUp=Nice shot! 11 | TeamLeftUp=0 12 | LeftLeft=Great pass! 13 | TeamLeftLeft=0 14 | LeftRight=Thanks! 15 | TeamLeftRight=0 16 | LeftDown=What a save! 17 | TeamLeftDown=0 18 | RightUp=OMG! 19 | TeamRightUp=0 20 | RightLeft=Noooo! 21 | TeamRightLeft=0 22 | RightRight=Wow! 23 | TeamRightRight=0 24 | RightDown=Close one! 25 | TeamRightDown=0 26 | DownUp=$#@%! 27 | TeamDownUp=0 28 | DownLeft=No Problem. 29 | TeamDownLeft=0 30 | DownRight=Whoops... 31 | TeamDownRight=0 32 | DownDown=Sorry! 33 | TeamDownDown=0 34 | UpHold=We got this! 35 | TeamUpHold=1 36 | LeftHold=[Good] play! 37 | TeamLeftHold=0 38 | RightHold=Clutch! 39 | TeamRightHold=0 40 | DownHold=You're Welcome! 41 | TeamDownHold=0 42 | BankNeedle1=[Good] 43 | BankOptions1=Great, Awesome, Superb, Rad, Magnificent, Wonderful, What a, Spectacular, Good, Nice, Amazing, Impressive, Beautiful 44 | WordBankSelectType1=2 45 | BankNeedle2= 46 | BankOptions2= 47 | WordBankSelectType2=2 48 | BankNeedle3= 49 | BankOptions3= 50 | WordBankSelectType3=2 51 | BankNeedle4= 52 | BankOptions4= 53 | WordBankSelectType4=2 54 | BankNeedle5= 55 | BankOptions5= 56 | WordBankSelectType5=2 57 | BankNeedle6= 58 | BankOptions6= 59 | WordBankSelectType6=2 60 | BankNeedle7= 61 | BankOptions7= 62 | WordBankSelectType7=2 63 | BankNeedle8= 64 | BankOptions8= 65 | WordBankSelectType8=2 66 | [Settings] 67 | OverlayON=1 68 | -------------------------------------------------------------------------------- /RocketChatInstaller.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | ; #Warn ; Enable warnings to assist with detecting common errors. 3 | #SingleInstance force 4 | if not A_IsAdmin 5 | { 6 | Run *RunAs "%A_ScriptFullPath%",,UseErrorLevel 7 | ExitApp 8 | } 9 | ProgramName = Rocket Chat 10 | StartMenu := GetCommonPath("PROGRAMS") 11 | ProgramFolder := GetCommonPath("PROGRAM_FILES") 12 | Gui, 1:New,, Rocket Chat Installer 13 | Gui, Font, s11, Arial 14 | Gui, Add, Text,x15 y10 w350 Center, Welcome to the Rocket Chat Installer`nPlease select an option 15 | Gui, Add, Button,x15 y+15 w100 gUninstall, Uninstall 16 | Gui, Add, Button,x265 yp w100 gInstall, Install 17 | Gui, 1:Show, w380, Rocket Chat Installer 18 | Return 19 | 20 | Uninstall: 21 | MsgBox, 4,Uninstall, Are you sure you want to uninstall Rocket Chat? 22 | IfMsgBox Yes 23 | { 24 | Gui, Uninstalling:New,-SysMenu,Uninstalling 25 | Gui, Uninstalling:Font, s11, Arial 26 | Gui, Uninstalling:Add, Text,x15 y10, Uninstalling 27 | Gui, Uninstalling:Show 28 | IfExist, %ProgramFolder%\%ProgramName% 29 | { 30 | FileRemoveDir, %ProgramFolder%\%ProgramName%, 1 31 | If ErrorLevel != 0 32 | { 33 | GoSub UninstallFail 34 | Return 35 | } 36 | } 37 | IfExist, %A_AppData%\%ProgramName% 38 | { 39 | FileRemoveDir, %A_AppData%\%ProgramName%, 1 40 | If ErrorLevel != 0 41 | { 42 | GoSub UninstallFail 43 | Return 44 | } 45 | } 46 | IfExist, %StartMenu%\%ProgramName%.lnk 47 | { 48 | FileDelete, %StartMenu%\%ProgramName%.lnk 49 | If ErrorLevel != 0 50 | { 51 | GoSub UninstallFail 52 | Return 53 | } 54 | } 55 | MsgBox,,Uninstall Successful, Rocket Chat has been uninstalled 56 | ExitApp 57 | } 58 | Return 59 | 60 | UninstallFail: 61 | Gui, Uninstalling:Destroy 62 | MsgBox,,Uninstall Failed, Uninstall Failed`nMake sure Rocket Chat is closed 63 | Return 64 | 65 | Install: 66 | Gui, Installing:New,-SysMenu,Installing 67 | Gui, Installing:Font, s11, Arial 68 | Gui, Installing:Add, Text,x15 y10, Installing 69 | Gui, Installing:Show 70 | FileCreateDir, %ProgramFolder%\%ProgramName% 71 | FileInstall, Rocket Chat.exe, %ProgramFolder%\%ProgramName%\Rocket Chat.exe,1 72 | If ErrorLevel != 0 73 | { 74 | Gui, Installing:Destroy 75 | MsgBox,,Install Failed, Install Failed`nMake sure there is not a previous version of Rocket Chat open 76 | Return 77 | } 78 | FileCreateShortcut, %ProgramFolder%\%ProgramName%\Rocket Chat.exe, %StartMenu%\Rocket Chat.lnk 79 | Gui, Installing:Destroy 80 | MsgBox, 4,Install Successful, Would you like to launch Rocket Chat now? 81 | IfMsgBox Yes 82 | Run %ProgramFolder%\%ProgramName%\Rocket Chat.exe 83 | ExitApp 84 | Return 85 | 86 | GuiClose: 87 | ExitApp 88 | return 89 | 90 | GetCommonPath( csidl ) 91 | { 92 | static init 93 | 94 | if !init 95 | { 96 | CSIDL_APPDATA =0x001A ; Application Data, new for NT4 97 | CSIDL_COMMON_APPDATA =0x0023 ; All Users\Application Data 98 | CSIDL_COMMON_DOCUMENTS =0x002e ; All Users\Documents 99 | CSIDL_DESKTOP =0x0010 ; C:\Documents and Settings\username\Desktop 100 | CSIDL_FONTS =0x0014 ; C:\Windows\Fonts 101 | CSIDL_LOCAL_APPDATA =0x001C ; non roaming, user\Local Settings\Application Data 102 | CSIDL_MYMUSIC =0x000d ; "My Music" folder 103 | CSIDL_MYPICTURES =0x0027 ; My Pictures, new for Win2K 104 | CSIDL_PERSONAL =0x0005 ; My Documents 105 | CSIDL_PROGRAM_FILES_COMMON =0x002b ; C:\Program Files\Common 106 | CSIDL_PROGRAM_FILES =0x0026 ; C:\Program Files 107 | CSIDL_PROGRAMS =0x0002 ; C:\Documents and Settings\username\Start Menu\Programs 108 | CSIDL_RESOURCES =0x0038 ; %windir%\Resources\, For theme and other windows resources. 109 | CSIDL_STARTMENU =0x000b ; C:\Documents and Settings\username\Start Menu 110 | CSIDL_STARTUP =0x0007 ; C:\Documents and Settings\username\Start Menu\Programs\Startup. 111 | CSIDL_SYSTEM =0x0025 ; GetSystemDirectory() 112 | CSIDL_WINDOWS =0x0024 ; GetWindowsDirectory() 113 | } 114 | 115 | 116 | val = % CSIDL_%csidl% 117 | VarSetCapacity(fpath, 256) 118 | DllCall( "shell32\SHGetFolderPathA", "uint", 0, "int", val, "uint", 0, "int", 0, "str", fpath) 119 | return %fpath% 120 | } -------------------------------------------------------------------------------- /overlay.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv 2 | 3 | 4 | PATH_OVERLAY =%AppFolder%\dx9_overlay.dll 5 | hModule := DllCall("LoadLibrary", Str, PATH_OVERLAY) 6 | if(hModule == -1 || hModule == 0) 7 | { 8 | MsgBox, 48, Error, The dll-file couldn't be found! 9 | ExitApp 10 | } 11 | 12 | 13 | Init_func := DllCall("GetProcAddress", UInt, hModule, Str, "Init") 14 | SetParam_func := DllCall("GetProcAddress", UInt, hModule, Str, "SetParam") 15 | 16 | TextCreate_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextCreate") 17 | TextDestroy_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextDestroy") 18 | TextSetShadow_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetShadow") 19 | TextSetShown_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetShown") 20 | TextSetColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetColor") 21 | TextSetPos_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetPos") 22 | TextSetString_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextSetString") 23 | TextUpdate_func := DllCall("GetProcAddress", UInt, hModule, Str, "TextUpdate") 24 | 25 | BoxCreate_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxCreate") 26 | BoxDestroy_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxDestroy") 27 | BoxSetShown_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetShown") 28 | BoxSetBorder_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetBorder") 29 | BoxSetBorderColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetBorderColor") 30 | BoxSetColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetColor") 31 | BoxSetHeight_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetHeight") 32 | BoxSetPos_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetPos") 33 | BoxSetWidth_func := DllCall("GetProcAddress", UInt, hModule, Str, "BoxSetWidth") 34 | 35 | LineCreate_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineCreate") 36 | LineDestroy_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineDestroy") 37 | LineSetShown_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineSetShown") 38 | LineSetColor_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineSetColor") 39 | LineSetWidth_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineSetWidth") 40 | LineSetPos_func := DllCall("GetProcAddress", UInt, hModule, Str, "LineSetPos") 41 | 42 | ImageCreate_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageCreate") 43 | ImageDestroy_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageDestroy") 44 | ImageSetShown_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageSetShown") 45 | ImageSetAlign_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageSetAlign") 46 | ImageSetPos_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageSetPos") 47 | ImageSetRotation_func := DllCall("GetProcAddress", UInt, hModule, Str, "ImageSetRotation") 48 | 49 | DestroyAllVisual_func := DllCall("GetProcAddress", UInt, hModule, Str, "DestroyAllVisual") 50 | ShowAllVisual_func := DllCall("GetProcAddress", UInt, hModule, Str, "ShowAllVisual") 51 | HideAllVisual_func := DllCall("GetProcAddress", UInt, hModule, Str, "HideAllVisual") 52 | 53 | GetFrameRate_func := DllCall("GetProcAddress", UInt, hModule, Str, "GetFrameRate") 54 | GetScreenSpecs_func := DllCall("GetProcAddress", UInt, hModule, Str, "GetScreenSpecs") 55 | 56 | SetCalculationRatio_func:= DllCall("GetProcAddress", UInt, hModule, Str, "SetCalculationRatio") 57 | 58 | SetOverlayPriority_func := DllCall("GetProcAddress", UInt, hModule, Str, "SetOverlayPriority") 59 | 60 | Init() 61 | { 62 | global Init_func 63 | res := DllCall(Init_func) 64 | return res 65 | } 66 | 67 | SetParam(str_Name, str_Value) 68 | { 69 | global SetParam_func 70 | res := DllCall(SetParam_func, Str, str_Name, Str, str_Value) 71 | return res 72 | } 73 | 74 | TextCreate(Font, fontsize, bold, italic, x, y, color, text, shadow, show) 75 | { 76 | global TextCreate_func 77 | res := DllCall(TextCreate_func,Str,Font,Int,fontsize,UChar,bold,UChar,italic,Int,x,Int,y,UInt,color,Str,text,UChar,shadow,UChar,show) 78 | return res 79 | } 80 | 81 | TextDestroy(id) 82 | { 83 | global TextDestroy_func 84 | res := DllCall(TextDestroy_func,Int,id) 85 | return res 86 | } 87 | 88 | TextSetShadow(id, shadow) 89 | { 90 | global TextSetShadow_func 91 | res := DllCall(TextSetShadow_func,Int,id,UChar,shadow) 92 | return res 93 | } 94 | 95 | TextSetShown(id, show) 96 | { 97 | global TextSetShown_func 98 | res := DllCall(TextSetShown_func,Int,id,UChar,show) 99 | return res 100 | } 101 | 102 | TextSetColor(id,color) 103 | { 104 | global TextSetColor_func 105 | res := DllCall(TextSetColor_func,Int,id,UInt,color) 106 | return res 107 | } 108 | 109 | TextSetPos(id,x,y) 110 | { 111 | global TextSetPos_func 112 | res := DllCall(TextSetPos_func,Int,id,Int,x,Int,y) 113 | return res 114 | } 115 | 116 | TextSetString(id,Text) 117 | { 118 | global TextSetString_func 119 | res := DllCall(TextSetString_func,Int,id,Str,Text) 120 | return res 121 | } 122 | 123 | TextUpdate(id,Font,Fontsize,bold,italic) 124 | { 125 | global TextUpdate_func 126 | res := DllCall(TextUpdate_func,Int,id,Str,Font,int,Fontsize,UChar,bold,UChar,italic) 127 | return res 128 | } 129 | 130 | BoxCreate(x,y,width,height,Color,show) 131 | { 132 | global BoxCreate_func 133 | res := DllCall(BoxCreate_func,Int,x,Int,y,Int,width,Int,height,UInt,Color,UChar,show) 134 | return res 135 | } 136 | 137 | BoxDestroy(id) 138 | { 139 | global BoxDestroy_func 140 | res := DllCall(BoxDestroy_func,Int,id) 141 | return res 142 | } 143 | 144 | BoxSetShown(id,Show) 145 | { 146 | global BoxSetShown_func 147 | res := DllCall(BoxSetShown_func,Int,id,UChar,Show) 148 | return res 149 | } 150 | 151 | BoxSetBorder(id,height,Show) 152 | { 153 | global BoxSetBorder_func 154 | res := DllCall(BoxSetBorder_func,Int,id,Int,height,Int,Show) 155 | return res 156 | } 157 | 158 | 159 | BoxSetBorderColor(id,Color) 160 | { 161 | global BoxSetBorderColor_func 162 | res := DllCall(BoxSetBorderColor_func,Int,id,UInt,Color) 163 | return res 164 | } 165 | 166 | BoxSetColor(id,Color) 167 | { 168 | global BoxSetColor_func 169 | res := DllCall(BoxSetColor_func,Int,id,UInt,Color) 170 | return res 171 | } 172 | 173 | BoxSetHeight(id,height) 174 | { 175 | global BoxSetHeight_func 176 | res := DllCall(BoxSetHeight_func,Int,id,Int,height) 177 | return res 178 | } 179 | 180 | BoxSetPos(id,x,y) 181 | { 182 | global BoxSetPos_func 183 | res := DllCall(BoxSetPos_func,Int,id,Int,x,Int,y) 184 | return res 185 | } 186 | 187 | BoxSetWidth(id,width) 188 | { 189 | global BoxSetWidth_func 190 | res := DllCall(BoxSetWidth_func,Int,id,Int,width) 191 | return res 192 | } 193 | 194 | LineCreate(x1,y1,x2,y2,width,color,show) 195 | { 196 | global LineCreate_func 197 | res := DllCall(LineCreate_func,Int,x1,Int,y1,Int,x2,Int,y2,Int,Width,UInt,color,UChar,show) 198 | return res 199 | } 200 | 201 | LineDestroy(id) 202 | { 203 | global LineDestroy_func 204 | res := DllCall(LineDestroy_func,Int,id) 205 | return res 206 | } 207 | 208 | LineSetShown(id,show) 209 | { 210 | global LineSetShown_func 211 | res := DllCall(LineSetShown_func,Int,id,UChar,show) 212 | return res 213 | } 214 | 215 | LineSetColor(id,color) 216 | { 217 | global LineSetColor_func 218 | res := DllCall(LineSetColor_func,Int,id,UInt,color) 219 | return res 220 | } 221 | 222 | LineSetWidth(id, width) 223 | { 224 | global LineSetWidth_func 225 | res := DllCall(LineSetWidth_func,Int,id,Int,width) 226 | return res 227 | } 228 | 229 | LineSetPos(id,x1,y1,x2,y2) 230 | { 231 | global LineSetPos_func 232 | res := DllCall(LineSetPos_func,Int,id,Int,x1,Int,y1,Int,x2,Int,y2) 233 | return res 234 | } 235 | 236 | ImageCreate(path, x, y, rotation, align, show) 237 | { 238 | global ImageCreate_func 239 | res := DllCall(ImageCreate_func, Str, path, Int, x, Int, y, Int, rotation, Int, align, UChar, show) 240 | return res 241 | } 242 | 243 | ImageDestroy(id) 244 | { 245 | global ImageDestroy_func 246 | res := DllCall(ImageDestroy_func,Int,id) 247 | return res 248 | } 249 | 250 | ImageSetShown(id,show) 251 | { 252 | global ImageSetShown_func 253 | res := DllCall(ImageSetShown_func,Int,id,UChar,show) 254 | return res 255 | } 256 | 257 | ImageSetAlign(id,align) 258 | { 259 | global ImageSetAlign_func 260 | res := DllCall(ImageSetAlign_func,Int,id,Int,align) 261 | return res 262 | } 263 | 264 | ImageSetPos(id, x, y) 265 | { 266 | global ImageSetPos_func 267 | res := DllCall(ImageSetPos_func,Int,id,Int,x, Int, y) 268 | return res 269 | } 270 | 271 | ImageSetRotation(id, rotation) 272 | { 273 | global ImageSetRotation_func 274 | res := DllCall(ImageSetRotation_func,Int,id,Int, rotation) 275 | return res 276 | } 277 | 278 | DestroyAllVisual() 279 | { 280 | global DestroyAllVisual_func 281 | res := DllCall(DestroyAllVisual_func) 282 | return res 283 | } 284 | 285 | ShowAllVisual() 286 | { 287 | global ShowAllVisual_func 288 | res := DllCall(ShowAllVisual_func) 289 | return res 290 | } 291 | 292 | HideAllVisual() 293 | { 294 | global HideAllVisual_func 295 | res := DllCall(HideAllVisual_func ) 296 | return res 297 | } 298 | 299 | GetFrameRate() 300 | { 301 | global GetFrameRate_func 302 | res := DllCall(GetFrameRate_func ) 303 | return res 304 | } 305 | 306 | GetScreenSpecs(ByRef width, ByRef height) 307 | { 308 | global GetScreenSpecs_func 309 | res := DllCall(GetScreenSpecs_func, IntP, width, IntP, height) 310 | return res 311 | } 312 | 313 | SetCalculationRatio(width, height) 314 | { 315 | global SetCalculationRatio_func 316 | res := DllCall(SetCalculationRatio_func, Int, width, Int, height) 317 | return res 318 | } 319 | 320 | SetOverlayPriority(id, priority) 321 | { 322 | global SetOverlayPriority_func 323 | res := DllCall(SetOverlayPriority_func, Int, id, Int, priority) 324 | return res 325 | } 326 | 327 | RelToAbs(root, dir, s = "\") { 328 | pr := SubStr(root, 1, len := InStr(root, s, "", InStr(root, s . s) + 2) - 1) 329 | , root := SubStr(root, len + 1), sk := 0 330 | If InStr(root, s, "", 0) = StrLen(root) 331 | StringTrimRight, root, root, 1 332 | If InStr(dir, s, "", 0) = StrLen(dir) 333 | StringTrimRight, dir, dir, 1 334 | Loop, Parse, dir, %s% 335 | { 336 | If A_LoopField = .. 337 | StringLeft, root, root, InStr(root, s, "", 0) - 1 338 | Else If A_LoopField = 339 | root = 340 | Else If A_LoopField != . 341 | Continue 342 | StringReplace, dir, dir, %A_LoopField%%s% 343 | } 344 | Return, pr . root . s . dir 345 | } 346 | -------------------------------------------------------------------------------- /RocketChatMain.ahk: -------------------------------------------------------------------------------- 1 | #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. 2 | ; #Warn ; Enable warnings to assist with detecting common errors. 3 | #SingleInstance force 4 | SendMode Input ; Recommended for new scripts due to its superior speed and reliability. 5 | 6 | 7 | CurrentVersion := "1.1" 8 | ProgramName = Rocket Chat 9 | SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. 10 | FileCreateDir, %A_AppData%\%ProgramName% 11 | SavedMessagesFolder = %A_AppData%\%ProgramName%\SavedMessages 12 | FileCreateDir, %SavedMessagesFolder% 13 | SavedOverlayFolder = %A_AppData%\%ProgramName%\SavedOverlays 14 | FileCreateDir, %SavedOverlayFolder% 15 | AppFolder = %A_AppData%\%ProgramName% 16 | PortCheckPath = %AppFolder%\ConnectionCheck.txt 17 | PATH_OVERLAY =%AppFolder%\dx9_overlay.dll 18 | FileInstall, dx9_overlay.dll, %Path_Overlay% 19 | FileInstall, DefaultMessages, %SavedMessagesFolder%\DefaultMessages 20 | FileInstall, DefaultOverlay, %SavedOverlayFolder%\DefaultOverlay 21 | FileInstall, Help.chm, %AppFolder%\Help.chm 22 | FileInstall, RLIcon.ico, %AppFolder%\RLIcon.ico 23 | #include overlay.ahk 24 | #include FontSelector.ahk 25 | 26 | ;---Initialize Variables--- 27 | OverlayInitialized = 0 28 | AxisActiveRatio:=0.19 29 | OverlayMenuLastUpdateTime:=0 30 | NumberOfWordBanks = 8 31 | PSign:= "%" 32 | CurrDir = None 33 | CurrMenu = None 34 | Running := 0 35 | MenuOpenTime := 0 36 | ChatMode := 1 37 | ChatModeVisible = 0 38 | LastInGameCheck = 0 39 | InGame := False 40 | Sending = 0 41 | Holding := False 42 | SteamPortList = 27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015,27016,27017,27018,27019,27020,27021,27022,27023,27024,27025,27026,27027,27028,27029,27030,27031,27032,27033,27034,27035,27036,4380,3478,4379,1500,3005,3101 43 | InGameCheckPeriod = 1000 44 | RLProcess = RocketLeague.exe ;Process name used to identify Rocket League 45 | SetParam("process", RLProcess) 46 | 47 | SetFormat, Float, 0.3 48 | 49 | ;------Load Parameters------ 50 | IniPath = %A_AppData%\%ProgramName%\SavedParameters.ini 51 | LoadIni("All",IniPath) 52 | 53 | ;----------Overlay Settings----------- 54 | 55 | FontSizeMed := 10 56 | OverlayTeamYOffsetMed := 5 57 | OverlayYSpacingMed := 30 58 | OverlayBgBotAdjMed := 20 59 | OverlayBgMargin := 5 60 | OverlayTimerH := 3 61 | OverlayTimerYOffset := 1 62 | 63 | OverlayMenuUpdatePeriod:= 10 64 | 65 | OverlayXSpacing := 20 66 | 67 | OverlayTextOpac:= 255 68 | 69 | ;----Default----- 70 | DefaultUpUp = I got it! 71 | DefaultUpLeft = Centering... 72 | DefaultUpRight = Take the shot! 73 | DefaultUpDown = Defending... 74 | 75 | DefaultLeftUp = Nice shot! 76 | DefaultLeftLeft = Great pass! 77 | DefaultLeftRight = Thanks! 78 | DefaultLeftDown = What a save! 79 | 80 | DefaultRightUp = OMG! 81 | DefaultRightLeft = Noooo! 82 | DefaultRightRight = Wow! 83 | DefaultRightDown = Close one! 84 | 85 | DefaultDownUp := "$#@%!" 86 | DefaultDownLeft = No Problem. 87 | DefaultDownRight = Whoops... 88 | DefaultDownDown = Sorry! 89 | 90 | 91 | ;------------GUI--------- 92 | 93 | ;--GUI Variables--- 94 | StandardGuiFont = Arial 95 | StandardGuiFontSize = 9 96 | 97 | BoxLabelHeight :=15 ;Height of groupboxlabel 98 | yTopRow := 5 ;Y placement of top row 99 | 100 | TabXPos := 12 ;X Position of Tab box 101 | TabYPos := 50 ;Y Position of Tab box 102 | TabSelectionAreaThickness := 32 ;Y buffer to keep selection area unobstructed 103 | 104 | MaxMsgLength := 32 ;Maximum Characters in a message. 105 | LabelsOffset := 15 ;y Distance between chat labels and chat inputs 106 | TeamLabelOffset :=12 ;Team Label Offset in X Direction to center over checkboxes 107 | SymbolLength := 32 ;Direction Symbol X Length in Chat Tab 108 | MsgLength := 220 ;Chat Message X Length in Chat Tab 109 | TeamLength := 15 ;Team Checkbox X Length in Chat Tab 110 | xSpacing := 4 ;x spacing between controls in chat section 111 | ySpacing := 4 ;y spacing between controls in chat section 112 | TextHeight := 20 ;Chat Message Box height used for spacing 113 | ySymbolOffset := 3 ;amount to lower symbol in y direction to make centered with chat message box 114 | yTeamOffset := 3 ;amount to lower team checkbox in y direction to make centered with chat message box 115 | ;Symbols used to denote directions 116 | SymbolUp = Up 117 | SymbolLeft = Left 118 | SymbolRight = Right 119 | SymbolDown = Down 120 | SymbolHold = Hold 121 | 122 | SettingLabelXPos := 20 + TabXPos ;x Position of setting labels 123 | SettingLabelWidth := 100 ;width of setting labels 124 | SettingXSpacing := 5 ;Spacing between setting label and setting input 125 | SettingInputXPos := SettingLabelXPos + SettingXSpacing + SettingLabelWidth ;X Position of Setting Inputs 126 | SettingYSpacing := 3 ;y Spacing between each of the settings 127 | 128 | FirstLoadTitle = Welcome to %ProgramName% 129 | 130 | ;---Start Program--- 131 | ;LastVersion = 0 ;Forces FirstLoad ON 132 | 133 | If LastVersion = 0 134 | { 135 | GoSub, OpenFirstLoadGui 136 | WinWaitClose, %FirstLoadTitle% 137 | } 138 | Else If (LastVersion = "1.0") 139 | { 140 | JoystickType := JoystickType + 1 141 | } 142 | 143 | LastVersion := CurrentVersion 144 | GoSub, OpenMainGui 145 | 146 | OnMessage(0x200, "WM_MOUSEMOVE") 147 | OnMessage(0x203,"WM_LButtonDBLCLK") 148 | 149 | Start() 150 | If AutoLaunchRL 151 | GoSub OpenRocketLeague 152 | Return 153 | 154 | 155 | ;---First Stop GUI--- 156 | OpenFirstLoadGui: 157 | Gui, 1:New 158 | Gui, Font, s11, %standarGuiFont% 159 | Gui, Add, Edit, w535 x15 y5 ReadOnly -E0x200 -VScroll Center, This seems to be your first time opening Rocket Chat`nRocket Chat uses macros to give you custom quick chat messages 160 | TempIndent = 10 161 | TempspacingBig=20 162 | Tempspacing=10 163 | TempspacingSmall = 5 164 | TempWidthBig = 360 165 | TempWidth = 350 166 | TempWidthSmall = 340 167 | Gui, Add, Text, +Wrap w%TempWidthBig% x15 y50,Please follow the steps below to complete the initial setup:`n(All of these settings can be changed later) 168 | Gui, Add, Text, +Wrap w%TempWidth% x25 y+%TempSpacingBig%, 1. Select your controller type from the dropdown on the right. 169 | Gui, Add, Text, +Wrap w%TempWidthSmall% xp+%TempIndent% y+%TempSpacingSmall%, a. If your controller is not listed, select “Custom” and press the “Calibrate Custom Controller” button and follow the instructions that pop-up. 170 | Gui, Add, Text, +Wrap w%TempWidth% x25 y+%TempSpacing%, 2. Rocket Chat allows you to toggle between custom quick chat and standard quick chat. In the “Toggle Chat Mode” box, select which button/key will be used to toggle chat modes. (If not set, only "Custom" mode will be used) 171 | Gui, Add, Text, +Wrap w%TempWidth% x25 y+%TempSpacing%, 3. In Rocket League, open Options>Controls and do the following: 172 | Gui, Add, Text, +Wrap w%TempWidthSmall% xp+%TempIndent% y+%TempSpacingSmall%, a. If using a controller, unbind your controller from quick chat, be sure to keep the keyboard bindings active. 173 | Gui, Add, Text, +Wrap w%TempWidthSmall% xp y+%TempSpacingSmall%,b. If you have modified the keyboard bindings, copy the keyboard bindings to their corresponding input box on the right. 174 | Gui, Add, Text, +Wrap w%TempWidthBig% x15 y+%TempSpacingBig%,When finished click the “Continue” button. 175 | Gui, Add, Button, gCloseFirstGui vInitalCloseButton x90 y+%TempSpacingBig% w200 r2 center, Continue 176 | TempXPos = 395 177 | GoSub ResetGuiFont ;Set Font Size 178 | Gui, Add, Text, x%TempXPos% y50 w75 r1 Right, Controller: 179 | Gui, Add, DropDownList, vJoystickTypeFirst x+%SettingXSpacing% yp+0 w75 Choose%JoystickType% AltSubmit, Keyboard|Xbox 360|Custom 180 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w75 r1 Right HwndHwndTemp1, Controller #: 181 | Gui, Add, DropDownList, vSelectedJoystickNumber x+%SettingXSpacing% yp+0 w75 Choose%SelectedJoystickNumber% AltSubmit, Auto Find|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16 182 | Gui, Add, Button, gCustomCalibrate vCustomCalibrateButtonFirst x%TempXPos% y+%SettingYSpacing% w155 r2 center, Calibrate Custom Controller 183 | TempYPos = 175 184 | Gui, Add, Text, x%TempXPos% y%TempYPos% w100 r1 Right HwndHwndTemp1, Controller Button: 185 | Gui, Add, Button, vToggleChatButton gSetToggleChatButton x+%SettingXSpacing% yp+0 w45 r1, %ToggleChatButton% 186 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w100 r1 Right, Keyboard Key: 187 | Gui, Add, Edit, vToggleChatKey Limit1 x+%SettingXSpacing% yp+0 w45 r1 Center HwndHwndTemp2, %ToggleChatKey% 188 | HwndTemp3 := CreateGroupBox("Toggle Chat Mode", 5, HwndTemp1, HwndTemp2, HwndTemp1, HwndTemp2) 189 | TempYPos = 280 190 | TempXPos = 400 191 | Gui, Add, Text, x%TempXPos% y%TempYPos% w120 r1 Right HwndHwndTemp1, All Chat: 192 | Gui, Add, Edit, vAllChatFirst Limit1 x+%SettingXSpacing% yp+0 w15 r1, %AllChat% 193 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right, Team Chat: 194 | Gui, Add, Edit, vTeamChatFirst Limit1 x+%SettingXSpacing% yp+0 w15 r1 HwndHwndTemp5, %TeamChat% 195 | HwndTemp4:=CreateGroupBox("Open Chat", 5, HwndTemp1, HwndTemp5, HwndTemp1, HwndTemp5) 196 | TempXpos := TempXPos 197 | Gui, Add, Text, x%TempXPos% y+20 w120 r1 Right HwndHwndTemp2, Information (Up): 198 | Gui, Add, Edit, vStandardChatUpFirst Limit1 x+%SettingXSpacing% yp+0 w15 r1, %StandardChatUp% 199 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right, Compliments (Left): 200 | Gui, Add, Edit, vStandardChatLeftFirst Limit1 x+%SettingXSpacing% yp+0 w15 r1, %StandardChatLeft% 201 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right,Reactions (Right): 202 | Gui, Add, Edit, vStandardChatRightFirst Limit1 x+%SettingXSpacing% yp+0 w15 r1, %StandardChatRight% 203 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right,Apologies (Down): 204 | Gui, Add, Edit, vStandardChatDownFirst Limit1 x+%SettingXSpacing% yp+0 w15 r1 HwndHwndTemp3, %StandardChatDown% 205 | HwndTemp5:=CreateGroupBox("Quick Chat", 5, HwndTemp2, HwndTemp3, HwndTemp2, HwndTemp3) 206 | CreateGroupBox("RL Keyboard Bindings", 5, HwndTemp4, HwndTemp5, HwndTemp4, HwndTemp5) 207 | GuiControl, Focus, CustomCalibrateButtonFirst 208 | Gui, Show,, %FirstLoadTitle% 209 | Return 210 | 211 | CloseFirstGui: 212 | Gui, Submit 213 | Gui, Destroy 214 | JoystickType := JoystickTypeFirst 215 | AllChat := AllChatFirst 216 | TeamChat := TeamChatFirst 217 | StandardChatUp := StandardChatUpFirst 218 | StandardChatLeft := StandardChatLeftFirst 219 | StandardChatRight := StandardChatRightFirst 220 | StandardChatDown := StandardChatDownFirst 221 | Return 222 | 223 | 224 | OpenMainGui: 225 | Gui, 1:New 226 | GoSub ResetGuiFont ;Set Font Size 227 | 228 | ;Top Row 229 | 230 | TempYPos := yTopRow + 6 231 | Gui, Add, Picture, x20 y%TempYPos% AltSubmit gOpenRLButton vOpenRLButton HwndHwndTemp1,%AppFolder%\RLIcon.ico 232 | OpenRLButton_TT := "Click To Launch Rocket League" 233 | TempYPos := yTopRow - 4 234 | Gui, Add, GroupBox, x17 y%TempYPos% w38 h45, 235 | Gui, Add, Button, w100 x72 y%yTopRow% h44 vStartStopButton gStartStop, Restart Chat`nUpdate Settings 236 | 237 | Gui, Add, Text, w125 x+10 y%yTopRow% Center HwndNoFocus1, Status 238 | Gui, Add, Edit, wp xp+0 y+5 vStatus ReadOnly cred Center, Stopped 239 | 240 | Gui, Add, Text, w80 x+30 y%yTopRow% Center, Chat Mode 241 | Gui, Add, Edit, wp xp+0 y+5 vIndicatorChatMode ReadOnly Center, Custom 242 | 243 | Gui, Add, Text, w80 x+10 y%yTopRow% Center, Current Menu 244 | Gui, Add, Edit, wp vIndicatorMenu xp+0 y+5 Center ReadOnly, None 245 | Gui, Add, Progress, wp h3 cBlue BackgroundGray xp+0 yp-4 +E0x00400000 vIndicatorMenuProg 246 | 247 | Gui, Add, Text, w80 x+10 y%yTopRow% Center, Last Selection 248 | Gui, Add, Edit, wp vIndicatorSelection xp+0 y+5 ReadOnly Center, None 249 | 250 | Gui, Add, Button, x+8 y2 gOpenHelp vHelpButton, ? 251 | TempYPos := TabYPos+5 252 | Gui, Add, Text, w100 x505 y%TempYPos% Right, Version: %CurrentVersion% 253 | 254 | ;Tabs 255 | Gui, Add, Tab2, w605 h495 x%TabXPos% y%TabYPos% gNoFocus, Messages|Word Banks|Setup 256 | 257 | Gui, Tab, Messages 258 | TempYPos := TabYPos+30 259 | Gui, Add, Button, gSaveMessages x550 y%TempYPos% w60 r1, Save 260 | Gui, Add, Button, gLoadMessages xp+0 y+5 w60 r1, Load 261 | TempXPos := TabXPos + 170 262 | TempYPos := TabYPos + 35 263 | CreateSection("Up", TempXPos, TempYPos) 264 | TempXPos := TabXPos + 10 265 | TempYPos := TabYPos + 190 266 | CreateSection("Left", TempXPos, TempYPos) 267 | TempXPos := TabXPos + 305 268 | TempYPos := TabYPos + 190 269 | CreateSection("Right", TempXPos, TempYPos) 270 | TempXPos := TabXPos + 170 271 | TempYPos := TabYPos + 345 272 | CreateSection("Down", TempXPos, TempYPos) 273 | 274 | Gui, Tab, Word Banks 275 | TempXPos := TabXPos + 15 276 | TempYPos:= TabYPos + 35 277 | Gui, Add, Text, x%TempXPos% y%TempYPos% w90 r1 Left, This phrase: 278 | TempXPos := TempXPos + 90 279 | Gui, Add, Text, x%TempXPos% y%TempYPos% w300 r1 Left, Gets replaced by one of these phrases: 280 | TempXPos := TempXPos + 385 281 | Gui, Add, Text, x%TempXPos% y%TempYPos% w100 r1 Right, Phrase Selection: 282 | TempXPos := TabXPos + 15 283 | TempYPos:= TempYPos + 25 284 | Loop %NumberOfWordBanks% 285 | { 286 | CreateWordBank(A_Index, TempXPos, TempYPos) 287 | TempYPos:= TempYPos + 55 288 | } 289 | 290 | Gui, Tab, Setup 291 | ;GamePad Settings 292 | TempYPos := TabYPos + TabSelectionAreaThickness + 30 293 | TempXPos := TabxPos + 25 294 | Gui, Add, Text, x%TempXPos% y%TempYPos% w90 r1 Right HwndHwndTemp1, Controller #: 295 | Gui, Add, DropDownList, vSelectedJoystickNumber x+%SettingXSpacing% yp+0 w100 Choose%SelectedJoystickNumber% AltSubmit, Auto Find|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16 296 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w90 r1 Right, Controller Type: 297 | Gui, Add, DropDownList, vJoystickType x+%SettingXSpacing% yp+0 w100 Choose%JoystickType% AltSubmit, Keyboard|Xbox 360|Custom 298 | Gui, Add, Button, gCustomCalibrate vCustomCalibrateButton x%TempXPos% y+%SettingYSpacing% w195 r1 center, Calibrate Custom Controller 299 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% vCustomJoystickSettingString w195 r3 center, %CustomJoystickType%`nUP:%CustomJoystickUpDownAxis%%CustomJoystickUp% DN:%CustomJoystickUpDownAxis%%CustomJoystickDown%`nLT:%CustomJoystickLeftRightAxis%%CustomJoystickLeft% RT:%CustomJoystickLeftRightAxis%%CustomJoystickRight% 300 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w195 r1 center, Last Controller Connected: 301 | Gui, Add, Edit, x%TempXPos% y+%SettingYSpacing% vLastController w195 r1 readonly center, None 302 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w140 r1 Right, Sampling Period: 303 | Gui, Add, Edit, vJoystickSamplingPeriod x+%SettingXSpacing% yp+0 w20 r1 Number Limit2 HwndHwndTemp2, %JoystickSamplingPeriod% 304 | Gui, Add, Text, x+%SettingXSpacing% yp+0 w25 r1 Left HwndHwndTemp3, ms 305 | CreateGroupBox("Controller Settings", 5, HwndTemp1, HwndTemp2, HwndTemp1, HwndTemp3) 306 | 307 | Gui, Add, Text, x%TabXPos% y+20 w300 r1 Right, Launch Rocket League with Rocket Chat: 308 | Gui, Add, Checkbox, vAutoLaunchRL w15 yp+0 x+%SettingXSpacing% r1 Checked%AutoLaunchRL% 309 | 310 | ;RL KeyBindings 311 | TempYPos := TabYPos + TabSelectionAreaThickness + 50 312 | TempXPos := TabXPos + 255 313 | Gui, Add, Text, x%TempXPos% y%TempYPos% w120 r1 Right HwndHwndTemp1, All Chat: 314 | Gui, Add, Edit, vAllChat Limit1 x+%SettingXSpacing% yp+0 w15 r1, %AllChat% 315 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right, Team Chat: 316 | Gui, Add, Edit, vTeamChat Limit1 x+%SettingXSpacing% yp+0 w15 r1 HwndHwndTemp5, %TeamChat% 317 | HwndTemp4:=CreateGroupBox("Open Chat", 5, HwndTemp1, HwndTemp5, HwndTemp1, HwndTemp5) 318 | TempXpos := TempXPos 319 | Gui, Add, Text, x%TempXPos% y+20 w120 r1 Right HwndHwndTemp2, Information (Up): 320 | Gui, Add, Edit, vStandardChatUp Limit1 x+%SettingXSpacing% yp+0 w15 r1, %StandardChatUp% 321 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right, Compliments (Left): 322 | Gui, Add, Edit, vStandardChatLeft Limit1 x+%SettingXSpacing% yp+0 w15 r1, %StandardChatLeft% 323 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right,Reactions (Right): 324 | Gui, Add, Edit, vStandardChatRight Limit1 x+%SettingXSpacing% yp+0 w15 r1, %StandardChatRight% 325 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right,Apologies (Down): 326 | Gui, Add, Edit, vStandardChatDown Limit1 x+%SettingXSpacing% yp+0 w15 r1 HwndHwndTemp3, %StandardChatDown% 327 | CreateGroupBox("Quick Chat", 5, HwndTemp2, HwndTemp3, HwndTemp2, HwndTemp3) 328 | CreateGroupBox("RL Keyboard Bindings", 5, HwndTemp4, HwndGroupBox, HwndTemp4, HwndGroupBox) 329 | 330 | ;Chat Settings 331 | TempYPos := TabYPos + TabSelectionAreaThickness + 50 332 | TempXPos := TabXPos + 435 333 | Gui, Add, Text, x%TempXPos% y%TempYPos% w105 r1 Right HwndHwndTemp1, Controller Button: 334 | Gui, Add, Button, vToggleChatButton gSetToggleChatButton x+%SettingXSpacing% yp+0 w30 r1, %ToggleChatButton% 335 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w105 r1 Right, Keyboard Key: 336 | Gui, Add, Edit, vToggleChatKey Limit1 x+%SettingXSpacing% yp+0 w30 r1 Center, %ToggleChatKey% 337 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w120 r1 Right, Mute Notification: 338 | Gui, Add, Checkbox, vMuteChatToggle w15 yp+0 x+%SettingXSpacing% r1 Checked%MuteChatToggle% HwndHwndTemp2 339 | HwndTemp3 := CreateGroupBox("Toggle Chat Mode", 5, HwndTemp1, HwndTemp2, HwndTemp1, HwndTemp2) 340 | Gui, Add, Text, x%TempXPos% y+20 w95 r1 Right HwndHwndTemp1, Menu Timeout: 341 | Gui, Add, Edit, vMenuTimeout x+%SettingXSpacing% yp+0 w40 r1 Number Limit4, %MenuTimeout% 342 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w100 r1 Right, Chat Open Delay: 343 | Gui, Add, Edit, vChatOpenDelay yp+0 x+%SettingXSpacing% w35 r1 Number Limit3 HwndHwndTemp2, %ChatOpenDelay% 344 | HwndTemp4 := CreateGroupBox("Timing", 5, HwndTemp1, HwndTemp2, HwndTemp1, HwndTemp2) 345 | Gui, Add, Text, x%TempXPos% y+20 w95 r1 Right HwndHwndTemp1, Hold Time: 346 | Gui, Add, Edit, vHoldTime yp+0 x+%SettingXSpacing% w40 r1 Number Limit4 HwndHwndTemp2, %HoldTime% 347 | HwndTemp5:=CreateGroupBox("", 5, HwndTemp1, HwndTemp2, HwndTemp1, HwndTemp2) 348 | Gui, Add, Checkbox, vHoldEnable yp+0 xp+5 r1 Checked%HoldEnable%, Hold Messages 349 | CreateGroupBox("Chat Settings", 5, HwndTemp3, HwndTemp5, HwndTemp3, HwndTemp4) 350 | 351 | ;Overlay Settings 352 | TempYPos := TabYPos + 355 353 | TempXPos:= TabXPos + 40 354 | ;Position 355 | Gui, Add, Text, x%TempXPos% y%TempYPos% w25 r1 Right HwndHwndTemp3, X: 356 | Gui, Add, Edit, vOverlayX Limit4 number x+%SettingXSpacing% yp+0 w35 r1, %OverlayX% 357 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w25 r1 Right, Y: 358 | Gui, Add, Edit, vOverlayY Limit4 number x+%SettingXSpacing% yp+0 w35 r1, %OverlayY% 359 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w25 r1 Right, Size: 360 | Gui, Add, Edit, vFontSize x+%SettingXSpacing% yp+0 w35 Number Limit2 HwndHwndTemp4, %FontSize% 361 | HwndTemp1:=CreateGroupBox("Position", 5, HwndTemp3, HwndTemp4, HwndTemp3, HwndTemp4) 362 | 363 | Gui, Add, Button, gSaveOverlay xp+0 y+5 w35 r1, Save 364 | Gui, Add, Button, gLoadOverlay x+5 yp+0 w35 r1, Load 365 | 366 | TempXPos:= TempXPos + 80 367 | Gui, Add, Text, x%TempXPos% y%TempYPos% w35 r1 Right HwndHwndTemp3, Color: 368 | Gui, Add, Edit, vBgColor Limit6 x+%SettingXSpacing% yp+0 w60 r1, %BgColor% 369 | BgColor_DblClk = ColorSelect 370 | BgColor_TT = Double click to open color picker 371 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w60 r1 Right, Opacity %PSign%: 372 | Gui, Add, Edit, vBgOpac w35 yp+0 x+%SettingXSpacing% r1 Number limit3, %BgOpac% 373 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w60 r1 Right, Width: 374 | Gui, Add, Edit, vBgWidth w35 yp+0 x+%SettingXSpacing% r1 Number limit3, %BgWidth% 375 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w80 r1 Right, Menu Timer: 376 | Gui, Add, Checkbox, vMenuTimerON w15 yp+0 x+%SettingXSpacing% r1 Checked%MenuTimerON% HwndHwndTemp4 377 | CreateGroupBox("Background", 5, HwndTemp3, HwndTemp4, HwndTemp3, HwndTemp4) 378 | 379 | TempXPos := TempXPos + 115 380 | 381 | Gui, Add, Text, x%TempXPos% y%TempYPos% w35 r1 Right HwndHwndTemp3,Color: 382 | Gui, Add, Edit, vMsgColor Limit6 x+%SettingXSpacing% yp+0 w60 r1, %MsgColor% 383 | MsgColor_DblClk = ColorSelect 384 | MsgColor_TT = Double click to open color picker 385 | Gui, Add, Button, x%TempXPos% y+%SettingYSpacing% w100 r1 vMsgFontPick gSelectMsgFont Center, Font Picker 386 | Gui, Add, Edit, x%TempXPos% y+%SettingYSpacing% w100 r1 ReadOnly Center vMsgFontDisplay, %MsgFont% 387 | UpdateFontDisplay("Msg") 388 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w75 r1 Right, Char Limit: 389 | Gui, Add, Edit, vOverlayCharLim Limit4 number x+%SettingXSpacing% yp+0 w20 r1 HwndHwndTemp4, %OverlayCharLim% 390 | HwndTemp6:=CreateGroupBox("Messages", 5, HwndTemp3, HwndTemp4, HwndTemp3, HwndTemp4) 391 | 392 | TempXPos := TempXPos + 115 393 | 394 | Gui, Add, Text, x%TempXPos% y%TempYPos% w35 r1 Right HwndHwndTemp3,Color: 395 | Gui, Add, Edit, vTeamColor Limit6 x+%SettingXSpacing% yp+0 w60 r1, %TeamColor% 396 | TeamColor_DblClk = ColorSelect 397 | TeamColor_TT = Double click to open color picker 398 | Gui, Add, Button, x%TempXPos% y+%SettingYSpacing% w100 r1 vTeamFontPick gSelectTeamFont Center, Font Picker 399 | Gui, Add, Edit, x%TempXPos% y+%SettingYSpacing% w100 r1 ReadOnly Center vTeamFontDisplay, %TeamFont% 400 | UpdateFontDisplay("Team") 401 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w75 r1 Right, Vert Offset: 402 | Gui, Add, Edit, vTeamFlatOffset Limit1 number x+%SettingXSpacing% yp+0 w20 r1 HwndHwndTemp4, %TeamFlatOffset% 403 | CreateGroupBox("Team Indicator", 5, HwndTemp3, HwndTemp4, HwndTemp3, HwndTemp4) 404 | 405 | 406 | TempXPos := TempXPos + 115 407 | 408 | Gui, Add, Text, x%TempXPos% y%TempYPos% w35 r1 Right HwndHwndTemp3,Color: 409 | Gui, Add, Edit, vLblColor Limit6 x+%SettingXSpacing% yp+0 w60 r1, %LblColor% 410 | LblColor_DblClk = ColorSelect 411 | LblColor_TT = Double click to open color picker 412 | Gui, Add, Button, x%TempXPos% y+%SettingYSpacing% w100 r1 vLblFontPick gSelectLblFont Center, Font Picker 413 | Gui, Add, Edit, x%TempXPos% y+%SettingYSpacing% w100 r1 ReadOnly Center vLblFontDisplay, %LblFont% 414 | UpdateFontDisplay("Lbl") 415 | Gui, Add, Text, x%TempXPos% y+%SettingYSpacing% w56 vArrowsText r1 Right, Arrows?: 416 | gui, font, s11, Wingdings 3 417 | Gui, Add, DropDownList, vLblArrow x+%SettingXSpacing% yp+0 w39 Choose%LblArrow% AltSubmit HwndHwndTemp4, %A_Space%|#|h|5|<|J|p|r 418 | hexhwnd:=hex(HwndTemp4) 419 | hexhwnd=0x%hexhwnd% 420 | If GetFontname(hexhwnd) != "Wingdings 3" 421 | { 422 | LblArrow = 1 423 | GuiControl, Text, %HwndTemp4%,| 424 | GuiControl, Disable , %HwndTemp4% 425 | } 426 | GoSub ResetGuiFont 427 | LblArrow_TT:="Requires the Wingdings 3 font`nLeave blank to use letters" 428 | ArrowsText_TT:="Requires the Wingdings 3 font`nLeave blank to use letters" 429 | HwndTemp2:=CreateGroupBox("", 5, HwndTemp3, HwndTemp4, HwndTemp3, HwndTemp4) 430 | Gui, Add, Checkbox, vLabelsON yp+0 xp+5 r1 Checked%LabelsON%, Labels 431 | 432 | CreateGroupBox("", 5, HwndTemp1, HwndTemp2, HwndTemp1, HwndTemp2) 433 | Gui, Add, Checkbox, vOverlayON yp+0 xp+5 r1 Checked%OverlayON%, Overlay On 434 | ;Gui, Color,1D4D71,123249 435 | Gui, Show, w628, %ProgramName% 436 | 437 | Return 438 | 439 | GetFontname( HwndInput ) { 440 | hFont := DllCall( "SendMessage", UInt, HwndInput, UInt,0x31, UInt,0, UInt,0, UInt )s 441 | VarSetCapacity( LF, szLF := 60*( A_IsUnicode ? 2:1 ) ) 442 | DllCall( "GetObject", UInt,hFont, Int,szLF, UInt,&LF ) 443 | hDC := DllCall( "GetDC", UInt,hwnd ), 444 | DllCall( "ReleaseDC", Int,0, UInt,hDC ), 445 | Return DllCall( "MulDiv",Int,&LF+28, Int,1,Int,1, Str ) 446 | } 447 | 448 | 449 | SelectMsgFont: 450 | FontSelector(MsgFont, MsgModifier) 451 | UpdateFontDisplay("Msg") 452 | Return 453 | 454 | SelectTeamFont: 455 | FontSelector(TeamFont, TeamModifier) 456 | UpdateFontDisplay("Team") 457 | Return 458 | 459 | SelectLblFont: 460 | FontSelector(LblFont, LblModifier) 461 | UpdateFontDisplay("Lbl") 462 | Return 463 | 464 | UpdateFontDisplay(name){ 465 | global 466 | If %name%Modifier = 2 467 | TempStyle = bold 468 | Else If %name%Modifier = 3 469 | TempStyle = italic 470 | Else 471 | TempStyle = norm 472 | TempFont := %name%Font 473 | TempDisplayName = %name%FontDisplay 474 | Gui, 1:Font, s%StandardGuiFontSize% norm %TempStyle%, %TempFont% 475 | GuiControl, 1:text, %TempDisplayName%, %TempFont% 476 | GuiControl, 1:Font, %TempDisplayName%, 477 | GoSub ResetGuiFont 478 | Return 479 | } 480 | OpenHelp: 481 | Run %AppFolder%\Help.chm 482 | Return 483 | 484 | StartStop: 485 | If (Running = 1) 486 | { 487 | Stop() 488 | Sleep, 200 489 | } 490 | Start() 491 | Return 492 | 493 | InputCheck: 494 | GoSub InGameCheck 495 | If OverlayInitialized = 1 496 | { 497 | If OverlayChatModeVisible = 1 498 | { 499 | 500 | Temp1 := A_TickCount - ChatModeChangeTime 501 | If Temp1 > 1000 502 | { 503 | TextSetShown(OverlayChatModeID, False) 504 | OverlayChatModeVisible = 0 505 | } 506 | 507 | } 508 | } 509 | If CurrMenu <> None 510 | { 511 | MenuTimeCheck() 512 | } 513 | If (QuickChatType <> "Keyboard") 514 | { 515 | PrevDir := CurrDir 516 | GetDir() 517 | 518 | If Holding and (HoldEnable = 1) and (CurrMenu = CurrDir) and (ChatMode <> 0) 519 | { 520 | If (MenuTimeElapsed >= HoldTime) 521 | { 522 | CurrDir = Hold 523 | If InGame and (CurrentProcess = RLProcess) 524 | SendChat() 525 | ResetMenu() 526 | } 527 | } 528 | Else 529 | { 530 | Holding := False 531 | } 532 | 533 | If PrevDir = None 534 | { 535 | If CurrDir <> None 536 | { 537 | If ChatMode = 0 538 | { 539 | If InGame and (CurrentProcess = RLProcess) 540 | StandardChat() 541 | } 542 | Else 543 | { 544 | If CurrMenu = None 545 | { 546 | SetMenu() 547 | } 548 | Else 549 | { 550 | If InGame and (CurrentProcess = RLProcess) 551 | SendChat() 552 | ResetMenu() 553 | } 554 | } 555 | } 556 | } 557 | } 558 | Return 559 | 560 | 561 | ToggleChatMode: 562 | ;If InGame 563 | SetChatMode(-1) 564 | Return 565 | 566 | SaveMessages: 567 | Gui, Submit, NoHide 568 | SaveSettings("Messages") 569 | Return 570 | 571 | SaveOverlay: 572 | Gui, Submit, NoHide 573 | SaveSettings("Overlay") 574 | Return 575 | 576 | LoadMessages: 577 | LoadSettings("Messages") 578 | Return 579 | 580 | LoadOverlay: 581 | LoadSettings("Overlay") 582 | Return 583 | 584 | SetToggleChatButton: 585 | ConnectJoystick() 586 | If JoyName 587 | { 588 | Gui, 1: +Disabled 589 | Gui, InputButton:New 590 | Gui, InputButton:Font, cblack s%StandardGuiFontSize% norm, %StandardGuiFont% 591 | Gui, InputButton:-SysMenu 592 | Gui, InputButton:Add, Text, x15 y5 w130 center, Press controller button 593 | Gui, InputButton:Show,, Waiting 594 | ToggleChatButton:=GetJoyButton(2000,1) 595 | Gui, 1:Show 596 | Gui, InputButton:Destroy 597 | Gui, 1: -Disabled 598 | guiControl, 1:Text, ToggleChatButton, %ToggleChatButton% 599 | } 600 | Return 601 | 602 | ColorSelect: 603 | GuiControlGet,StartColor,,%DblClkhwnd% 604 | PickedColor = 0x%StartColor% 605 | CmnDlg_Color( PickedColor) 606 | If (PickedColor = StartColor) 607 | Return 608 | StringTrimleft, PickedColor, PickedColor, 2 609 | StringUpper, PickedColor, PickedColor 610 | GuiControl,, %DblClkhwnd%, %PickedColor% 611 | Return 612 | 613 | CustomCalibrate: 614 | ConnectJoystick() 615 | If JoyName 616 | CalibrateJoystick() 617 | Return 618 | 619 | 620 | NoFocus: 621 | GuiControl, Focus, OverlayON 622 | Return 623 | 624 | 625 | ResetGuiFont: 626 | Gui, 1:Font, cblack s%StandardGuiFontSize% norm, %StandardGuiFont% 627 | Return 628 | 629 | ;For keyboard 630 | 631 | EnableQuickChatHotkeys: 632 | Hotkey, *$%StandardChatUp%, KeyboardChatUpSub, On 633 | Hotkey, *$%StandardChatLeft%, KeyboardChatLeftSub, On 634 | Hotkey, *$%StandardChatRight%, KeyboardChatRightSub, On 635 | Hotkey, *$%StandardChatDown%, KeyboardChatDownSub, On 636 | Return 637 | 638 | DisableQuickChatHotkeys: 639 | Hotkey, *$%StandardChatUp%, KeyboardChatUpSub, Off 640 | Hotkey, *$%StandardChatLeft%, KeyboardChatLeftSub, Off 641 | Hotkey, *$%StandardChatRight%, KeyboardChatRightSub, Off 642 | Hotkey, *$%StandardChatDown%, KeyboardChatDownSub, Off 643 | Return 644 | 645 | EnableTypedChatHotkeys: 646 | Hotkey, *~$%AllChat%, TemporarilyDisableQuickChatHotkeys, On 647 | Hotkey, *~$%TeamChat%, TemporarilyDisableQuickChatHotkeys, On 648 | Hotkey, *~$Enter, ReEnableQuickChatHotkeys, On 649 | Hotkey, *~$Escape, ReEnableQuickChatHotkeys, On 650 | Return 651 | 652 | DisableTypedChatHotkeys: 653 | Hotkey, *~$%AllChat%, TemporarilyDisableQuickChatHotkeys, Off 654 | Hotkey, *~$%TeamChat%, TemporarilyDisableQuickChatHotkeys, Off 655 | Hotkey, *~$Enter, ReEnableQuickChatHotkeys, Off 656 | Hotkey, *~$Escape, ReEnableQuickChatHotkeys, Off 657 | Return 658 | 659 | TemporarilyDisableQuickChatHotkeys: 660 | GoSub DisableQuickChatHotkeys 661 | If ToggleChatKey <> 662 | Hotkey, *$%ToggleChatKey%, ToggleChatMode, Off 663 | SetTimer, ReEnableQuickChatHotkeys, 30000 664 | Return 665 | 666 | ReEnableQuickChatHotkeys: 667 | If (Running = 1) and (QuickChatType = "Keyboard") and (InGame = True) 668 | { 669 | If ToggleChatKey <> 670 | Hotkey, *$%ToggleChatKey%, ToggleChatMode, On 671 | If (ChatMode <> 0) 672 | GoSub EnableQuickChatHotkeys 673 | } 674 | SetTimer, ReEnableQuickChatHotkeys, Off 675 | Return 676 | 677 | KeyboardChatUpSub: 678 | If (Sending <> 1) 679 | { 680 | HoldTimeInSec := HoldTime/1000 681 | CurrDir = Up 682 | If CurrMenu = None 683 | { 684 | SetMenu() 685 | KeyWait, %StandardChatUp%, T%HoldTimeInSec% 686 | If (ErrorLevel = 1) And (CurrMenu = "Up") 687 | { 688 | CurrDir = Hold 689 | SendChat() 690 | ResetMenu() 691 | } 692 | } 693 | Else 694 | { 695 | SendChat() 696 | ResetMenu() 697 | } 698 | } 699 | KeyWait, %StandardChatUp% 700 | Return 701 | 702 | KeyboardChatLeftSub: 703 | If (Sending <> 1) 704 | { 705 | HoldTimeInSec := HoldTime/1000 706 | CurrDir = Left 707 | If CurrMenu = None 708 | { 709 | SetMenu() 710 | KeyWait, %StandardChatLeft%, T%HoldTimeInSec% 711 | If (ErrorLevel = 1) And (CurrMenu = "Left") 712 | { 713 | CurrDir = Hold 714 | SendChat() 715 | ResetMenu() 716 | } 717 | } 718 | Else 719 | { 720 | SendChat() 721 | ResetMenu() 722 | } 723 | } 724 | KeyWait, %StandardChatLeft% 725 | Return 726 | 727 | KeyboardChatRightSub: 728 | If (Sending <> 1) 729 | { 730 | HoldTimeInSec := HoldTime/1000 731 | CurrDir = Right 732 | If CurrMenu = None 733 | { 734 | SetMenu() 735 | KeyWait, %StandardChatRight%, T%HoldTimeInSec% 736 | If (ErrorLevel = 1) And (CurrMenu = "Right") 737 | { 738 | CurrDir = Hold 739 | SendChat() 740 | ResetMenu() 741 | } 742 | } 743 | Else 744 | { 745 | SendChat() 746 | ResetMenu() 747 | } 748 | } 749 | KeyWait, %StandardChatRight% 750 | Return 751 | 752 | KeyboardChatDownSub: 753 | If (Sending <> 1) 754 | { 755 | HoldTimeInSec := HoldTime/1000 756 | CurrDir = Down 757 | If CurrMenu = None 758 | { 759 | SetMenu() 760 | KeyWait, %StandardChatDown%, T%HoldTimeInSec% 761 | If (ErrorLevel = 1) And (CurrMenu = "Down") 762 | { 763 | CurrDir = Hold 764 | SendChat() 765 | ResetMenu() 766 | } 767 | } 768 | Else 769 | { 770 | SendChat() 771 | ResetMenu() 772 | } 773 | } 774 | KeyWait, %StandardChatDown% 775 | Return 776 | 777 | ;--------------------------FUNCTIONS------------------------- 778 | 779 | Start() 780 | { 781 | global 782 | Gui, Submit, NoHide 783 | OverlayInitialized = 0 784 | LimitCheck() 785 | If OutOfLims= 786 | { 787 | WordBankInit() 788 | JoystickCalc() 789 | If (QuickChatType <> "Keyboard") 790 | ConnectJoystick() 791 | If ((JoyName) Or (QuickChatType = "Keyboard")) 792 | { 793 | Running = 1 794 | InGame := False 795 | SaveIni("All",IniPath) 796 | 797 | If (QuickChatType <> "Keyboard") 798 | { 799 | guiControl, text, Status, Running - Controller 800 | guiControl, text, GuiSymbolUpUp, Up 801 | guiControl, text, GuiSymbolLeftUp, Up 802 | guiControl, text, GuiSymbolRightUp, Up 803 | guiControl, text, GuiSymbolDownUp, Up 804 | 805 | guiControl, text, GuiSymbolUpLeft, Left 806 | guiControl, text, GuiSymbolLeftLeft, Left 807 | guiControl, text, GuiSymbolRightLeft, Left 808 | guiControl, text, GuiSymbolDownLeft, Left 809 | 810 | guiControl, text, GuiSymbolUpRight, Right 811 | guiControl, text, GuiSymbolLeftRight, Right 812 | guiControl, text, GuiSymbolRightRight, Right 813 | guiControl, text, GuiSymbolDownRight, Right 814 | 815 | guiControl, text, GuiSymbolUpDown, Down 816 | guiControl, text, GuiSymbolLeftDown, Down 817 | guiControl, text, GuiSymbolRightDown, Down 818 | guiControl, text, GuiSymbolDownDown, Down 819 | If ToggleChatButton <> 820 | Hotkey, %JoystickNumber%joy%ToggleChatButton%, ToggleChatMode, On 821 | } 822 | Else 823 | { 824 | guiControl, text, Status, Running - Keyboard 825 | guiControl, text, GuiSymbolUpUp, %StandardChatUp% 826 | guiControl, text, GuiSymbolLeftUp, %StandardChatUp% 827 | guiControl, text, GuiSymbolRightUp, %StandardChatUp% 828 | guiControl, text, GuiSymbolDownUp, %StandardChatUp% 829 | 830 | guiControl, text, GuiSymbolUpLeft, %StandardChatLeft% 831 | guiControl, text, GuiSymbolLeftLeft, %StandardChatLeft% 832 | guiControl, text, GuiSymbolRightLeft, %StandardChatLeft% 833 | guiControl, text, GuiSymbolDownLeft, %StandardChatLeft% 834 | 835 | guiControl, text, GuiSymbolUpRight, %StandardChatRight% 836 | guiControl, text, GuiSymbolLeftRight, %StandardChatRight% 837 | guiControl, text, GuiSymbolRightRight, %StandardChatRight% 838 | guiControl, text, GuiSymbolDownRight, %StandardChatRight% 839 | 840 | guiControl, text, GuiSymbolUpDown, %StandardChatDown% 841 | guiControl, text, GuiSymbolLeftDown, %StandardChatDown% 842 | guiControl, text, GuiSymbolRightDown, %StandardChatDown% 843 | guiControl, text, GuiSymbolDownDown, %StandardChatDown% 844 | } 845 | Gui, Font, cGreen, bold 846 | guiControl, Font, Status 847 | GoSub ResetGuiFont 848 | SetTimer, InputCheck, %JoystickSamplingPeriod% 849 | SetChatMode(1) 850 | } 851 | } 852 | } 853 | 854 | Stop() 855 | { 856 | global 857 | GuiControl, text, Status, Stopped 858 | Gui, Font, cred 859 | guiControl, Font, Status 860 | Running = 0 861 | SetTimer, InputCheck, Off 862 | If (ToggleChatButton <> "") and (QuickChatType <> "Keyboard") 863 | Hotkey, %JoystickNumber%joy%ToggleChatButton%, ToggleChatMode, Off 864 | 865 | ;keyboard mode stuff 866 | GoSub DisableTypedChatHotkeys 867 | GoSub DisableQuickChatHotkeys 868 | If ToggleChatKey <> 869 | Hotkey, *$%ToggleChatKey%, ToggleChatMode, Off 870 | SetTimer, ReEnableQuickChatHotkeys, Off 871 | 872 | If OverlayInitialized = 1 873 | { 874 | DestroyAllVisual() ;Can use DestoryOverlay which I made and should delete everything, but this is simpler. I only used DestroyOverlay because I thought DestroyAllVisual was causing problems, but now I think its fine. 875 | } 876 | OverlayChatModeVisible = 0 877 | } 878 | 879 | WordBankInit() 880 | { 881 | global 882 | Loop, %NumberOfWordBanks% 883 | { 884 | BankOptionsArray%A_Index% := StrSplit(BankOptions%A_Index%,","," ") 885 | MaxNum := BankOptionsArray%A_Index%.Length() 886 | Random, BankOptionSelect%A_Index%, 1, %MaxNum% 887 | If (WordBankSelectType%A_Index% = 3) 888 | { 889 | BankOptionSelect%A_Index% = 1 890 | } 891 | } 892 | } 893 | 894 | BankReplace(MessageToSearch) 895 | { 896 | global 897 | TempMessage := MessageToSearch 898 | 899 | Loop, %NumberOfWordBanks% 900 | { 901 | If (BankNeedle%A_Index% <> "") and (BankOptions%A_Index% <> "") 902 | { 903 | num = %A_Index% 904 | TempNeedle := BankNeedle%num% 905 | StringReplace, TempMessage, TempMessage, %TempNeedle%, %TempNeedle%, UseErrorLevel 906 | NeedleCount := ErrorLevel 907 | Loop, %NeedleCount% 908 | { 909 | SelectIndex := BankOptionSelect%num% 910 | TempInsert := BankOptionsArray%num%[SelectIndex] 911 | StringReplace, TempMessage, TempMessage, %TempNeedle%, %TempInsert% 912 | MaxNum := BankOptionsArray%num%.Length() 913 | If (WordBankSelectType%num% > 1) and (MaxNum > 1) 914 | { 915 | TempOption := BankOptionsArray%num%[SelectIndex] 916 | BankOptionsArray%num%.RemoveAt(SelectIndex) 917 | BankOptionsArray%num%.Push(TempOption) 918 | MaxNum := MaxNum - 1 919 | If (WordBankSelectType%num% = 3) 920 | { 921 | MaxNum = 1 922 | } 923 | } 924 | Random, BankOptionSelect%num%, 1, %MaxNum% 925 | } 926 | } 927 | } 928 | Return TempMessage 929 | } 930 | 931 | 932 | ConnectJoystick() 933 | { 934 | global 935 | JoystickNumber := SelectedJoystickNumber - 1 936 | ; Auto-detect the joystick number if called for: 937 | if JoystickNumber <= 0 938 | { 939 | Loop 16 ; Query each joystick number to find out which ones exist. 940 | { 941 | GetKeyState, JoystickPresenceCheck, %A_Index%Joy1 942 | if JoystickPresenceCheck <> 943 | { 944 | JoystickNumber=%A_Index% 945 | break 946 | } 947 | } 948 | } 949 | GetKeyState, JoyName, %JoystickNumber%JoyName 950 | If JoyName <> 951 | { 952 | SetFormat, float, 03 ; Omit decimal point from axis position percentages. 953 | GetKeyState, joy_buttons, %JoystickNumber%JoyButtons 954 | GetKeyState, joy_name, %JoystickNumber%JoyName 955 | GetKeyState, joy_info, %JoystickNumber%JoyInfo 956 | GuiControl,, LastController, %joy_name% (#%JoystickNumber%) 957 | } 958 | Else 959 | { 960 | If JoystickNumber = 0 961 | MsgBox,8192, Sorry!,Could not find any controllers 962 | Else 963 | MsgBox,8192, Sorry!,Could not find gamepad %JoystickNumber%`nChange Controller # to Auto Find in settings 964 | } 965 | 966 | } 967 | 968 | CreateGroupBox(Title, Margin, TopElement, BotElement, LeftElement, RightElement) ;Title must be in quotes 969 | { 970 | global 971 | 972 | Local BoxX 973 | Local BoxY 974 | Local Boxh 975 | Local BoxW 976 | 977 | GuiControlGet, TopPos, Pos, %TopElement% 978 | GuiControlGet, BotPos, Pos, %BotElement% 979 | GuiControlGet, LeftPos, Pos, %LeftElement% 980 | GuiControlGet, RightPos, Pos, %RightElement% 981 | 982 | BoxX := LeftPosX - Margin 983 | BoxY := TopPosY - Margin - BoxLabelHeight 984 | BoxH := BotPosY - TopPosY + BotPosH + BoxLabelHeight + Margin + Margin 985 | BoxW := RightPosX - LeftPosX + RightPosW + Margin + Margin 986 | 987 | Gui, Add, GroupBox, x%BoxX% y%BoxY% h%BoxH% w%BoxW% HwndHwndGroupBox, %Title% 988 | 989 | Return HwndGroupBox 990 | } 991 | 992 | GetDir() 993 | { 994 | global 995 | If QuickChatType = Button 996 | { 997 | CurrDir = None 998 | GetKeyState, Temp1, %JoystickNumber%joy%QuickChatUp% 999 | if Temp1 = D 1000 | CurrDir = Up 1001 | GetKeyState, Temp1, %JoystickNumber%joy%QuickChatLeft% 1002 | if Temp1 = D 1003 | CurrDir = Left 1004 | GetKeyState, Temp1, %JoystickNumber%joy%QuickChatRight% 1005 | if Temp1 = D 1006 | CurrDir = Right 1007 | GetKeyState, Temp1, %JoystickNumber%joy%QuickChatDown% 1008 | if Temp1 = D 1009 | CurrDir = Down 1010 | } 1011 | Else If QuickChatType = Axis 1012 | { 1013 | CurrDir=None 1014 | GetKeyState, JoystickValue, %JoystickNumber%Joy%QuickChatUpDownAxis% 1015 | If (JoystickValue > QuickChatUpDownHighActiveThresh) 1016 | { 1017 | CurrDir := QuickChatUpDownHighDir 1018 | } 1019 | Else If (JoystickValue < QuickChatUpDownLowActiveThresh) 1020 | { 1021 | CurrDir := QuickChatUpDownLowDir 1022 | } 1023 | GetKeyState, JoystickValue, %JoystickNumber%Joy%QuickChatLeftRightAxis% 1024 | If (JoystickValue > QuickChatLeftRightHighActiveThresh) 1025 | { 1026 | CurrDir := QuickChatLeftRightHighDir 1027 | } 1028 | Else If (JoystickValue < QuickChatLeftRightLowActiveThresh) 1029 | { 1030 | CurrDir := QuickChatLeftRightLowDir 1031 | } 1032 | } 1033 | Else If QuickChatType = POV 1034 | { 1035 | GetKeyState, POV, %JoystickNumber%JoyPOV 1036 | if POV < 0 ; No angle to report 1037 | CurrDir = None 1038 | else if POV > %QuickChatPOV7Eighth% ; 315 to 360 degrees: Forward 1039 | CurrDir := QuickChatPOVDirFirst 1040 | else if POV between 0 and %QuickChatPOV1Eighth% ; 0 to 45 degrees: Forward 1041 | CurrDir := QuickChatPOVDirFirst 1042 | else if POV between %QuickChatPOV1Eighth% and %QuickChatPOV3Eighth% ; 45 to 135 degrees: Right 1043 | CurrDir := QuickChatPOVDirSecond 1044 | else if POV between %QuickChatPOV3Eighth% and %QuickChatPOV5Eighth% ; 135 to 225 degrees: Down 1045 | CurrDir := QuickChatPOVDirThird 1046 | else ; 225 to 315 degrees: Left 1047 | CurrDir := QuickChatPOVDirFourth 1048 | } 1049 | 1050 | } 1051 | 1052 | GetNeutral() 1053 | { 1054 | global 1055 | local joyx, joyy, joyz, joyr, joyu, joyv, joyp 1056 | GetKeyState, joyx, %JoystickNumber%JoyX 1057 | NeutralX := joyx 1058 | GetKeyState, joyy, %JoystickNumber%JoyY 1059 | NeutralY := joyy 1060 | IfInString, joy_info, Z 1061 | { 1062 | GetKeyState, joyz, %JoystickNumber%JoyZ 1063 | NeutralZ := joyz 1064 | } 1065 | IfInString, joy_info, R 1066 | { 1067 | GetKeyState, joyr, %JoystickNumber%JoyR 1068 | NeutralR := joyr 1069 | } 1070 | IfInString, joy_info, U 1071 | { 1072 | GetKeyState, joyu, %JoystickNumber%JoyU 1073 | NeutralU := joyu 1074 | } 1075 | IfInString, joy_info, V 1076 | { 1077 | GetKeyState, joyv, %JoystickNumber%JoyV 1078 | NeutralV := joyv 1079 | } 1080 | IfInString, joy_info, P 1081 | { 1082 | GetKeyState, joyp, %JoystickNumber%JoyPOV 1083 | NeutralP := joyp 1084 | } 1085 | } 1086 | 1087 | CalibrateDir(ByRef CalibrateType, ByRef AxisNumber = 0) 1088 | { 1089 | global 1090 | local joyx, joyy, joyz, joyr, joyu, joyv, joyp, Value, TempType 1091 | 1092 | TempType = Error ; If no type is set, this variable will remain "Error" 1093 | 1094 | If (CalibrateType = "Detect") Or (CalibrateType = "Axis") 1095 | { 1096 | GetKeyState, joyx, %JoystickNumber%JoyX 1097 | OldDiff := abs(joyx - NeutralX) 1098 | AxisNumber = X 1099 | Value := joyx 1100 | GetKeyState, joyy, %JoystickNumber%JoyY 1101 | NewDiff := abs(joyy - NeutralY) 1102 | If (NewDiff > OldDiff) 1103 | { 1104 | OldDiff := NewDiff 1105 | AxisNumber = Y 1106 | Value := joyy 1107 | } 1108 | IfInString, joy_info, Z 1109 | { 1110 | GetKeyState, joyz, %JoystickNumber%JoyZ 1111 | NewDiff := abs(joyz - NeutralZ) 1112 | If (NewDiff > OldDiff) 1113 | { 1114 | OldDiff := NewDiff 1115 | AxisNumber = Z 1116 | Value := joyz 1117 | } 1118 | } 1119 | IfInString, joy_info, R 1120 | { 1121 | GetKeyState, joyr, %JoystickNumber%JoyR 1122 | NewDiff := abs(joyr - NeutralR) 1123 | If (NewDiff > OldDiff) 1124 | { 1125 | OldDiff := NewDiff 1126 | AxisNumber = R 1127 | Value := joyr 1128 | } 1129 | } 1130 | IfInString, joy_info, U 1131 | { 1132 | GetKeyState, joyu, %JoystickNumber%JoyU 1133 | NewDiff := abs(joyu - NeutralU) 1134 | If (NewDiff > OldDiff) 1135 | { 1136 | OldDiff := NewDiff 1137 | AxisNumber = U 1138 | Value := joyu 1139 | } 1140 | } 1141 | IfInString, joy_info, V 1142 | { 1143 | GetKeyState, joyv, %JoystickNumber%JoyV 1144 | NewDiff := abs(joyv - NeutralV) 1145 | If (NewDiff > OldDiff) 1146 | { 1147 | OldDiff := NewDiff 1148 | AxisNumber = V 1149 | Value := joyv 1150 | } 1151 | } 1152 | If OldDiff > 5 1153 | TempType = Axis 1154 | } 1155 | If (CalibrateType = "Detect") Or (CalibrateType = "POV") 1156 | { 1157 | ;Check if POV is used 1158 | IfInString, joy_info, P 1159 | { 1160 | GetKeyState, joyp, %JoystickNumber%JoyPOV 1161 | If (joyp <> NeutralP) 1162 | { 1163 | AxisNumber = P 1164 | Value := joyp 1165 | TempType = POV 1166 | } 1167 | } 1168 | } 1169 | If (CalibrateType = "Detect") Or (CalibrateType = "Button") 1170 | { 1171 | ;Check if Buttons pressed 1172 | Loop, %joy_buttons% 1173 | { 1174 | GetKeyState, joy%a_index%, %JoystickNumber%joy%a_index% 1175 | if joy%a_index% = D 1176 | { 1177 | AxisNumber = B 1178 | TempType = Button 1179 | Value = %a_index% 1180 | } 1181 | } 1182 | } 1183 | CalibrateType := TempType 1184 | Return Value 1185 | } 1186 | 1187 | CalibrateJoystick() 1188 | { 1189 | global 1190 | local TempSettingUp, TempSettingLeft, TempSettingRight, TempSettingDown, TempCalibrationType, TempAxisNumber, TempAxisUpDown, TempAxisLeftRight 1191 | MsgBox,8192, Calibration, Make sure no buttons are pressed and joysticks are in neutral position then press "OK" 1192 | GetNeutral() 1193 | MsgBox,8192, Calibration, Using the buttons or joystick that will be assigned to quick chat, hold UP (with all other buttons/joysticks in their neutral position) then press "OK" 1194 | TempCalibrationType = Detect 1195 | TempSettingUp := CalibrateDir(TempCalibrationType, TempAxisNumber) 1196 | If (TempCalibrationType = "Error") 1197 | { 1198 | MsgBox,8192, Calibration Failed, No input detected`nPlease try again 1199 | Return 1200 | } 1201 | TempAxisUpDown := TempAxisNumber 1202 | MsgBox,8192, Calibration, Calibration type "%TempCalibrationType%" detected`nHold DOWN then press OK 1203 | TempSettingDown := CalibrateDir(TempCalibrationType, TempAxisNumber) 1204 | If (TempCalibrationType = "Error") 1205 | { 1206 | MsgBox,8192, Calibration Failed, No input detected`nPlease try again 1207 | Return 1208 | } 1209 | If (TempAxisNumber <> TempAxisUpDown) 1210 | { 1211 | MsgBox,8192, Calibration Failed, Inconsistent axis detected`nPlease try again 1212 | Return 1213 | } 1214 | MsgBox,8192, Calibration, Hold LEFT then press OK 1215 | TempSettingLeft := CalibrateDir(TempCalibrationType, TempAxisNumber) 1216 | If (TempCalibrationType = "Error") 1217 | { 1218 | MsgBox,8192, Calibration Failed, No input detected`nPlease try again 1219 | Return 1220 | } 1221 | TempAxisLeftRight := TempAxisNumber 1222 | 1223 | If (TempCalibrationType = "Axis") and (TempAxisLeftRight = TempAxisUpDown) 1224 | { 1225 | MsgBox,8192, Calibration Failed, Left and Right cannot be mapped to the same axis as Up and Down`nPlease Try Agin 1226 | Return 1227 | } 1228 | MsgBox,8192, Calibration, Hold RIGHT then press OK 1229 | TempSettingRight := CalibrateDir(TempCalibrationType, TempAxisNumber) 1230 | If (TempCalibrationType = "Error") 1231 | { 1232 | MsgBox,8192, Calibration Failed, No input detected`nPlease try again 1233 | Return 1234 | } 1235 | If (TempAxisNumber <> TempAxisLeftRight) 1236 | { 1237 | MsgBox,8192, Calibration Failed, Inconsistent axis detected`nPlease try again 1238 | Return 1239 | } 1240 | If TempCalibrationType <> Axis 1241 | { 1242 | If (TempSettingUP = TempSettingDown) or (TempSettingUP = TempSettingLeft) or (TempSettingUP = TempSettingRight) or (TempSettingLeft = TempSettingDown) or (TempSettingLeft = TempSettingRight) or (TempSettingRight = TempSettingDown) 1243 | { 1244 | MsgBox,8192, Calibration Failed, At least two directions are mapped to the same input`nUP:%TempSettingUp% DN:%TempSettingUp% LT:%TempSettingLeft% RT:%TempSettingRight%`nPlease try again 1245 | Return 1246 | } 1247 | } 1248 | CustomJoystickType := TempCalibrationType 1249 | CustomJoystickUp := TempSettingUP 1250 | CustomJoystickDown := TempSettingDown 1251 | CustomJoystickLeft := TempSettingLeft 1252 | CustomJoystickRight := TempSettingRight 1253 | CustomJoystickUpDownAxis := TempAxisUpDown 1254 | CustomJoystickLeftRightAxis :=TempAxisLeftRight 1255 | CustomJoystickSettingString = %CustomJoystickType%`nUP:%CustomJoystickUpDownAxis%%CustomJoystickUp% DN:%CustomJoystickUpDownAxis%%CustomJoystickDown%`nLT:%CustomJoystickLeftRightAxis%%CustomJoystickLeft% RT:%CustomJoystickLeftRightAxis%%CustomJoystickRight% 1256 | MsgBox,8192,Calibration Successful, Calibration Successful!`nSettings: %CustomJoystickSettingString% 1257 | GuiControl,, CustomJoystickSettingString, %CustomJoystickSettingString% 1258 | } 1259 | 1260 | JoystickCalc() 1261 | { 1262 | global 1263 | If JoystickType = 1 1264 | { 1265 | QuickChatType = Keyboard 1266 | } 1267 | Else If JoystickType = 2 1268 | { 1269 | QuickChatType = POV 1270 | QuickChatUp = 0 1271 | QuickChatRight = 9000 1272 | QuickChatDown = 18000 1273 | QuickChatLeft = 27000 1274 | QuickChatUpDownAxis = P 1275 | QuickChatLeftRightAxis = P 1276 | } 1277 | Else 1278 | { 1279 | QuickChatType := CustomJoystickType 1280 | QuickChatUp := CustomJoystickUp 1281 | QuickChatRight := CustomJoystickRight 1282 | QuickChatDown := CustomJoystickDown 1283 | QuickChatLeft := CustomJoystickLeft 1284 | QuickChatUpDownAxis := CustomJoystickUpDownAxis 1285 | QuickChatLeftRightAxis := CustomJoystickLeftRightAxis 1286 | } 1287 | If QuickChatType = Axis 1288 | { 1289 | If (QuickChatUp > QuickChatDown) 1290 | { 1291 | QuickChatUpDownHighValue := QuickChatUp 1292 | QuickChatUpDownLowValue := QuickChatDown 1293 | QuickChatUpDownHighDir = Up 1294 | QuickChatUpDownLowDir = Down 1295 | } 1296 | Else 1297 | { 1298 | QuickChatUpDownHighValue := QuickChatDown 1299 | QuickChatUpDownLowValue := QuickChatUp 1300 | QuickChatUpDownHighDir = Down 1301 | QuickChatUpDownLowDir = Up 1302 | } 1303 | QuickChatUpDownMid := (QuickChatUpDownHighValue+QuickChatUpDownLowValue)/2 1304 | QuickChatUpDownDiff := (QuickChatUpDownHighValue-QuickChatUpDownLowValue)/2 1305 | QuickChatUpDownHighActiveThresh := QuickChatUpDownHighValue-(QuickChatUpDownDiff*AxisActiveRatio) 1306 | QuickChatUpDownLowActiveThresh := QuickChatUpDownLowValue+(QuickChatUpDownDiff*AxisActiveRatio) 1307 | 1308 | 1309 | If (QuickChatLeft > QuickChatRight) 1310 | { 1311 | QuickChatLeftRightHighValue := QuickChatLeft 1312 | QuickChatLeftRightLowValue := QuickChatRight 1313 | QuickChatLeftRightHighDir = Left 1314 | QuickChatLeftRightLowDir = Right 1315 | } 1316 | Else 1317 | { 1318 | QuickChatLeftRightHighValue := QuickChatRight 1319 | QuickChatLeftRightLowValue := QuickChatLeft 1320 | QuickChatLeftRightHighDir = Right 1321 | QuickChatLeftRightLowDir = Left 1322 | } 1323 | QuickChatLeftRightMid := (QuickChatLeftRightHighValue+QuickChatLeftRightLowValue)/2 1324 | QuickChatLeftRightDiff := (QuickChatLeftRightHighValue-QuickChatLeftRightLowValue)/2 1325 | QuickChatLeftRightHighActiveThresh := QuickChatLeftRightHighValue-(QuickChatLeftRightDiff*AxisActiveRatio) 1326 | QuickChatLeftRightLowActiveThresh := QuickChatLeftRightLowValue+(QuickChatLeftRightDiff*AxisActiveRatio) 1327 | } 1328 | If QuickChatType = POV 1329 | { 1330 | index := 0 1331 | If QuickChatUp between %QuickChatLeft% and %QuickChatRight% 1332 | { 1333 | index := index + 1 1334 | TempDir%index% = 0 1335 | TempVal%index% := QuickChatUp 1336 | } 1337 | If QuickChatRight between %QuickChatUp% and %QuickChatDown% 1338 | { 1339 | index := index + 1 1340 | TempDir%index% = 1 1341 | TempVal%index% := QuickChatRight 1342 | } 1343 | If QuickChatDown between %QuickChatRight% and %QuickChatLeft% 1344 | { 1345 | index := index + 1 1346 | TempDir%index% = 2 1347 | TempVal%index% := QuickChatDown 1348 | } 1349 | If QuickChatLeft between %QuickChatDown% and %QuickChatUp% 1350 | { 1351 | index := index + 1 1352 | TempDir%index% = 3 1353 | TempVal%index% := QuickChatLeft 1354 | } 1355 | QuickChatPOVClockwise = 1 1356 | If (index <> 2) ;Direction is not clockwise 1357 | { 1358 | index := 0 1359 | QuickChatPOVClockwise = -1 1360 | If QuickChatUp between %QuickChatRight% and %QuickChatLeft% 1361 | { 1362 | index := index + 1 1363 | TempDir%index% = 0 1364 | TempVal%index% := QuickChatUp 1365 | } 1366 | If QuickChatLeft between %QuickChatUp% and %QuickChatDown% 1367 | { 1368 | index := index + 1 1369 | TempDir%index% = 3 1370 | TempVal%index% := QuickChatLeft 1371 | } 1372 | If QuickChatDown between %QuickChatLeft% and %QuickChatRight% 1373 | { 1374 | index := index + 1 1375 | TempDir%index% = 2 1376 | TempVal%index% := QuickChatDown 1377 | } 1378 | If QuickChatRight between %QuickChatDown% and %QuickChatUp% 1379 | { 1380 | index := index + 1 1381 | TempDir%index% = 1 1382 | TempVal%index% := QuickChatRight 1383 | } 1384 | If (index <> 2) 1385 | MsgBox,8192,Sorry!, POV Calculation error`nCould not detect rotational direction`nPlease recalibrate controller 1386 | } 1387 | If TempVal1>TempVal2 1388 | { 1389 | TempHighVal:=TempVal1 1390 | TempHighDir:=TempDir1 1391 | TempLowVal:=TempVal2 1392 | TempLowDir:=TempDir2 1393 | } 1394 | Else 1395 | { 1396 | TempLowVal:=TempVal1 1397 | TempLowDir:=TempDir1 1398 | TempHighVal:=TempVal2 1399 | TempHighDir:=TempDir2 1400 | } 1401 | 1402 | TempDiff:=abs(TempHighVal-(TempLowVal*2)) 1403 | TempTolerance:=TempLowVal/8 1404 | 1405 | If (TempDiff > TempTolerance) 1406 | { 1407 | POVMidVal := TempLowVal 1408 | POVMidDir := TempLowDir 1409 | } 1410 | Else 1411 | { 1412 | POVMidVal := TempHighVal 1413 | POVMidDir := TempHighDir 1414 | } 1415 | POVMaxVal := 2*POVMidVal 1416 | Loop, 8 1417 | { 1418 | QuickChatPOV%a_index%Eighth:=POVMaxVal*(a_index/8) 1419 | } 1420 | ; 0 = up and continue in rotational direction with 3 being largest, if clockwise 1421 | QuickChatPOVDirFirst:=Mod(2+POVMidDir,4) 1422 | QuickChatPOVDirSecond:=abs(Mod(QuickChatPOVClockwise+QuickChatPOVDirFirst,4)) 1423 | QuickChatPOVDirThird:=abs(Mod(QuickChatPOVClockwise+QuickChatPOVDirSecond,4)) 1424 | QuickChatPOVDirFourth:=abs(Mod(QuickChatPOVClockwise+QuickChatPOVDirThird,4)) 1425 | QuickChatPOVDirFirst:=NumToDir(QuickChatPOVDirFirst) 1426 | QuickChatPOVDirSecond:=NumToDir(QuickChatPOVDirSecond) 1427 | QuickChatPOVDirThird:=NumToDir(QuickChatPOVDirThird) 1428 | QuickChatPOVDirFourth:=NumToDir(QuickChatPOVDirFourth) 1429 | } 1430 | } 1431 | 1432 | 1433 | NumToDir(Input) 1434 | { 1435 | If Input = 0 1436 | Return "Up" 1437 | Else If Input = 1 1438 | Return "Right" 1439 | Else If Input = 2 1440 | Return "Down" 1441 | Else 1442 | Return "Left" 1443 | } 1444 | 1445 | MenuTimeCheck() 1446 | { 1447 | global 1448 | 1449 | MenuTimeElapsed := A_TickCount - MenuOpenTime 1450 | 1451 | If (MenuTimeElapsed >= MenuTimeout) 1452 | { 1453 | ResetMenu() 1454 | } 1455 | Else 1456 | { 1457 | UpdateMenuBar() 1458 | } 1459 | } 1460 | 1461 | UpdateMenuBar() 1462 | { 1463 | global 1464 | If CurrMenu <> None 1465 | { 1466 | MenuTimeLeft := MenuTimeout - MenuTimeElapsed 1467 | MenuPercentLeft := 100*MenuTimeleft/MenuTimeout 1468 | GuiControl,, IndicatorMenuProg, %MenuPercentLeft% 1469 | Temp1:= A_TickCount - OverlayMenuLastUpdateTime 1470 | If (OverlayInitialized) = 1 and (OverlayON = 1) 1471 | { 1472 | If (MenuTimerON = 1) and (Temp1 > OverlayMenuUpdatePeriod) 1473 | { 1474 | Temp1:=Floor(OverlayBgW*(MenuPercentLeft/100)) 1475 | Temp2:=(OverlayX+(OverlayBgW - Temp1)) 1476 | BoxSetPos(OverlayTimerID, Temp2, OverlayTimerY) 1477 | BoxSetWidth(OverlayTimerID, Temp1) 1478 | OverlayMenuLastUpdateTime := A_TickCount 1479 | } 1480 | } 1481 | 1482 | } 1483 | Else 1484 | { 1485 | GuiControl,, IndicatorMenuProg, 0 1486 | } 1487 | } 1488 | 1489 | ResetMenu() 1490 | { 1491 | global 1492 | CurrMenu = None 1493 | Holding := False 1494 | GuiControl, Text, IndicatorMenu, %CurrMenu% 1495 | UpdateMenuBar() 1496 | If OverlayInitialized = 1 1497 | { 1498 | If OverlayON 1499 | { 1500 | OverlayDispOff() 1501 | } 1502 | } 1503 | 1504 | } 1505 | 1506 | SetMenu() 1507 | { 1508 | global 1509 | CurrMenu := CurrDir 1510 | Holding := True 1511 | GuiControl, , IndicatorMenu, %CurrMenu% 1512 | MenuOpenTime = %A_TickCount% 1513 | If OverlayInitialized = 1 1514 | { 1515 | If OverlayON and InGame 1516 | { 1517 | OverlayDispMenu() 1518 | } 1519 | } 1520 | } 1521 | 1522 | SendChat() 1523 | { 1524 | global 1525 | Sending = 1 1526 | If (InGame = True) 1527 | { 1528 | TeamCheck := Team%CurrMenu%%CurrDir% 1529 | Output := %CurrMenu%%CurrDir% 1530 | Output := BankReplace(Output) 1531 | If TeamCheck = 1 1532 | { 1533 | SendInput %TeamChat% 1534 | } 1535 | Else 1536 | { 1537 | SendInput %AllChat% 1538 | } 1539 | Sleep %ChatOpenDelay% 1540 | SendInput {Raw}%Output% 1541 | SendInput {Enter} 1542 | } 1543 | Sending = 0 1544 | guiControl, , IndicatorSelection, %CurrMenu%-Hold 1545 | } 1546 | 1547 | FormatOverlayMsg(Input) 1548 | { 1549 | global OverlayCharLim 1550 | 1551 | Length:=StrLen(Input) 1552 | 1553 | If (Length > OverlayCharLim) 1554 | { 1555 | Extra := Length - OverlayCharLim + 1 1556 | StringTrimRight, Input, Input, Extra 1557 | Input =%Input%... 1558 | } 1559 | Return Input 1560 | } 1561 | 1562 | 1563 | OverlayInit() 1564 | { 1565 | global 1566 | 1567 | OverlayMsgUpUp := FormatOverlayMsg(UpUp) 1568 | OverlayMsgUpLeft := FormatOverlayMsg(UpLeft) 1569 | OverlayMsgUpRight := FormatOverlayMsg(UpRight) 1570 | OverlayMsgUpDown := FormatOverlayMsg(UpDown) 1571 | OverlayMsgUpHold := FormatOverlayMsg(UpHold) 1572 | 1573 | OverlayMsgLeftUp := FormatOverlayMsg(LeftUp) 1574 | OverlayMsgLeftLeft := FormatOverlayMsg(LeftLeft) 1575 | OverlayMsgLeftRight := FormatOverlayMsg(LeftRight) 1576 | OverlayMsgLeftDown := FormatOverlayMsg(LeftDown) 1577 | OverlayMsgLeftHold := FormatOverlayMsg(LeftHold) 1578 | 1579 | OverlayMsgRightUp := FormatOverlayMsg(RightUp) 1580 | OverlayMsgRightLeft := FormatOverlayMsg(RightLeft) 1581 | OverlayMsgRightRight := FormatOverlayMsg(RightRight) 1582 | OverlayMsgRightDown := FormatOverlayMsg(RightDown) 1583 | OverlayMsgRightHold := FormatOverlayMsg(RightHold) 1584 | 1585 | OverlayMsgDownUp := FormatOverlayMsg(DownUp) 1586 | OverlayMsgDownLeft := FormatOverlayMsg(DownLeft) 1587 | OverlayMsgDownRight := FormatOverlayMsg(DownRight) 1588 | OverlayMsgDownDown := FormatOverlayMsg(DownDown) 1589 | OverlayMsgDownHold := FormatOverlayMsg(DownHold) 1590 | 1591 | If (QuickChatType = "Keyboard") 1592 | { 1593 | LblUpText = %StandardChatUp% 1594 | LblLeftText =%StandardChatLeft% 1595 | LblRightText = %StandardChatRight% 1596 | LblDownText= %StandardChatDown% 1597 | LblHoldText= l 1598 | TempLblFont:= LblFont 1599 | HoldLblFont:= "Wingdings" 1600 | } 1601 | Else If LblArrow = 1 1602 | { 1603 | LblUpText = UP 1604 | LblLeftText = LT 1605 | LblRightText = RT 1606 | LblDownText= DN 1607 | LblHoldText := " H" 1608 | TempLblFont:= LblFont 1609 | HoldLblFont:= LblFont 1610 | } 1611 | Else If LblArrow = 2 1612 | { 1613 | LblUpText = # 1614 | LblLeftText =! 1615 | LblRightText =" 1616 | LblDownText=$ 1617 | LblHoldText=l 1618 | TempLblFont:= "Wingdings 3" 1619 | HoldLblFont:= "Wingdings" 1620 | } 1621 | Else If LblArrow = 3 1622 | { 1623 | LblUpText = h 1624 | LblLeftText =f 1625 | LblRightText =g 1626 | LblDownText=i 1627 | LblHoldText=o 1628 | TempLblFont:= "Wingdings 3" 1629 | HoldLblFont:= "Wingdings" 1630 | } 1631 | Else If LblArrow = 4 1632 | { 1633 | LblUpText = 5 1634 | LblLeftText =3 1635 | LblRightText =4 1636 | LblDownText=6 1637 | LblHoldText=l 1638 | TempLblFont:= "Wingdings 3" 1639 | HoldLblFont:= "Wingdings" 1640 | } 1641 | Else If LblArrow = 5 1642 | { 1643 | LblUpText = < 1644 | LblLeftText =: 1645 | LblRightText =9 1646 | LblDownText=> 1647 | LblHoldText=o 1648 | TempLblFont:= "Wingdings 3" 1649 | HoldLblFont:= "Wingdings" 1650 | } 1651 | Else If LblArrow = 6 1652 | { 1653 | LblUpText = J 1654 | LblLeftText =H 1655 | LblRightText =I 1656 | LblDownText=K 1657 | LblHoldText=o 1658 | TempLblFont:= "Wingdings 3" 1659 | HoldLblFont:= "Wingdings" 1660 | } 1661 | Else If LblArrow = 7 1662 | { 1663 | LblUpText = p 1664 | LblLeftText =t 1665 | LblRightText =u 1666 | LblDownText=q 1667 | LblHoldText=n 1668 | TempLblFont:= "Wingdings 3" 1669 | HoldLblFont:= "Wingdings" 1670 | } 1671 | Else If LblArrow = 8 1672 | { 1673 | LblUpText = r 1674 | LblLeftText =v 1675 | LblRightText =w 1676 | LblDownText=s 1677 | LblHoldText=o 1678 | TempLblFont:= "Wingdings 3" 1679 | HoldLblFont:= "Wigdings" 1680 | } 1681 | 1682 | 1683 | MsgBold := False 1684 | MsgItalic := False 1685 | If MsgModifier = 2 1686 | MsgBold := True 1687 | Else If MsgModifier = 3 1688 | MsgItalic := True 1689 | 1690 | TeamBold := False 1691 | TeamItalic := False 1692 | If TeamModifier = 2 1693 | TeamBold := True 1694 | Else If TeamModifier = 3 1695 | TeamItalic := True 1696 | 1697 | LblBold := False 1698 | LblItalic := False 1699 | If LblModifier = 2 1700 | LblBold := True 1701 | Else If LblModifier = 3 1702 | LblItalic := True 1703 | 1704 | Temp1:=Hex(OverlayTextOpac) 1705 | LblColorValue = 0x%Temp1%%LblColor% 1706 | MsgColorValue = 0x%Temp1%%MsgColor% 1707 | TeamColorValue = 0x%Temp1%%TeamColor% 1708 | Temp2:=BgOpac*255/100 1709 | Temp1:=Hex(Temp2) 1710 | BgColorValue = 0x%Temp1%%BgColor% 1711 | 1712 | LblStartX:=OverlayX+OverlayBgMargin 1713 | MsgStartX:=LblStartX 1714 | 1715 | LblFontSize := FontSize 1716 | MsgFontSize := FontSize 1717 | TeamFontSize := FontSize/2 1718 | Temp1:=(FontSize/FontSizeMed) 1719 | OverlayTeamYOffset := OverlayTeamYOffsetMed * Temp1 + TeamFlatOffset 1720 | OverlayYSpacing:= OverlayYSpacingMed * Temp1 1721 | OverlayBgBotAdj:= OverlayBgBotAdjMed * Temp1 1722 | 1723 | OverlayRow1Y:=OverlayTeamYOffset+OverlayY+OverlayBgMargin 1724 | OverlayRow2Y:=OverlayRow1Y+OverlayYSpacing 1725 | OverlayRow3Y:=OverlayRow2Y+OverlayYSpacing 1726 | OverlayRow4Y:=OverlayRow3Y+OverlayYSpacing 1727 | OverlayRowMaxY :=OverlayRow4Y 1728 | If HoldEnable = 1 1729 | { 1730 | OverlayRow5Y:=OverlayRow4Y+OverlayYSpacing 1731 | OverlayRowMaxY := OverlayRow5Y 1732 | } 1733 | 1734 | If LabelsON = 1 1735 | { 1736 | MsgStartX:=MsgStartX+(OverlayXSpacing*Temp1) 1737 | } 1738 | OverlayBgW:=(BgWidth*Temp1) + MsgStartX - OverlayX + OverlayBgMargin 1739 | OverlayBgH:= (OverlayRowMaxY - OverlayY) + OverlayBgMargin + OverlayBgBotAdj 1740 | OverlayBgID:= BoxCreate(OverlayX, OverlayY, OverlayBgW, OverlayBgH, BgColorValue, False) 1741 | OverlayTimerY := OverlayY - OverlayTimerYOffset - OverlayTimerH 1742 | OverlayTimerID:= BoxCreate(OverlayX, OverlayTimerY, OverlayBgW, OverlayTimerH, BgColorValue, False) 1743 | 1744 | OverlayLblUpID := TextCreate(TempLblFont, LblFontSize, LblBold, LblItalic, LblStartX, OverlayRow1Y, LblColorValue, LblUpText, true, False) 1745 | OverlayLblLeftID := TextCreate(TempLblFont, LblFontSize, LblBold, LblItalic, LblStartX, OverlayRow2Y, LblColorValue, LblLeftText, true, False) 1746 | OverlayLblRightID := TextCreate(TempLblFont, LblFontSize, LblBold, LblItalic, LblStartX, OverlayRow3Y, LblColorValue, LblRightText, true, False) 1747 | OverlayLblDownID := TextCreate(TempLblFont, LblFontSize, LblBold, LblItalic, LblStartX, OverlayRow4Y, LblColorValue, LblDownText, true, False) 1748 | OverlayLblHoldID := TextCreate(HoldLblFont, LblFontSize, LblBold, LblItalic, LblStartX, OverlayRow5Y, LblColorValue, LblHoldText, true, False) 1749 | OverlayMsgUpID := TextCreate(MsgFont, MsgFontSize, MsgBold, MsgItalic, MsgStartX, OverlayRow1Y, MsgColorValue, OverlayUpMsg, true, False) 1750 | OverlayMsgLeftID := TextCreate(MsgFont, MsgFontSize, MsgBold, MsgItalic, MsgStartX, OverlayRow2Y, MsgColorValue, OverlayLeftMsg, true, False) 1751 | OverlayMsgRightID := TextCreate(MsgFont, MsgFontSize, MsgBold, MsgItalic, MsgStartX, OverlayRow3Y, MsgColorValue, OverlayRightMsg, true, False) 1752 | OverlayMsgDownID := TextCreate(MsgFont, MsgFontSize, MsgBold, MsgItalic, MsgStartX, OverlayRow4Y, MsgColorValue, OverlayDownMsg, true, False) 1753 | OverlayMsgHoldID := TextCreate(MsgFont, MsgFontSize, MsgBold, MsgItalic, MsgStartX, OverlayRow5Y, MsgColorValue, OverlayHoldMsg, true, False) 1754 | 1755 | Temp1:=OverlayY+OverlayBgH 1756 | OverlayChatModeID := TextCreate(MsgFont, MsgFontSize, False, False, OverlayX, Temp1, "0xFFFFFFFF", "ChatMode", true, False) 1757 | 1758 | Temp1:=OverlayRow1Y-OverlayTeamYOffset 1759 | OverlayTeamUpID := TextCreate(TeamFont, TeamFontSize, TeamBold, TeamItalic, MsgStartX, Temp1, TeamColorValue, "TEAM", true, False) 1760 | Temp1:=OverlayRow2Y-OverlayTeamYOffset 1761 | OverlayTeamLeftID := TextCreate(TeamFont, TeamFontSize, TeamBold, TeamItalic, MsgStartX, Temp1, TeamColorValue, "TEAM", true, False) 1762 | Temp1:=OverlayRow3Y-OverlayTeamYOffset 1763 | OverlayTeamRightID := TextCreate(TeamFont, TeamFontSize, TeamBold, TeamItalic, MsgStartX, Temp1, TeamColorValue, "TEAM", true, False) 1764 | Temp1:=OverlayRow4Y-OverlayTeamYOffset 1765 | OverlayTeamDownID := TextCreate(TeamFont, TeamFontSize, TeamBold, TeamItalic, MsgStartX, Temp1, TeamColorValue, "TEAM", true, False) 1766 | Temp1:=OverlayRow5Y-OverlayTeamYOffset 1767 | OverlayTeamHoldID := TextCreate(TeamFont, TeamFontSize, TeamBold, TeamItalic, MsgStartX, Temp1, TeamColorValue, "TEAM", true, False) 1768 | OverlayInitialized = 1 1769 | } 1770 | 1771 | 1772 | OverlayDispOff() 1773 | { 1774 | global 1775 | 1776 | BoxSetShown(OverlayBgID, False) 1777 | 1778 | If MenuTimerON = 1 1779 | { 1780 | BoxSetShown(OverlayTimerID, False) 1781 | } 1782 | 1783 | If LabelsON 1784 | { 1785 | TextSetShown(OverlayLblUpID, False) 1786 | TextSetShown(OverlayLblLeftID, False) 1787 | TextSetShown(OverlayLblRightID, False) 1788 | TextSetShown(OverlayLblDownID, False) 1789 | } 1790 | 1791 | TextSetShown(OverlayMsgUpID, False) 1792 | TextSetShown(OverlayMsgLeftID, False) 1793 | TextSetShown(OverlayMsgRightID, False) 1794 | TextSetShown(OverlayMsgDownID, False) 1795 | 1796 | 1797 | TextSetShown(OverlayTeamUpID, False) 1798 | TextSetShown(OverlayTeamLeftID, False) 1799 | TextSetShown(OverlayTeamRightID, False) 1800 | TextSetShown(OverlayTeamDownID, False) 1801 | 1802 | If HoldEnable = 1 1803 | { 1804 | TextSetShown(OverlayLblHoldID, False) 1805 | TextSetShown(OverlayMsgHoldID, False) 1806 | TextSetShown(OverlayTeamHoldID, False) 1807 | } 1808 | } 1809 | 1810 | OverlayDispMenu() 1811 | { 1812 | global 1813 | 1814 | OverlayUpMsg:= OverlayMsg%CurrMenu%Up 1815 | OverlayLeftMsg:= OverlayMsg%CurrMenu%Left 1816 | OverlayRightMsg:= OverlayMsg%CurrMenu%Right 1817 | OverlayDownMsg:= OverlayMsg%CurrMenu%Down 1818 | 1819 | TextSetString(OverlayMsgUpID, OverlayUpMsg) 1820 | TextSetString(OverlayMsgLeftID, OverlayLeftMsg) 1821 | TextSetString(OverlayMsgRightID, OverlayRightMsg) 1822 | TextSetString(OverlayMsgDownID, OverlayDownMsg) 1823 | 1824 | BoxSetShown(OverlayBgID, True) 1825 | 1826 | If MenuTimerON = 1 1827 | { 1828 | BoxSetPos(OverlayTimerID, OverlayX, OverlayTimerY) 1829 | BoxSetWidth(OverlayTimerID, OverlayBgW) 1830 | BoxSetShown(OverlayTimerID, True) 1831 | } 1832 | 1833 | If LabelsON = 1 1834 | { 1835 | TextSetShown(OverlayLblUpID, True) 1836 | TextSetShown(OverlayLblLeftID, True) 1837 | TextSetShown(OverlayLblRightID, True) 1838 | TextSetShown(OverlayLblDownID, True) 1839 | } 1840 | 1841 | TextSetShown(OverlayMsgUpID, True) 1842 | TextSetShown(OverlayMsgLeftID, True) 1843 | TextSetShown(OverlayMsgRightID, True) 1844 | TextSetShown(OverlayMsgDownID, True) 1845 | 1846 | If (Team%CurrMenu%Up = 1) 1847 | { 1848 | TextSetShown(OverlayTeamUpID, True) 1849 | } 1850 | If (Team%CurrMenu%Left = 1) 1851 | { 1852 | TextSetShown(OverlayTeamLeftID, True) 1853 | } 1854 | If (Team%CurrMenu%Right = 1) 1855 | { 1856 | TextSetShown(OverlayTeamRightID, True) 1857 | } 1858 | If (Team%CurrMenu%Down = 1) 1859 | { 1860 | TextSetShown(OverlayTeamDownID, True) 1861 | } 1862 | 1863 | 1864 | If HoldEnable = 1 1865 | { 1866 | OverlayHoldMsg:= OverlayMsg%CurrMenu%Hold 1867 | TextSetString(OverlayMsgHoldID, OverlayHoldMsg) 1868 | TextSetShown(OverlayMsgHoldID, True) 1869 | If LabelsON = 1 1870 | { 1871 | TextSetShown(OverlayLblHoldID, True) 1872 | } 1873 | If (Team%CurrMenu%Hold = 1) 1874 | { 1875 | TextSetShown(OverlayTeamHoldID, True) 1876 | } 1877 | } 1878 | 1879 | } 1880 | 1881 | DestroyOverlay() 1882 | { 1883 | global 1884 | BoxDestroy(OverlayBgID) 1885 | BoxDestroy(OverlayTimerID) 1886 | 1887 | TextDestroy(OverlayLblUpID) 1888 | TextDestroy(OverlayLblLeftID) 1889 | TextDestroy(OverlayLblRightID) 1890 | TextDestroy(OverlayLblDownID) 1891 | TextDestroy(OverlayLblHoldID) 1892 | 1893 | TextDestroy(OverlayMsgUpID) 1894 | TextDestroy(OverlayMsgLeftID) 1895 | TextDestroy(OverlayMsgRightID) 1896 | TextDestroy(OverlayMsgDownID) 1897 | TextDestroy(OverlayMsgHoldID) 1898 | 1899 | 1900 | TextDestroy(OverlayChatModeID) 1901 | 1902 | TextDestroy(OverlayTeamUpID) 1903 | TextDestroy(OverlayTeamLeftID) 1904 | TextDestroy(OverlayTeamRightID) 1905 | TextDestroy(OverlayTeamDownID) 1906 | TextDestroy(OverlayTeamHoldID) 1907 | } 1908 | 1909 | SetChatMode(input) 1910 | { 1911 | global 1912 | 1913 | If input=-1 1914 | { 1915 | If (ChatMode=0) 1916 | { 1917 | ChatMode = 1 1918 | } 1919 | Else 1920 | { 1921 | ChatMode=0 1922 | } 1923 | If MuteChatToggle = 0 1924 | SoundPlay, %A_WinDir%\Media\ding.wav 1925 | } 1926 | Else 1927 | { 1928 | ChatMode:=input 1929 | } 1930 | 1931 | If ChatMode=1 1932 | { 1933 | GuiControl, Text, IndicatorChatMode, Custom 1934 | Temp1=Custom Chat Mode 1935 | } 1936 | Else 1937 | { 1938 | GuiControl, Text, IndicatorChatMode, Standard 1939 | Temp1=Standard Chat Mode 1940 | } 1941 | 1942 | If (OverlayON=1) and (OverlayInitialized = 1) 1943 | { 1944 | OverlayChatModeVisible = 1 1945 | TextSetString(OverlayChatModeID, Temp1) 1946 | TextSetShown(OverlayChatModeID, True) 1947 | ChatModeChangeTime:= A_TickCount 1948 | } 1949 | 1950 | If (QuickChatType = "Keyboard") 1951 | { 1952 | If ChatMode = 0 1953 | { 1954 | GoSub DisableQuickChatHotkeys 1955 | SetTimer, ReEnableQuickChatHotkeys, Off 1956 | } 1957 | Else 1958 | { 1959 | GoSub EnableQuickChatHotkeys 1960 | } 1961 | } 1962 | 1963 | } 1964 | 1965 | StandardChat() 1966 | { 1967 | global 1968 | Output := StandardChat%CurrDir% 1969 | SendInput %Output% 1970 | } 1971 | 1972 | LimitCheck() 1973 | { 1974 | global 1975 | OutOfLims = 1976 | 1977 | If (AllChat = "") 1978 | OutOfLims = %OutOfLims%All Chat key must be set`n 1979 | If (TeamChat = "") 1980 | OutOfLims = %OutOfLims%Team Chat key must be set`n 1981 | If (StandardChatUp = "") 1982 | OutOfLims = %OutOfLims%Quick Chat Up key must be set`n 1983 | If (StandardChatLeft = "") 1984 | OutOfLims = %OutOfLims%Quick Chat Left key must be set`n 1985 | If (StandardChatRight = "") 1986 | OutOfLims = %OutOfLims%Quick Chat Right key must be set`n 1987 | If (StandardChatDown = "") 1988 | OutOfLims = %OutOfLims%Quick Chat Down key must be set`n 1989 | If MenuTimeout not between 100 and 5000 1990 | OutOfLims = %OutOfLims%Menu Timeout must be between 100 and 5000`n 1991 | If ChatOpenDelay not between 50 and 950 1992 | OutOfLims = %OutOfLims%Chat Open Delay must be between 50 and 950`n 1993 | If HoldTime not between 50 and %MenuTimeout% 1994 | OutOfLims = %OutOfLims%Hold Time must be between 50 and Menu Timeout`n 1995 | If JoystickSamplingPeriod not between 1 and 250 1996 | OutOfLims = %OutOfLims%Joystick Sampling Period must be between 1 and 250`n 1997 | If OverlayX not between 0 and 800 1998 | OutOfLims = %OutOfLims%Overlay Position X must be between 0 and 800`n 1999 | If OverlayY not between 0 and 600 2000 | OutOfLims = %OutOfLims%Overlay Position Y must be between 0 and 600`n 2001 | If Mod(FontSize,2) <> 0 or FontSize not between 4 and 30 2002 | OutOfLims = %OutOfLims%Overlay Size must be an even number between 4 and 30`n 2003 | If BgOpac not between 0 and 100 2004 | OutOfLims = %OutOfLims%Background Opacity must be between 0 and 100`n 2005 | If BgWidth not between 0 and 500 2006 | OutOfLims = %OutOfLims%Width Scale must be between 20 and 500`n 2007 | If OverlayCharLim not between 5 and %MaxMsgLength% 2008 | OutOfLims = %OutOfLims%Overlay Character Limit must be between 0 and %MaxMsgLength%`n 2009 | If StrLen(BgColor) < 6 2010 | OutOfLims = %OutOfLims%Background Color must be must be a hex color code`n 2011 | If StrLen(MsgColor) < 6 2012 | OutOfLims = %OutOfLims%Message Color must be must be a hex color code`n 2013 | If StrLen(TeamColor) < 6 2014 | OutOfLims = %OutOfLims%Team Indicator Color must be must be a hex color code`n 2015 | If StrLen(LblColor) < 6 2016 | OutOfLims = %OutOfLims%Label Color must be must be a hex color code`n 2017 | 2018 | If OutofLims <> 2019 | MsgBox,8192,Sorry!, % OutOfLims 2020 | 2021 | } 2022 | 2023 | 2024 | 2025 | 2026 | LoadIni(Option,Path) 2027 | { 2028 | global 2029 | If Path <> 2030 | { 2031 | If (Option = "All") 2032 | { 2033 | ;LastVer 2034 | IniRead, LastVersion, %Path%, ProgramInfo, LastVersion, 0 2035 | } 2036 | If (Option = "All") or (Option = "Messages") 2037 | { 2038 | ;Chat 2039 | ;Up 2040 | IniRead, UpUp, %Path%, Chat, UpUp, I got it! 2041 | IniRead, TeamUpUp, %Path%, Chat, TeamUpUp, 1 2042 | IniRead, UpLeft, %Path%, Chat, UpLeft, Centering... 2043 | IniRead, TeamUpLeft, %Path%, Chat, TeamUpLeft, 1 2044 | IniRead, UpRight, %Path%, Chat, UpRight, Take the shot! 2045 | IniRead, TeamUpRight, %Path%, Chat, TeamUpRight, 1 2046 | IniRead, UpDown, %Path%, Chat, UpDown, Defending... 2047 | IniRead, TeamUpDown, %Path%, Chat, TeamUpDown, 1 2048 | IniRead, UpHold, %Path%, Chat, UpHold, We got this! 2049 | IniRead, TeamUpHold, %Path%, Chat, TeamUpHold, 1 2050 | ;Left 2051 | IniRead, LeftUp, %Path%, Chat, LeftUp, Nice shot! 2052 | IniRead, TeamLeftUp, %Path%, Chat, TeamLeftUp, 0 2053 | IniRead, LeftLeft, %Path%, Chat, LeftLeft, Great pass! 2054 | IniRead, TeamLeftLeft, %Path%, Chat, TeamLeftLeft, 0 2055 | IniRead, LeftRight, %Path%, Chat, LeftRight, Thanks! 2056 | IniRead, TeamLeftRight, %Path%, Chat, TeamLeftRight, 0 2057 | IniRead, LeftDown, %Path%, Chat, LeftDown, What a save! 2058 | IniRead, TeamLeftDown, %Path%, Chat, TeamLeftDown, 0 2059 | IniRead, LeftHold, %Path%, Chat, LeftHold, [Good] play! 2060 | IniRead, TeamLeftHold, %Path%, Chat, TeamLeftHold, 0 2061 | ;Right 2062 | IniRead, RightUp, %Path%, Chat, RightUp, OMG! 2063 | IniRead, TeamRightUp, %Path%, Chat, TeamRightUp, 0 2064 | IniRead, RightLeft, %Path%, Chat, RightLeft, Noooo! 2065 | IniRead, TeamRightLeft, %Path%, Chat, TeamRightLeft, 0 2066 | IniRead, RightRight, %Path%, Chat, RightRight, Wow! 2067 | IniRead, TeamRightRight, %Path%, Chat, TeamRightRight, 0 2068 | IniRead, RightDown, %Path%, Chat, RightDown, Close one! 2069 | IniRead, TeamRightDown, %Path%, Chat, TeamRightDown, 0 2070 | IniRead, RightHold, %Path%, Chat, RightHold, Clutch! 2071 | IniRead, TeamRightHold, %Path%, Chat, TeamRightHold, 0 2072 | ;Down 2073 | CurseSymbols := "$#@%!" 2074 | IniRead, DownUp, %Path%, Chat, DownUp, %CurseSymbols% 2075 | IniRead, TeamDownUp, %Path%, Chat, TeamDownUp, 0 2076 | IniRead, DownLeft, %Path%, Chat, DownLeft, No Problem. 2077 | IniRead, TeamDownLeft, %Path%, Chat, TeamDownLeft, 0 2078 | IniRead, DownRight, %Path%, Chat, DownRight, Whoops... 2079 | IniRead, TeamDownRight, %Path%, Chat, TeamDownRight, 0 2080 | IniRead, DownDown, %Path%, Chat, DownDown, Sorry! 2081 | IniRead, TeamDownDown, %Path%, Chat, TeamDownDown, 0 2082 | IniRead, DownHold, %Path%, Chat, DownHold, You're Welcome! 2083 | IniRead, TeamDownHold, %Path%, Chat, TeamDownHold, 0 2084 | 2085 | Loop %NumberOfWordBanks% 2086 | { 2087 | IniRead, WordBankSelectType%A_Index%, %Path%, Chat, WordBankSelectType%A_Index%,2 2088 | 2089 | If A_Index < 2 2090 | { 2091 | TempText := BankNeedle%A_Index% 2092 | IniRead, BankNeedle%A_Index%, %Path%, Chat, BankNeedle%A_Index%, [Good] 2093 | 2094 | TempText := BankOptions%A_Index% 2095 | IniRead, BankOptions%A_Index%, %Path%, Chat, BankOptions%A_Index%, Great, Awesome, Superb, Rad, Magnificent, Wonderful, What a, Spectacular, Good, Nice, Amazing, Impressive, Beautiful 2096 | } 2097 | Else 2098 | { 2099 | TempText := BankNeedle%A_Index% 2100 | IniRead, BankNeedle%A_Index%, %Path%, Chat, BankNeedle%A_Index%,%A_Space% 2101 | 2102 | TempText := BankOptions%A_Index% 2103 | IniRead, BankOptions%A_Index%, %Path%, Chat, BankOptions%A_Index%,%A_Space% 2104 | } 2105 | } 2106 | 2107 | } 2108 | 2109 | ;Settings 2110 | If (Option = "All") 2111 | { 2112 | ;RL Keybindings 2113 | blank = 2114 | IniRead, AllChat, %Path%, Settings, AllChat, T 2115 | IniRead, TeamChat, %Path%, Settings, TeamChat, Y 2116 | IniRead, StandardChatUp, %Path%, Settings, StandardChatUp, 1 2117 | IniRead, StandardChatLeft, %Path%, Settings, StandardChatLeft, 2 2118 | IniRead, StandardChatRight, %Path%, Settings, StandardChatRight, 3 2119 | IniRead, StandardChatDown, %Path%, Settings, StandardChatDown, 4 2120 | ;Chat Settings 2121 | IniRead, ToggleChatButton, %Path%, Settings, ToggleChatButton, %A_Space% 2122 | IniRead, ToggleChatKey, %Path%, Settings, ToggleChatKey, %A_Space% 2123 | IniRead, MuteChatToggle, %Path%, Settings, MuteChatToggle, 0 2124 | IniRead, MenuTimeout, %Path%, Settings, MenuTimeout, 2000 2125 | IniRead, ChatOpenDelay, %Path%, Settings, ChatOpenDelay, 250 2126 | IniRead, HoldTime, %Path%, Settings, HoldTime, 500 2127 | IniRead, HoldEnable, %Path%, Settings, HoldEnable, 1 2128 | ;Auto Launch RL 2129 | IniRead, AutoLaunchRL, %Path%, Settings, AutoLaunchRL, 0 2130 | ;Gamepad Settings 2131 | IniRead, JoystickType, %Path%, Settings, JoystickType, 2 2132 | IniRead, SelectedJoystickNumber, %Path%, Settings, SelectedJoystickNumber, 1 2133 | IniRead, JoystickSamplingPeriod, %Path%, Settings, JoystickSamplingPeriod, 5 2134 | IniRead, CustomJoystickType, %Path%, Settings, CustomJoystickType, POV 2135 | IniRead, CustomJoystickUp, %Path%, Settings, CustomJoystickUp, 0 2136 | IniRead, CustomJoystickRight, %Path%, Settings, CustomJoystickRight, 9000 2137 | IniRead, CustomJoystickDown, %Path%, Settings, CustomJoystickDown, 18000 2138 | IniRead, CustomJoystickLeft, %Path%, Settings, CustomJoystickLeft, 27000 2139 | IniRead, CustomJoystickUpDownAxis, %Path%, Settings, CustomJoystickUpDownAxis, P 2140 | IniRead, CustomJoystickLeftRightAxis, %Path%, Settings, CustomJoystickLeftRightAxis, P 2141 | } 2142 | ;Overlay 2143 | IniRead, OverlayON, %Path%, Settings, OverlayON, 1 2144 | If (Option = "All") or (Option = "Overlay") 2145 | { 2146 | IniRead, OverlayX, %Path%, Settings, OverlayX, 20 2147 | IniRead, OverlayY, %Path%, Settings, OverlayY, 250 2148 | IniRead, FontSize, %Path%, Settings, FontSize, 10 2149 | IniRead, BgColor, %Path%, Settings, BgColor, 1B4667 2150 | IniRead, BgOpac, %Path%, Settings, BgOpac, 80 2151 | IniRead, BgWidth, %Path%, Settings, BgWidth, 100 2152 | IniRead, MenuTimerON, %Path%, Settings, MenuTimerON, 1 2153 | IniRead, MsgColor, %Path%, Settings, MsgColor, B0FFFF 2154 | IniRead, MsgFont, %Path%, Settings, MsgFont, Arial 2155 | IniRead, MsgModifier, %Path%, Settings, MsgModifier, 1 2156 | IniRead, TeamColor, %Path%, Settings, TeamColor, B0FFFF 2157 | IniRead, TeamFont, %Path%, Settings, TeamFont, Arial 2158 | IniRead, TeamModifier, %Path%, Settings, TeamModifier, 1 2159 | IniRead, TeamFlatOffset, %Path%, Settings, TeamFlatOffset, 2 2160 | IniRead, OverlayCharLim, %Path%, Settings, OverlayCharLim, 20 2161 | IniRead, LabelsON, %Path%, Settings, LabelsON, 1 2162 | IniRead, LblColor, %Path%, Settings, LblColor, B0FFFF 2163 | IniRead, LblFont, %Path%, Settings, LblFont, Arial 2164 | IniRead, LblModifier, %Path%, Settings, LblModifier, 1 2165 | IniRead, LblArrow, %Path%, Settings, LblArrow, 1 2166 | } 2167 | } 2168 | } 2169 | 2170 | SaveIni(Option,Path) 2171 | { 2172 | global 2173 | If Path <> 2174 | { 2175 | If (Option = "All") 2176 | { 2177 | ;Last Version 2178 | IniWrite, %LastVersion%, %Path%, ProgramInfo, LastVersion 2179 | } 2180 | If (Option = "All") or (Option = "Messages") 2181 | { 2182 | ;Chat 2183 | ;Up 2184 | IniWrite, %UpUp%, %Path%, Chat, UpUp 2185 | IniWrite, %TeamUpUp%, %Path%, Chat, TeamUpUp 2186 | IniWrite, %UpLeft%, %Path%, Chat, UpLeft 2187 | IniWrite, %TeamUpLeft%, %Path%, Chat, TeamUpLeft 2188 | IniWrite, %UpRight%, %Path%, Chat, UpRight 2189 | IniWrite, %TeamUpRight%, %Path%, Chat, TeamUpRight 2190 | IniWrite, %UpDown%, %Path%, Chat, UpDown 2191 | IniWrite, %TeamUpDown%, %Path%, Chat, TeamUpDown 2192 | IniWrite, %UpHold%, %Path%, Chat, UpHold 2193 | IniWrite, %TeamUpHold%, %Path%, Chat, TeamUpHold 2194 | ;Left 2195 | IniWrite, %LeftUp%, %Path%, Chat, LeftUp 2196 | IniWrite, %TeamLeftUp%, %Path%, Chat, TeamLeftUp 2197 | IniWrite, %LeftLeft%, %Path%, Chat, LeftLeft 2198 | IniWrite, %TeamLeftLeft%, %Path%, Chat, TeamLeftLeft 2199 | IniWrite, %LeftRight%, %Path%, Chat, LeftRight 2200 | IniWrite, %TeamLeftRight%, %Path%, Chat, TeamLeftRight 2201 | IniWrite, %LeftDown%, %Path%, Chat, LeftDown 2202 | IniWrite, %TeamLeftDown%, %Path%, Chat, TeamLeftDown 2203 | IniWrite, %LeftHold%, %Path%, Chat, LeftHold 2204 | IniWrite, %TeamLeftHold%, %Path%, Chat, TeamLeftHold 2205 | ;Right 2206 | IniWrite, %RightUp%, %Path%, Chat, RightUp 2207 | IniWrite, %TeamRightUp%, %Path%, Chat, TeamRightUp 2208 | IniWrite, %RightLeft%, %Path%, Chat, RightLeft 2209 | IniWrite, %TeamRightLeft%, %Path%, Chat, TeamRightLeft 2210 | IniWrite, %RightRight%, %Path%, Chat, RightRight 2211 | IniWrite, %TeamRightRight%, %Path%, Chat, TeamRightRight 2212 | IniWrite, %RightDown%, %Path%, Chat, RightDown 2213 | IniWrite, %TeamRightDown%, %Path%, Chat, TeamRightDown 2214 | IniWrite, %RightHold%, %Path%, Chat, RightHold 2215 | IniWrite, %TeamRightHold%, %Path%, Chat, TeamRightHold 2216 | ;Down 2217 | IniWrite, %DownUp%, %Path%, Chat, DownUp 2218 | IniWrite, %TeamDownUp%, %Path%, Chat, TeamDownUp 2219 | IniWrite, %DownLeft%, %Path%, Chat, DownLeft 2220 | IniWrite, %TeamDownLeft%, %Path%, Chat, TeamDownLeft 2221 | IniWrite, %DownRight%, %Path%, Chat, DownRight 2222 | IniWrite, %TeamDownRight%, %Path%, Chat, TeamDownRight 2223 | IniWrite, %DownDown%, %Path%, Chat, DownDown 2224 | IniWrite, %TeamDownDown%, %Path%, Chat, TeamDownDown 2225 | IniWrite, %DownHold%, %Path%, Chat, DownHold 2226 | IniWrite, %TeamDownHold%, %Path%, Chat, TeamDownHold 2227 | 2228 | Loop %NumberOfWordBanks% 2229 | { 2230 | TempText := BankNeedle%A_Index% 2231 | IniWrite, %TempText%, %Path%, Chat, BankNeedle%A_Index% 2232 | 2233 | TempText := BankOptions%A_Index% 2234 | IniWrite, %TempText%, %Path%, Chat, BankOptions%A_Index% 2235 | 2236 | TempNum := WordBankSelectType%A_Index% 2237 | IniWrite, %TempNum%, %Path%, Chat, WordBankSelectType%A_Index% 2238 | } 2239 | 2240 | 2241 | } 2242 | 2243 | If (Option = "All") 2244 | { 2245 | ;Settings 2246 | ;RL Keybeindings 2247 | IniWrite, %AllChat%, %Path%, Settings, AllChat 2248 | IniWrite, %TeamChat%, %Path%, Settings, TeamChat 2249 | IniWrite, %StandardChatUp%, %Path%, Settings, StandardChatUp 2250 | IniWrite, %StandardChatLeft%, %Path%, Settings, StandardChatLeft 2251 | IniWrite, %StandardChatRight%, %Path%, Settings, StandardChatRight 2252 | IniWrite, %StandardChatDown%, %Path%, Settings, StandardChatDown 2253 | ;Chat Settings 2254 | IniWrite, %ToggleChatButton%, %Path%, Settings, ToggleChatButton 2255 | IniWrite, %ToggleChatKey%, %Path%, Settings, ToggleChatKey 2256 | IniWrite, %MuteChatToggle%, %Path%, Settings, MuteChatToggle 2257 | IniWrite, %MenuTimeout%, %Path%, Settings, MenuTimeout 2258 | IniWrite, %ChatOpenDelay%, %Path%, Settings, ChatOpenDelay 2259 | IniWrite, %HoldTime%, %Path%, Settings, HoldTime 2260 | IniWrite, %HoldEnable%, %Path%, Settings, HoldEnable 2261 | ;Auto Launch RL 2262 | IniWrite, %AutoLaunchRL%, %Path%, Settings, AutoLaunchRL 2263 | ;Gamepad Settings 2264 | IniWrite, %JoystickType%, %Path%, Settings, JoystickType 2265 | IniWrite, %SelectedJoystickNumber%, %Path%, Settings, SelectedJoystickNumber 2266 | IniWrite, %JoystickSamplingPeriod%, %Path%, Settings, JoystickSamplingPeriod 2267 | IniWrite, %CustomJoystickType%, %Path%, Settings, CustomJoystickType 2268 | IniWrite, %CustomJoystickUp%, %Path%, Settings, CustomJoystickUp 2269 | IniWrite, %CustomJoystickDown%, %Path%, Settings, CustomJoystickDown 2270 | IniWrite, %CustomJoystickLeft%, %Path%, Settings, CustomJoystickLeft 2271 | IniWrite, %CustomJoystickRight%, %Path%, Settings, CustomJoystickRight 2272 | IniWrite, %CustomJoystickUpDownAxis%, %Path%, Settings, CustomJoystickUpDownAxis 2273 | IniWrite, %CustomJoystickLeftRightAxis%, %Path%, Settings, CustomJoystickLeftRightAxis 2274 | } 2275 | 2276 | ;Overlay 2277 | IniWrite, %OverlayON%, %Path%, Settings, OverlayON 2278 | If (Option = "All") or (Option = "Overlay") 2279 | { 2280 | IniWrite, %OverlayX%, %Path%, Settings, OverlayX 2281 | IniWrite, %OverlayY%, %Path%, Settings, OverlayY 2282 | IniWrite, %FontSize%, %Path%, Settings, FontSize 2283 | IniWrite, %BgColor%, %Path%, Settings, BgColor 2284 | IniWrite, %BgOpac%, %Path%, Settings, BgOpac 2285 | IniWrite, %BgWidth%, %Path%, Settings, BgWidth 2286 | IniWrite, %MenuTimerON%, %Path%, Settings, MenuTimerON 2287 | IniWrite, %MsgColor%, %Path%, Settings, MsgColor 2288 | IniWrite, %MsgFont%, %Path%, Settings, MsgFont 2289 | IniWrite, %MsgModifier%, %Path%, Settings, MsgModifier 2290 | IniWrite, %TeamColor%, %Path%, Settings, TeamColor 2291 | IniWrite, %TeamFont%, %Path%, Settings, TeamFont 2292 | IniWrite, %TeamModifier%, %Path%, Settings, TeamModifier 2293 | IniWrite, %TeamFlatOffset%, %Path%, Settings, TeamFlatOffset 2294 | IniWrite, %OverlayCharLim%, %Path%, Settings, OverlayCharLim 2295 | IniWrite, %LabelsON%, %Path%, Settings, LabelsON 2296 | IniWrite, %LblColor%, %Path%, Settings, LblColor 2297 | IniWrite, %LblFont%, %Path%, Settings, LblFont 2298 | IniWrite, %LblModifier%, %Path%, Settings, LblModifier 2299 | IniWrite, %LblArrow%, %Path%, Settings, LblArrow 2300 | } 2301 | } 2302 | } 2303 | 2304 | CreateWordBank(num,xbank,ybank) 2305 | { 2306 | global 2307 | ;calculations 2308 | xBankNeedle := xbank 2309 | wBankNeedle := 75 2310 | yBankNeedle := ybank + 7 2311 | xBankOptions := xBankNeedle + wBankNeedle + 10 2312 | wBankOptions := 380 2313 | yBankOptions := ybank 2314 | xBankType := xBankOptions + wBankOptions + 10 2315 | wBankType := 100 2316 | yBankType := ybank + 7 2317 | InitialBankNeedle := BankNeedle%num% 2318 | InitialBankOptions := BankOptions%num% 2319 | InitialBankType := WordBankSelectType%num% 2320 | ; 2321 | Gui, Add, Edit, r1 w%wBankNeedle% x%xBankNeedle% y%yBankNeedle% vBankNeedle%num% Left, %InitialBankNeedle% 2322 | Gui, Add, Edit, r2 w%wBankOptions% x%xBankOptions% y%yBankOptions% vBankOptions%num% VScroll Left, %InitialBankOptions% 2323 | Gui, Add, DropDownList, vWordBankSelectType%num% x%xBankType% y%yBankType% w%wBankType% Choose%InitialBankType% AltSubmit, Random|No Repeats|In Order 2324 | } 2325 | 2326 | CreateSection(Menu, xsection, ysection) 2327 | { 2328 | global 2329 | ;----------Section Start----------- 2330 | ;calculations 2331 | xSymbol := xsection 2332 | xMsg := xSymbol + SymbolLength + xSpacing 2333 | xTeam := xMsg + MsgLength + xSpacing 2334 | xTeamLabel := xTeam - TeamLabelOffset 2335 | ypos := ysection + LabelsOffset 2336 | ySymbol := ypos + ySymbolOffset + 2 2337 | yTeam := ypos + yTeamOffset 2338 | yLabels := ysection 2339 | 2340 | ;labels 2341 | Gui, Add, Text, w%MsgLength% x%xMsg% y%yLabels% Center, Chat Message 2342 | Gui, Add, Text, w%TeamLength% x%xTeamLabel% y%yLabels%, Team? 2343 | 2344 | Dir = Up 2345 | Selection = %Menu%%Dir% 2346 | Symbol := Symbol%Dir% 2347 | InitialCheckState := Team%Menu%%Dir% 2348 | InitialEditState := %Menu%%Dir% 2349 | Gui, Add, Text, w%SymbolLength% x%xSymbol% y%ySymbol% vGuiSymbol%Menu%%Dir% Right, %Symbol% 2350 | Gui, Add, Checkbox, vTeam%Selection% r1 w%TeamLength% x%xTeam% y%yTeam% Checked%InitialCheckState% 2351 | Gui, Add, Edit, v%Selection% r1 w%MsgLength% x%xMsg% y%ypos% Limit%MaxMsgLength%, %InitialEditState% 2352 | ypos := ypos + TextHeight + ySpacing 2353 | ySymbol := ypos + ySymbolOffset 2354 | yTeam := ypos + yTeamOffset 2355 | %Menu%%Dir%_TT:=Default%Menu%%Dir% 2356 | 2357 | Dir = Left 2358 | Selection = %Menu%%Dir% 2359 | Symbol := Symbol%Dir% 2360 | InitialCheckState := Team%Menu%%Dir% 2361 | InitialEditState := %Menu%%Dir% 2362 | Gui, Add, Text, w%SymbolLength% x%xSymbol% y%ySymbol% vGuiSymbol%Menu%%Dir% Right, %Symbol% 2363 | Gui, Add, Checkbox, vTeam%Selection% r1 w%TeamLength% x%xTeam% y%yTeam% Checked%InitialCheckState% 2364 | Gui, Add, Edit, v%Selection% r1 w%MsgLength% x%xMsg% y%ypos% Limit%MaxMsgLength%, %InitialEditState% 2365 | ypos := ypos + TextHeight + ySpacing 2366 | ySymbol := ypos + ySymbolOffset 2367 | yTeam := ypos + yTeamOffset 2368 | %Menu%%Dir%_TT:=Default%Menu%%Dir% 2369 | 2370 | Dir = Right 2371 | Selection = %Menu%%Dir% 2372 | Symbol := Symbol%Dir% 2373 | InitialCheckState := Team%Menu%%Dir% 2374 | InitialEditState := %Menu%%Dir% 2375 | Gui, Add, Text, w%SymbolLength% x%xSymbol% y%ySymbol% vGuiSymbol%Menu%%Dir% Right, %Symbol% 2376 | Gui, Add, Checkbox, vTeam%Selection% r1 w%TeamLength% x%xTeam% y%yTeam% Checked%InitialCheckState% 2377 | Gui, Add, Edit, v%Selection% r1 w%MsgLength% x%xMsg% y%ypos% Limit%MaxMsgLength%, %InitialEditState% 2378 | ypos := ypos + TextHeight + ySpacing 2379 | ySymbol := ypos + ySymbolOffset 2380 | yTeam := ypos + yTeamOffset 2381 | %Menu%%Dir%_TT:=Default%Menu%%Dir% 2382 | 2383 | Dir = Down 2384 | Selection = %Menu%%Dir% 2385 | Symbol := Symbol%Dir% 2386 | InitialCheckState := Team%Menu%%Dir% 2387 | InitialEditState := %Menu%%Dir% 2388 | Gui, Add, Text, w%SymbolLength% x%xSymbol% y%ySymbol% vGuiSymbol%Menu%%Dir% Right, %Symbol% 2389 | Gui, Add, Checkbox, vTeam%Selection% r1 w%TeamLength% x%xTeam% y%yTeam% Checked%InitialCheckState% 2390 | Gui, Add, Edit, v%Selection% r1 w%MsgLength% x%xMsg% y%ypos% Limit%MaxMsgLength%, %InitialEditState% 2391 | ypos := ypos + TextHeight + ySpacing 2392 | ySymbol := ypos + ySymbolOffset 2393 | yTeam := ypos + yTeamOffset 2394 | %Menu%%Dir%_TT:=Default%Menu%%Dir% 2395 | 2396 | Dir = Hold 2397 | Selection = %Menu%%Dir% 2398 | Symbol := Symbol%Dir% 2399 | InitialCheckState := Team%Menu%%Dir% 2400 | InitialEditState := %Menu%%Dir% 2401 | Gui, Add, Text, w%SymbolLength% x%xSymbol% y%ySymbol% vGuiSymbol%Menu%%Dir% Right, %Symbol% 2402 | Gui, Add, Checkbox, vTeam%Selection% r1 w%TeamLength% x%xTeam% y%yTeam% Checked%InitialCheckState% 2403 | Gui, Add, Edit, v%Selection% r1 w%MsgLength% x%xMsg% y%ypos% Limit%MaxMsgLength%, %InitialEditState% 2404 | ypos := ypos + TextHeight + ySpacing 2405 | ySymbol := ypos + ySymbolOffset 2406 | yTeam := ypos + yTeamOffset 2407 | %Menu%%Dir%_TT:=Default%Menu%%Dir% 2408 | ;---------------END OF SECTION---------- 2409 | } 2410 | 2411 | Hex(Input) 2412 | { 2413 | OldFormat := A_FormatInteger ; save the current format as a string 2414 | Input := Floor(Input) 2415 | SetFormat, Integer, Hex 2416 | Input += 0 ;forces number into current fomatinteger 2417 | 2418 | StringTrimLeft, Input, Input, 2 2419 | 2420 | SetFormat, Integer, %OldFormat% ;if oldformat was either "hex" or "dec" it will restore it to it's previous setting 2421 | SetFormat, Float, 0.3 2422 | 2423 | Return Input 2424 | } 2425 | 2426 | GetJoyButton(Timeout, TimeoutMsg:=0) ;Must connect first 2427 | { 2428 | global 2429 | local StartTime := A_TickCount 2430 | local ButtonState 2431 | Loop { 2432 | Loop %joy_buttons% { 2433 | GetKeyState, ButtonState, %JoystickNumber%joy%a_index% 2434 | if ButtonState = D 2435 | Return %a_index% 2436 | } 2437 | If (Timeout < (A_TickCount - StartTime)) 2438 | Break 2439 | } 2440 | If TimeoutMsg = 1 2441 | MsgBox,8192,Sorry!, No controller button input recieved 2442 | } 2443 | 2444 | 2445 | WM_MOUSEMOVE() 2446 | { 2447 | static CurrControl, PrevControl, _TT 2448 | CurrControl := A_GuiControl 2449 | 2450 | If (CurrControl <> PrevControl and not InStr(CurrControl, " ")) 2451 | { 2452 | ToolTip ; Turn off any previous tooltip. 2453 | SetTimer, DisplayToolTip, 500 2454 | PrevControl := CurrControl 2455 | } 2456 | return 2457 | 2458 | DisplayToolTip: 2459 | SetTimer, DisplayToolTip, Off 2460 | ToolTip % %CurrControl%_TT ; The leading percent sign tell it to use an expression. 2461 | SetTimer, RemoveToolTip, 4000 2462 | return 2463 | 2464 | RemoveToolTip: 2465 | SetTimer, RemoveToolTip, Off 2466 | ToolTip 2467 | return 2468 | } 2469 | 2470 | SaveSettings(Input) 2471 | { 2472 | global 2473 | 2474 | RootDir := Saved%Input%Folder 2475 | FileSelectFile, SavePath, S17, %RootDir%\, Save Settings 2476 | SaveIni(Input, SavePath) 2477 | } 2478 | 2479 | LoadSettings(Input) 2480 | { 2481 | global 2482 | 2483 | RootDir := Saved%Input%Folder 2484 | FileSelectFile, LoadPath, 3, %RootDir%\, Load Settings 2485 | LoadIni(Input, LoadPath) 2486 | 2487 | If Input=Messages 2488 | { 2489 | Menu = Up 2490 | 2491 | Dir = Up 2492 | Selection = %Menu%%Dir% 2493 | Msg:=%Selection% 2494 | Team:= Team%Selection% 2495 | GuiControl, , %Selection%, %Msg% 2496 | GuiControl, , Team%Selection%, %Team% 2497 | Dir = Left 2498 | Selection = %Menu%%Dir% 2499 | Msg:=%Selection% 2500 | Team:= Team%Selection% 2501 | GuiControl, , %Selection%, %Msg% 2502 | GuiControl, , Team%Selection%, %Team% 2503 | Dir = Right 2504 | Selection = %Menu%%Dir% 2505 | Msg:=%Selection% 2506 | Team:= Team%Selection% 2507 | GuiControl, , %Selection%, %Msg% 2508 | GuiControl, , Team%Selection%, %Team% 2509 | Dir = Down 2510 | Selection = %Menu%%Dir% 2511 | Msg:=%Selection% 2512 | Team:= Team%Selection% 2513 | GuiControl, , %Selection%, %Msg% 2514 | GuiControl, , Team%Selection%, %Team% 2515 | Dir = Hold 2516 | Selection = %Menu%%Dir% 2517 | Msg:=%Selection% 2518 | Team:= Team%Selection% 2519 | GuiControl, , %Selection%, %Msg% 2520 | GuiControl, , Team%Selection%, %Team% 2521 | 2522 | Menu = Left 2523 | 2524 | Dir = Up 2525 | Selection = %Menu%%Dir% 2526 | Msg:=%Selection% 2527 | Team:= Team%Selection% 2528 | GuiControl, , %Selection%, %Msg% 2529 | GuiControl, , Team%Selection%, %Team% 2530 | Dir = Left 2531 | Selection = %Menu%%Dir% 2532 | Msg:=%Selection% 2533 | Team:= Team%Selection% 2534 | GuiControl, , %Selection%, %Msg% 2535 | GuiControl, , Team%Selection%, %Team% 2536 | Dir = Right 2537 | Selection = %Menu%%Dir% 2538 | Msg:=%Selection% 2539 | Team:= Team%Selection% 2540 | GuiControl, , %Selection%, %Msg% 2541 | GuiControl, , Team%Selection%, %Team% 2542 | Dir = Down 2543 | Selection = %Menu%%Dir% 2544 | Msg:=%Selection% 2545 | Team:= Team%Selection% 2546 | GuiControl, , %Selection%, %Msg% 2547 | GuiControl, , Team%Selection%, %Team% 2548 | Dir = Hold 2549 | Selection = %Menu%%Dir% 2550 | Msg:=%Selection% 2551 | Team:= Team%Selection% 2552 | GuiControl, , %Selection%, %Msg% 2553 | GuiControl, , Team%Selection%, %Team% 2554 | 2555 | Menu = Right 2556 | 2557 | Dir = Up 2558 | Selection = %Menu%%Dir% 2559 | Msg:=%Selection% 2560 | Team:= Team%Selection% 2561 | GuiControl, , %Selection%, %Msg% 2562 | GuiControl, , Team%Selection%, %Team% 2563 | Dir = Left 2564 | Selection = %Menu%%Dir% 2565 | Msg:=%Selection% 2566 | Team:= Team%Selection% 2567 | GuiControl, , %Selection%, %Msg% 2568 | GuiControl, , Team%Selection%, %Team% 2569 | Dir = Right 2570 | Selection = %Menu%%Dir% 2571 | Msg:=%Selection% 2572 | Team:= Team%Selection% 2573 | GuiControl, , %Selection%, %Msg% 2574 | GuiControl, , Team%Selection%, %Team% 2575 | Dir = Down 2576 | Selection = %Menu%%Dir% 2577 | Msg:=%Selection% 2578 | Team:= Team%Selection% 2579 | GuiControl, , %Selection%, %Msg% 2580 | GuiControl, , Team%Selection%, %Team% 2581 | Dir = Hold 2582 | Selection = %Menu%%Dir% 2583 | Msg:=%Selection% 2584 | Team:= Team%Selection% 2585 | GuiControl, , %Selection%, %Msg% 2586 | GuiControl, , Team%Selection%, %Team% 2587 | 2588 | Menu = Down 2589 | 2590 | Dir = Up 2591 | Selection = %Menu%%Dir% 2592 | Msg:=%Selection% 2593 | Team:= Team%Selection% 2594 | GuiControl, , %Selection%, %Msg% 2595 | GuiControl, , Team%Selection%, %Team% 2596 | Dir = Left 2597 | Selection = %Menu%%Dir% 2598 | Msg:=%Selection% 2599 | Team:= Team%Selection% 2600 | GuiControl, , %Selection%, %Msg% 2601 | GuiControl, , Team%Selection%, %Team% 2602 | Dir = Right 2603 | Selection = %Menu%%Dir% 2604 | Msg:=%Selection% 2605 | Team:= Team%Selection% 2606 | GuiControl, , %Selection%, %Msg% 2607 | GuiControl, , Team%Selection%, %Team% 2608 | Dir = Down 2609 | Selection = %Menu%%Dir% 2610 | Msg:=%Selection% 2611 | Team:= Team%Selection% 2612 | GuiControl, , %Selection%, %Msg% 2613 | GuiControl, , Team%Selection%, %Team% 2614 | Dir = Hold 2615 | Selection = %Menu%%Dir% 2616 | Msg:=%Selection% 2617 | Team:= Team%Selection% 2618 | GuiControl, , %Selection%, %Msg% 2619 | GuiControl, , Team%Selection%, %Team% 2620 | 2621 | Loop %NumberOfWordBanks% 2622 | { 2623 | TempNeedle := BankNeedle%A_Index% 2624 | TempOptions := BankOptions%A_Index% 2625 | TempType := WordBankSelectType%A_Index% 2626 | GuiControl, , BankNeedle%A_Index% , %TempNeedle% 2627 | GuiControl, , BankOptions%A_Index%, %TempOptions% 2628 | GuiControl, Choose, WordBankSelectType%A_Index%, %TempType% 2629 | } 2630 | 2631 | } 2632 | 2633 | If Input=Overlay 2634 | { 2635 | GuiControl,, OverlayX, %OverlayX% 2636 | GuiControl,, OverlayY, %OverlayY% 2637 | GuiControl,, FontSize, %FontSize% 2638 | GuiControl,, BgColor, %BgColor% 2639 | GuiControl,, BgOpac, %BgOpac% 2640 | GuiControl,, BgWidth, %BgWidth% 2641 | GuiControl,, MenuTimerON, %MenuTimerON% 2642 | GuiControl,, MsgColor, %MsgColor% 2643 | GuiControl,, MsgFont, %MsgFont% 2644 | UpdateFontDisplay("Msg") 2645 | GuiControl,Choose, MsgModifier, %MsgModifier% 2646 | GuiControl,, TeamColor, %TeamColor% 2647 | GuiControl,, TeamFont, %TeamFont% 2648 | UpdateFontDisplay("Team") 2649 | GuiControl,Choose,TeamModifier, %TeamModifier% 2650 | GuiControl,,TeamFlatOffset, %TeamFlatOffset% 2651 | GuiControl,,OverlayCharLim, %OverlayCharLim% 2652 | GuiControl,, LabelsON, %LabelsON% 2653 | GuiControl,, LblColor, %LblColor% 2654 | GuiControl,, LblFont, %LblFont% 2655 | UpdateFontDisplay("Lbl") 2656 | GuiControl,Choose, LblModifier, %LblModifier% 2657 | GuiControl,Choose, LblArrow, %LblArrow% 2658 | } 2659 | 2660 | } 2661 | 2662 | WM_LButtonDBLCLK() { 2663 | global 2664 | MouseGetPos,,,,DBLCLKhwnd, 2 2665 | GuiControlGet, DBLCLKvar,Name,%DBLCLKhwnd% 2666 | DBLCLKlabel := %DBLCLKvar%_DblClk 2667 | If DBLCLKlabel <> 2668 | { 2669 | gosub %DBLCLKlabel% 2670 | } 2671 | 2672 | } 2673 | 2674 | CmnDlg_Color(ByRef pColor, hGui=0){ 2675 | ;covert from rgb 2676 | clr := ((pColor & 0xFF) << 16) + (pColor & 0xFF00) + ((pColor >> 16) & 0xFF) 2677 | 2678 | VarSetCapacity(sCHOOSECOLOR, 0x24, 0) 2679 | VarSetCapacity(aChooseColor, 64, 0) 2680 | 2681 | NumPut(0x24, sCHOOSECOLOR, 0) ; DWORD lStructSize 2682 | NumPut(hGui, sCHOOSECOLOR, 4) ; HWND hwndOwner (makes dialog "modal"). 2683 | NumPut(clr, sCHOOSECOLOR, 12) ; clr.rgbResult 2684 | NumPut(&aChooseColor,sCHOOSECOLOR, 16) ; COLORREF *lpCustColors 2685 | NumPut(0x00000103, sCHOOSECOLOR, 20) ; Flag: CC_ANYCOLOR || CC_RGBINIT 2686 | 2687 | nRC := DllCall("comdlg32\ChooseColorA", str, sCHOOSECOLOR) ; Display the dialog. 2688 | if (errorlevel <> 0) || (nRC = 0) 2689 | return false 2690 | 2691 | 2692 | clr := NumGet(sCHOOSECOLOR, 12) 2693 | 2694 | SetFormat, integer, hex ; Show RGB color extracted below in hex format. 2695 | 2696 | ;convert to rgb 2697 | pColor := (clr & 0xff00) + ((clr & 0xff0000) >> 16) + ((clr & 0xff) << 16) 2698 | StringTrimLeft, pColor, pColor, 2 2699 | loop, % 6-strlen(pColor) 2700 | pColor=0%pColor% 2701 | pColor=0x%pColor% 2702 | SetFormat, Float, 0.3 2703 | 2704 | return true 2705 | } 2706 | 2707 | InGameCheck: 2708 | If ((A_TickCount - LastInGameCheck) < InGameCheckPeriod) 2709 | Return 2710 | WinGet, CurrentProcess, ProcessName, A 2711 | Process, Exist, %RLProcess% 2712 | RLPID := ErrorLevel 2713 | PrevInGame := InGame 2714 | InGame := False 2715 | 2716 | If (RLPID <> 0) and (CurrentProcess = RLProcess) ;Return if process does not exist 2717 | { 2718 | RunWait %comspec% /c Netstat -ano | findstr %RLPID% | findstr UDP >"%PortCheckPath%"",, Hide 2719 | Loop, read, %PortCheckPath% 2720 | { 2721 | Loop, parse, A_LoopReadLine, : 2722 | { 2723 | 2724 | If A_index = 2 2725 | { 2726 | Loop, parse, A_LoopField, %A_Space% 2727 | { 2728 | Port = %A_LoopField% 2729 | break 2730 | } 2731 | break 2732 | } 2733 | } 2734 | If Port not in %SteamPortList% 2735 | { 2736 | If (PrevInGame = 0) 2737 | { 2738 | CurrMenu = None 2739 | If (QuickChatType= "Keyboard") 2740 | { 2741 | If ChatMode <> 0 2742 | { 2743 | GoSub EnableQuickChatHotkeys 2744 | } 2745 | GoSub EnableTypedChatHotkeys 2746 | If ToggleChatKey <> 2747 | Hotkey, *$%ToggleChatKey%, ToggleChatMode, On 2748 | } 2749 | } 2750 | InGame := True 2751 | break 2752 | } 2753 | } 2754 | } 2755 | 2756 | If (InGame = 0) and (QuickChatType= "Keyboard") 2757 | { 2758 | GoSub DisableQuickChatHotkeys 2759 | GoSub DisableTypedChatHotkeys 2760 | If ToggleChatKey <> 2761 | Hotkey, *$%ToggleChatKey%, ToggleChatMode, Off 2762 | } 2763 | 2764 | 2765 | LastInGameCheck := A_TickCount 2766 | 2767 | If (OverlayON = 1) 2768 | { 2769 | If (InGame = True) 2770 | { 2771 | If (OverlayInitialized = 0) 2772 | { 2773 | OverlayInit() 2774 | } 2775 | } 2776 | Else If (OverlayInitialized = 1) 2777 | { 2778 | DestroyAllVisual() 2779 | OverlayInitialized = 0 2780 | } 2781 | } 2782 | 2783 | Return 2784 | 2785 | OpenRLButton: 2786 | GoSub OpenRocketLeague 2787 | If ErrorLevel != 0 2788 | WinActivate, ahk_pid %ErrorLevel% 2789 | Return 2790 | 2791 | OpenRocketLeague: 2792 | Process, Exist, %RLProcess% 2793 | If ErrorLevel = 0 2794 | Run steam://rungameid/252950 2795 | Return 2796 | 2797 | GuiClose: 2798 | Gui, Submit, NoHide 2799 | SaveIni("All",IniPath) 2800 | exitapp 2801 | --------------------------------------------------------------------------------