Advertisement
Grubb

Script request 3

Feb 26th, 2020
986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.08 KB | None | 0 0
  1.  
  2. //==============================================================================
  3. /* DESTINY - Warlock Fun Pack
  4. //------------------------------------------------------------------------------
  5.  
  6. This is the most fully-featured script available for Destiny's Warlock class. Hunter and Titan scripts have been published separately.
  7.  
  8. Credits: Authored by antithesis for the Console Tuner forums - www.consoletuner.com/forum/
  9. Thanks to The_Rabid_Taco for the Anti-Recoil and Toggle functions butchered for this script.
  10. Thanks also to Bonefisher for answering all of my stupid questions.
  11. Thanks most of all to J2Kbr for creating Titan One - you've made console gaming fun again!
  12. Not to mention the various anonymous authors for random snippets refactored to work with
  13. this script. You are gone Guardian, but not forgotten :salute:
  14.  
  15. Version: 1.9.3 - Experimental change to anti-recoil to improve tracking of strafing targets, or to stay on-target while strafing
  16. - Added xenologger's input saturation to dampen anti-recoil for strafing targets
  17.  
  18. 1.9.2 - Changed data type for anti-recoil declarations from define to int to allow for negative X & Y axis values
  19. - Added Y-Axis anti-recoil inversion option. Enable in ANTI-RECOIL declarations
  20.  
  21. 1.9.1 - Increased PVAR range to use all of the 16-bit range for the persistent toggles to save & restore correctly
  22.  
  23. 1.9 - Shotgun auto-melee follow-up is now reliable. New define added for NoScopeWait in AUTO-MELEE section to allow customisation
  24. - 500ms SPRINT block added to Auto-sprint to allow SHOOT to trigger while SPRINT is active. Shotgun rushing with auto-melee is now possible without a slide
  25. - Version number changed to 1.9 to match Titan and Hunter Fun Packs to minimise end-user confusion
  26.  
  27. Date: Thursday October 6, 2016
  28.  
  29. Device: Titan One
  30. System: PS4 and XB1
  31. Controller: DualShock 4, XB1 controller, XB1 Elite, Scuf, Xim4 with m/kb or Nav/kb
  32.  
  33. Support: https://www.consoletuner.com/forum/viewtopic.php?f=6&t=5981
  34.  
  35. //==============================================================================
  36. // COPYRIGHT
  37.  
  38. 2016 antithesis from http://www.consoletuner.com. This Script was made and intended for http://www.Consoletuner.com & Titan 0ne ONLY,
  39. UNLESS written permission is given by the creator and/or copywritee.
  40. All rights reserved. This material may not be reproduced, displayed, modified or distributed without the express prior written permission
  41. of the copyright holder. For permission, contact antithesis via http://www.consoletuner.com/forum
  42.  
  43. //------------------------------------------------------------------------------
  44. // FEATURES
  45.  
  46. Weapon Tracking: LED lights indicate Primary (green LED), Special (red LED) and Heavy (Yellow LED) weapons
  47. Primary and Special weapons have separate rapid-fire, rapid-reload, quick-scope ADS, quick-scope SHOOT, and weapon-swap settings
  48. Primary and Special have separate anti-recoil modes, for both HIP and ADS
  49. Quickly reset Weapon Tracking for Primary, Special or Heavy if tracking comes unstuck
  50.  
  51. Rapid-Fire: Separate Primary and Special ON/OFF rapid-fire modes
  52. Includes SHOOT hold and SHOOT rest times for Primary and Special in both HIP and ADS, allowing fine control over fire-rates
  53. Works with all weapons, including Fusion Rifles and can improve the ADS fire-rate of Automatic Rifles in Focused Fire mode including Suros Regime
  54.  
  55. Anti-Recoil: Primary and Special left, right and vertical anti-recoil, with separate HIP and ADS modes
  56. Anti-recoil supports Xim 4 and MaxAim, as well as controllers
  57.  
  58. Trick Shots: No-scope, quick-scope, weapon-swap no-scope and weapon-swap quick-scope
  59. Primary and Special weapons feature separate SWAP, ADS and SHOOT speeds for flexible load-outs
  60.  
  61. Auto-Melee: Rapid-MELEE, and auto-MELEE after Special Weapon SHOOT, if moving forward or backwards
  62. Hold MELEE to rapid-melee
  63.  
  64. Auto-Sprint: Get your SPRINT going without wearing out your thumb bones
  65. Hold left stick forward to auto-sprint. Reload and Rapid-reload friendly
  66.  
  67. Tighter Turns: Increased sensitivity for faster turning while sprinting
  68.  
  69. Sniper Mode: Reduced sensitivity while ADS for improved accuracy and experimenting with Aim Assist lock-on
  70.  
  71. Super Mode: Disables Rapid-fire to prevent interference with Stormtrance
  72. Click ADS after Super has finished to re-enable Rapid-fire, if previously enabled
  73.  
  74. Auto-Revive: Aim and SHOOT while reviving your fireteam
  75. Press D-PAD DOWN to Revive
  76.  
  77. Rapid-Reload: Speed up RELOAD, or take advantage of the Final Round weapon perk by popping only one round in the chamber
  78. Separate Primary and Special weapon RELOAD speeds. Auto-sprint friendly
  79. Does not disrupt normal RELOAD while stationary, or if Auto-sprint is disabled
  80.  
  81. No Land Beyond: Triple the RELOAD speed and fire-rate, when NLB has reserve ammo
  82. Rumble on cooldown between shots when NLB has no reserve amno
  83.  
  84. Jumper Layout: Swap to Jumper button layout for improved Jump and Shadestep control. It's what the pros use. Be a pro
  85.  
  86. Menu Friendly: Disables all combos when accessing Menus via OPTIONS button
  87.  
  88. Persistent Toggles: Customise your game by turning on only the stuff you want to use, with rumble feedback on activation
  89. Set and forget with toggle ON/OFF states that are saved to Titan One, or change them on-the-fly
  90.  
  91. Make New Friends: Guardians everywhere will think you're a swell guy with high emotional IQ thanks to all the Dancing, Waving and Pointing you'll be doing
  92.  
  93. Make New Enemies: Opposing Guardians will try to rip you a new one for outplaying them with your mad uber-Warlock skillz
  94.  
  95.  
  96. //------------------------------------------------------------------------------
  97. // CONTROLLER TOGGLES
  98.  
  99.  
  100. - Weapon Tracking Reset R3 (Default), or D-PAD LEFT (Jumper)
  101.  
  102.  
  103. // Hold D-PAD UP, click button to the right
  104.  
  105. - Primary Rapid-fire D-PAD UP + PS4 R2 / XB1 RT, while holding Primary weapon (green LED)
  106. - Special Rapid-fire D-PAD UP + PS4 R2 / XB1 RT, while holding Special weapon (red LED)
  107. - Rapid-reload D-PAD UP + PS4 SQUARE / XB1 X
  108. - Super Mode D-PAD UP + PS4 CIRCLE / XB1 B
  109. - Auto-melee D-PAD UP + PS4 R1 / XB1 RB
  110. - Anti-recoil D-PAD UP + PS4 L2 / XB1 LT
  111. - Auto-sprint D-PAD UP + PS4 L3 / XB1 LS
  112. - Auto-revive D-PAD UP + PS4 R3 / XB1 RS
  113.  
  114.  
  115.  
  116. // Hold D-PAD RIGHT, click button to the right
  117.  
  118. - No Land Beyond D-PAD RIGHT + PS4 SQUARE / XB1 X
  119. - No-scope D-PAD RIGHT + PS R2 / XB1 RT
  120. - Quick-scope D-PAD RIGHT + PS4 L2 / XB1 LT
  121. - Weapon-swap scope-shots D-PAD RIGHT + PS4 R1 / XB1 RB
  122. - Jumper Layout D-PAD RIGHT + PS4 R3 / XB1 R3
  123.  
  124.  
  125. //------------------------------------------------------------------------------
  126. // INSTRUCTIONS
  127.  
  128. - All toggles are stored on the Titan One and are disabled by default
  129. - IMPORTANT: When using the OPTIONS menu, all mods are disabled to prevent stupid stuff, like auto-dismantling and rapid-fire purchases
  130. It's possible to spawn into a map in this state, pressing CROUCH, ADS or SHOOT while in-game will re-enable all mods
  131.  
  132. - Toggle everything you want turned on, they'll save automatically to the Titan One
  133. - No-scope and Quick-scope trick shots integrate with Auto-melee. Enable both to
  134. perform actions like MELEE after SHOOT
  135. - Rapid-reload integrates with Auto-sprint. Enable both for Rapid-reload to function
  136.  
  137. - Once the initial setup is complete, the only toggles that will be used on a
  138. regular basis are Primary & Special Rapid-fire, and maybe No Land Beyond and Auto-revive,
  139. depending on your load-out and game mode
  140.  
  141. - Disable Anti-recoil and leave Rapid-fire Hold and Wait times at 50 if frequently changing load-outs mid-game
  142. Disable weapon-swap scope-shots for competitive 3v3 PvP (changes double-ADS behaviour)
  143. Enable auto-revive only for competitive 3v3 PvP
  144.  
  145. - R3 (or D-Pad Left on Jumper) will see regular use to reset errant weapon flags
  146. There's a lot of conditional code to eliminate flag swaps, but they rely on presses
  147. of CHANGE WEAPON and/or R3 / D-Pad Left rather than in-game tracking, so they can come unstuck
  148. A quick R3 / D-pad Left press will get them back on-track
  149.  
  150. - Primary & Special weapons fire-rates, anti-recoil settings for HIP & ADS,
  151. weapon swap time (important for ShotGuns), shoot hold times (important for Fusion Rifles),
  152. ADS hold times (important for Snipers), reload times and auto-melee times
  153. are customisable below in DECLARATIONS, as is auto-revive (time depends on gear) and Sniper Mode
  154.  
  155. - The script is documented throughout. Read the green notes in each section to understand
  156. their function and use that information to experiment with your weapon load-outs
  157.  
  158. - Given the suite of customisation options, this script is targeted at those looking to fine-tune
  159. their settings to match specific load-outs. Instead of constantly copying files across to the Titan One
  160. and rebooting do the following -
  161.  
  162. 1. Connect Titan One to PC and transfer this script to a spare slot
  163. 2. Enable all toggles you want turned on on a regular basis
  164. NOTE - this is important to get persistent toggles to set correctly when using Build and Run
  165. 3. Connect Titan One to both PC and console
  166. 4. Load up GTuner Pro, go to the Compiler tab and open this file
  167. 5. Edit ONLY the red numbers values in DECLARATIONS to tweak the script to your load-out
  168. 6. Use the Build and Run option to test the settings in-game
  169. 7. Repeat steps 5 and 6 until everything feels right
  170.  
  171. - Comments (green text following "//") are unlimited in a GPC script, so make note of your
  172. custom settings for future reference and punch them in when swapping load-outs. Create multiple copies
  173. of this file tweaked to custom load-outs and swap between them using Titan One slots
  174.  
  175. */
  176.  
  177. //==============================================================================
  178. // DECLARATIONS
  179.  
  180. //------------------------------------------------------------------------------
  181. // DEFAULT CONTROLLER LAYOUT
  182.  
  183. /* Default Layout should be fine for mouse & keyboard, Scuf or XB1 Elite controllers
  184.  
  185. - Do NOT rename any of the define aliases (e.g HOME, SHARE etc) or the script will break
  186. All aliases work for all supported platforms
  187.  
  188. - Do NOT edit the red values below, unless you REALLY know what you're doing, for example
  189. remapping ADS and SHOOT from L2 / R2 to L1 / R1
  190.  
  191. - Do NOT uncomment the defines for MELEE, FLAG_RESET, GRENADE, DPAD_LEFT and JUMP
  192. They have been replaced with Variables, are managed via the Jumper Layout toggle
  193. and are kept here for button mapping reference only
  194.  
  195. !!! NOTE: FLAG_RESET is R3 / RS in Default Layout
  196.  
  197. */
  198.  
  199.  
  200. define HOME = 0; // XB1_XBOX XB360_XBOX PS4_PS PS3_PS
  201. define SHARE = 1; // XB1_VIEW XB360_BACK PS4_SHARE PS3_SELECT
  202. define OPTIONS = 2; // XB1_MENU XB360_START PS4_OPTIONS PS3_START
  203. // define MELEE = 3; // XB1_RB XB360_RB PS4_R1 PS3_R1
  204. define SHOOT = 4; // XB1_RT XB360_RT PS4_R2 PS3_R2
  205. // define FLAG_RESET = 5; // XB1_RS XB360_RS PS4_R3 PS3_R3
  206. // define GRENADE = 6; // XB1_LB XB360_LB PS4_L1 PS3_L1
  207. define ADS = 7; // XB1_LT XB360_LT PS4_L2 PS3_L2
  208. define SPRINT = 8; // XB1_LS XB360_LS PS4_L3 PS3_L3
  209. define RX_AXIS = 9; // XB1_RX XB360_RX PS4_RX PS3_RX
  210. define RY_AXIS = 10; // XB1_RY XB360_RY PS4_RY PS3_RY
  211. define LX_AXIS = 11; // XB1_LX XB360_LX PS4_LX PS3_LX
  212. define LY_AXIS = 12; // XB1_LY XB360_LY PS4_LY PS3_LY
  213. define DPAD_UP = 13; // XB1_UP XB360_UP PS4_UP PS3_UP
  214. define DPAD_DOWN = 14; // XB1_DOWN XB360_DOWN PS4_DOWN PS3_DOWN
  215. // define DPAD_LEFT = 15; // XB1_LEFT XB360_LEFT PS4_LEFT PS3_LEFT
  216. define DPAD_RIGHT = 16; // XB1_RIGHT XB360_RIGHT PS4_RIGHT PS3_RIGHT
  217. define WEAPON_SWAP = 17; // XB1_Y XB360_Y PS4_TRIANGLE PS3_TRIANGLE
  218. define CROUCH = 18; // XB1_B XB360_B PS4_CIRCLE PS3_CIRCLE
  219. // define JUMP = 19; // XB1_A XB360_A PS4_CROSS PS3_CROSS
  220. define RELOAD = 20; // XB1_X XB360_X PS4_SQUARE PS3_SQUARE
  221.  
  222. //------------------------------------------------------------------------------
  223. // JUMPER CONTROLLER LAYOUT
  224.  
  225. /* Jumper is the recommended button layout for competitive PvP
  226.  
  227. Hold D-PAD RIGHT and press R3 / RS to toggle between Default and Jumper
  228.  
  229. Several buttons differ in Destiny's Jumper button layout -
  230.  
  231. 1. D-PAD LEFT (15) = FLAG_RESET
  232. 2. SUPER (19) = [] / X
  233. 3. MELEE (5) = R3 / RS
  234. 4. JUMP (6) = L1 / LB
  235. 5. GRENADE (3) = R1 / RB
  236. 6. HIGHLIGHT = L1 + R1
  237.  
  238. !!! NOTE: FLAG_RESET is D-Pad Left in Jumper Layout
  239.  
  240. */
  241.  
  242. //------------------------------------------------------------------------------
  243. // QUICK-SCOPE
  244.  
  245. define PriScope = 250; // ADS hold time for Primary weapon Quick-scope. e.g 250 for Uni Remote, 700 for No Land Beyond. Perks affect scope speed
  246. define SecScope = 700; // ADS hold time for Special weapon Quick-scope. e.g 250 for primed Plan C or Shotguns, 700+ for Snipers. Perks affect scope speed
  247.  
  248. define PriShoot = 250; // SHOOT hold time for Primary weapon. e.g 250 for all Primaries
  249. define SecShoot = 750; // SHOOT hold time for Special weapon. e.g 250 for Shotguns & Snipers, 350 for primed Plan C, 750 for non-primed Plan C & other Fusion Rifles
  250.  
  251. //------------------------------------------------------------------------------
  252. // WEAPON SWAP NO-SCOPE / QUICK-SCOPE
  253.  
  254. define PriSwap = 300; // Primary weapon swap animation time. Perks affect swap speed
  255. define SecSwap = 300; // Special weapon swap animation time. Perks affect swap speed
  256.  
  257. //------------------------------------------------------------------------------
  258. // AUTO-MELEE
  259.  
  260. define NoScopeWait = 200; // Time to wait before MELEE while Shotgun rushing to force Destiny to SHOOT before MELEE. Do NOT go under 110ms
  261. define ScopeWait = 350; // Time to wait before Melee attack after Quick-scope SHOOT while moving backwards
  262.  
  263. //------------------------------------------------------------------------------
  264. // RAPID-FIRE
  265. /*
  266. - Rounds per minute (RPM) for Destiny weapons can be found at https://docs.google.com/spreadsheets/d/1L7FV9l4hXo2tHD3XlFUp854XvJIwTKFIPvASLduPPS4
  267. - Divide RPM by 60 for rounds per second (RPS)
  268. - Divide 1000 (ms) by RPS, for milliseconds per shot (MPS)
  269. - Divide MPS by 2 to find the approximate SHOOT & WAIT times
  270.  
  271. e.g The Last Word = 225 RPM
  272. 225/60 = 3.75 RPS
  273. 1000/3.75 = 266 MPS
  274. 266/2 = 133 Hold / Rest times
  275.  
  276. - Adjust Hold & Rest times up & down, and/or tweak the balance of Hold & Rest until the weapon feels right
  277. - For greater recoil control (in addition to Anti-recoil), use Hold and Rest values higher than MPS/2
  278. - Set to 0 to disable Rapid-fire for any mode. For example, fire a Suros Regime in automatic for HIP, but semi-automatic for increased ADS Focused Fire fire-rate
  279. */
  280.  
  281. // Primary HIP, Primary ADS, Special HIP and Special ADS following are set to 10 rounds / sec by default (50 Hold +50 Rest = 100 ms)
  282.  
  283. define Pri_HIP_Hold = 50; // Primary weapon hold SHOOT time. Set to 0 to disable Rapid-Fire in HIP mode to allow Suros Regime to fire full-auto from the HIP
  284. define Pri_HIP_Rest = 50; // Primary weapon release SHOOT time
  285.  
  286. define Pri_ADS_Hold = 50; // Primary weapon hold SHOOT time e.g 39 for Suros Regime in Focused Fire mode
  287. define Pri_ADS_Rest = 50; // Primary weapon release SHOOT time e.g 39 for Suros Regime in Focused Fire mode
  288.  
  289. define Sec_HIP_Hold = 50; // Special weapon hold SHOOT time
  290. define Sec_HIP_Rest = 50; // Special weapon release SHOOT time
  291.  
  292. define Sec_ADS_Hold = 50; // Special weapon hold SHOOT time
  293. define Sec_ADS_Rest = 50; // Special weapon release SHOOT time
  294.  
  295.  
  296. //------------------------------------------------------------------------------
  297. // RAPID-RELOAD
  298.  
  299. /* - RELOAD will pause a SPRINT (if active), wait for the pre-defined RELOAD times below, then auto-SPRINT to cancel the RELOAD
  300. - Standing still perform a normal RELOAD, but can be cancelled by pushing the left stick forward to Auto-sprint
  301. - RELOAD wait times vary by weapon. Incorrect timing will prevent the RELOAD
  302. - Reduce wait times to take advantage of the Final Round perk on Shotguns
  303. */
  304.  
  305. define PriReloadWait = 2200; // Time to wait for Primary weapon to reload. e.g 2500 for Shotguns, 2200 for Hand Cannons & 1750 for Pulse Rifles. Use fast reload gauntlets for maximum gain
  306. define SecReloadWait = 2200; // Time to wait for Special weapon to reload. e.g 2500 for Shotguns, 1200 for SideArms & Snipers. Use fast reload gauntlets for maximum gain
  307.  
  308. //------------------------------------------------------------------------------
  309. // ANTI-RECOIL
  310. /*
  311. NOTE: data type changed from define to int to allow negative X & Y axis values
  312. - Use values between -100 to 100 to adjust Left and Right X-axis (horizontal) anti-recoil. Use Left or Right, not both
  313. - Use values between -100 to 100 to adjust Y-axis (vertical) anti-recoil
  314. - Know your weapon recoil patterns before entering a match and don't change the load-out without editing these values
  315. - Enter 0 for no anti-recoil or disable all anti-recoil via D-PAD UP + PS4 L2 / XB1 LT
  316. - Xim4 requires values of 12 or higher for X & Y axes to be noticeable
  317. */
  318. int Pri_Hip_H = 0; // Primary Hip X-axis Horizontal. Range of -100 to 100. Min of 12 to get an AR effect for Xim4
  319. int Pri_Hip_V = 34; // Primary Hip Y-axis Vertical. Range of -100 to 100. Min of to get an AR effect 12 for Xim4
  320.  
  321. int Pri_ADS_H = 0; // Primary ADS X-axis Horizontal. Range of -100 to 100. Min of 12 to get an AR effect for Xim4
  322. int Pri_ADS_V = 34; // Primary ADS Y-axis Vertical. Range of -100 to 100. Min of 12 to get an AR effect for Xim4
  323.  
  324. int Sec_Hip_H = 12; // Special Hip X-axis Horizontal. Range of -100 to 100. Min of 12 to get an AR effect for Xim4
  325. int Sec_Hip_V = 61; // Special Hip Y-axis Vertical. Range of -100 to 100. Min of 12 to get an AR effect for Xim4
  326.  
  327. int Sec_ADS_H = 12; // Special ADS X-axis Horizontal. Range of -100 to 100. Min of 12 to get an AR effect for Xim4
  328. int Sec_ADS_V = 61; // Special ADS Y-axis Vertical. Range of -100 to 100. Min of 12 to get an AR effect for Xim4
  329.  
  330. define Invert_Y = 0; // Change to 1 to invert Y-Axis anti-recoil
  331.  
  332. //------------------------------------------------------------------------------
  333. // AUTO-REVIVE
  334.  
  335. define ReviveTime = 4000; // Adjust if wearing Crest of Alpha Lupi or Light Beyond Nemesis
  336.  
  337. //------------------------------------------------------------------------------
  338. // RUMBLE
  339.  
  340. define RumbleStrength = 60; // Change to 0 to disable rumble
  341.  
  342. //------------------------------------------------------------------------------
  343. // TIGHTER TURNS
  344.  
  345. /* - Increases sensitivity for faster turns while Sprinting. Activates automatically by Sprinting, if toggled on
  346. - Helpful for Shotgunners and Xim 4 / MaxAim users
  347. - TighterTurns values apply a multiplier to right stick X-axis sensitivity, e.g 200 = sensitivity x 2
  348. - MidPoint determines where the effect applies. Use values above 50 for faster external range movement
  349.  
  350. NOTE: Tweak the SprintThreshold to determine where Tighter Turns kicks in on left stick movement
  351. WA & WD keyboard diagonals register at 84% when both are pressed. Normal SPRINT look mechanics are used until only W is pressed
  352. Change SprintThreshold to 85 to enable Tighter Turns for W key presses
  353. WA & WD diagonals will use Tighter Turns unless A or D are pressed before W
  354.  
  355. */
  356.  
  357. define SprintThreshold = 85; // 70 by default. Left stick position before SPRINT auto-enables
  358.  
  359. define TighterTurns = 150; // 200 by default. Range of 0 to 327. Increase to 250 for stupid fast turns
  360. define TT_MidPoint = NOT_USE; // 75 by default. Range of sensitivity (1-100). Set to NOT_USE to apply the effect to the full range of movement
  361.  
  362. //------------------------------------------------------------------------------
  363. // SNIPER MODE
  364.  
  365. /* - Decreases right stick X-axis sensitivity for more accurate aim and experimentally, to enhance Aim Assist lock-on
  366. - SniperMode values apply a multiplier to right stick X & Y sensitivity, e.g 90 = sensitivity x 0.9
  367. - MidPoint determines where the effect applies. Use values below 50 to slow internal range movement
  368.  
  369. NOTE: When aiming down sights (ADS), hold SPRINT to enable Sniper Mode
  370.  
  371. More information on Titan One Sensitivity - http://www.consoletuner.com/kbase/i_o_functions.htm#sensitivity
  372. */
  373.  
  374. define SteadyAim_X = 70; // 70 by default. Range of 0 to 327. Strength of sensitivity. Values under 100 reduce sensitivity. Values above 100 increase sensitivity. Set to 0 to disable
  375. define SA_MidPoint_X = NOT_USE; // 60 by default. Range of 0 to 100. Set to NOT_USE to apply the effect to the full range of movement
  376.  
  377. define SteadyAim_Y = 70; // 70 by default. Range of 0 to 327. Strength of sensitivity. Values under 100 reduce sensitivity. Values above 100 increase sensitivity. Set to 0 to disable
  378. define SA_MidPoint_Y = NOT_USE; // 60 by default. Range of 0 to 100. Set to NOT_USE to apply the effect to the full range of movement
  379.  
  380. //==============================================================================
  381. // LOOK BUT DON'T TOUCH ANYTHING BELOW THIS LINE. YOU BREAK IT, YOU BOUGHT IT!
  382. //==============================================================================
  383.  
  384. //------------------------------------------------------------------------------
  385. // Persistent Vars
  386. define PVAR_ToggleFlags = SPVAR_1;
  387.  
  388.  
  389. //==============================================================================
  390. // VARIABLES
  391.  
  392. //------------------------------------------------------------------------------
  393. // Store toggle states
  394. int ToggleFlags;
  395.  
  396. //------------------------------------------------------------------------------
  397. // Function & Combo Variables
  398.  
  399. int OptionsMenu = 1; // Disables combos for OPTIONS Menu navigation
  400. int NavState;
  401. int ReloadWait;
  402. int MeleeWait;
  403. int RightStick_X = 0;
  404. int RightStick_Y = 0;
  405. int HoldTime, RestTime;
  406. int Timer;
  407. int GunFlags;
  408. int ScopeHold, ShootHold, ScopeSwap;
  409. int FLAG_RESET, MELEE, JUMP, GRENADE, SUPER, DPAD_LEFT;
  410. int SparrowToggle = 0;
  411. int SparrowRide = 0;
  412.  
  413. //==============================================================================
  414. // INITIALISATION
  415.  
  416. init
  417. {
  418. // Set initial Gun Flag state
  419. combo_run(SetPrimary);
  420.  
  421. // Retrieve Toggle States
  422. ToggleFlags = get_pvar(PVAR_ToggleFlags, -32768, 32767, 0);
  423. }
  424.  
  425. //==============================================================================
  426. // MAIN
  427.  
  428. main
  429. {
  430. // Repeat main loop every 4ms. Higher values add to T1 CPU load
  431. vm_tctrl(-6);
  432.  
  433. //------------------------------------------------------------------------------
  434. // BUTTON LAYOUT
  435.  
  436. // Swap to Jumper layout
  437. if (test_bit(ToggleFlags, 13))
  438. { FLAG_RESET = 15; MELEE = 5; JUMP = 6; GRENADE = 3; SUPER = 19; }
  439. else
  440. { DPAD_LEFT = 15; FLAG_RESET = 5; GRENADE = 6; MELEE = 3; JUMP = 19; }
  441.  
  442. //------------------------------------------------------------------------------
  443. // HAIR TRIGGERS
  444.  
  445. // Shoot
  446. if (get_val(SHOOT)) { set_val(SHOOT, 100); }
  447.  
  448. // ADS
  449. if (get_val(ADS)) { set_val(ADS, 100); }
  450.  
  451. //------------------------------------------------------------------------------
  452. // TOGGLES
  453.  
  454. if (get_val(DPAD_UP))
  455.  
  456. // Hold D-PAD UP, click button to the right
  457. /*
  458. - Primary Rapid-fire D-PAD UP + PS4 R2 / XB1 RT, while holding Primary weapon (green LED)
  459. - Special Rapid-fire D-PAD UP + PS4 R2 / XB1 RT, while holding Special weapon (red LED)
  460. - Rapid-reload D-PAD UP + PS4 SQUARE / XB1 X
  461. - Auto-melee D-PAD UP + PS4 R1 / XB1 RB
  462. - Anti-recoil D-PAD UP + PS4 L2 / XB1 LT
  463. - Super mode D-PAD UP + PS4 CIRCLE / XB1 B
  464. - Auto-sprint D-PAD UP + PS4 L3 / XB1 LS
  465. - Auto-revive D-PAD UP + PS4 R3 / XB1 RS
  466. */
  467. {
  468.  
  469. // Equip Primary weapon and check LED is green before toggling Primary rapid-fire (PS4 R2 / XB1 RT)
  470. if(event_press(4) && test_bit (GunFlags, 1)) { SetToggle(2); }
  471.  
  472. // Equip Special weapon and check LED is red before toggling Special rapid-fire (PS4 R2 / XB1 RT)
  473. if(event_press(4) && test_bit (GunFlags, 2)) {SetToggle (3); }
  474.  
  475. // Rapid Reload (PS4 SQUARE / XB1 X)
  476. if(event_press(20)) { SetToggle (4); }
  477.  
  478. //Auto-revive (PS4 R3 / XB1 RS)
  479. if(event_press (5)) { SetToggle (5); }
  480.  
  481. // Super Toggle (PS4 CIRCLE / XB1 B)
  482. if(event_press(18)) { SetToggle (6); }
  483.  
  484. // Auto-melee (PS4 R1 / XB1 RB)
  485. if (event_press (3)) { SetToggle (7); }
  486.  
  487. // Auto-sprint (PS4 L3 / XB1 LS)
  488. if(event_press (8)) { SetToggle (8); }
  489.  
  490. // Anti-recoil (PS4 L2 / XB1 LT)
  491. if (event_press (7)) { SetToggle (9); }
  492. }
  493.  
  494. if (get_val (DPAD_RIGHT))
  495.  
  496. // Hold D-PAD RIGHT, click button to the right
  497. /*
  498. - No Land Beyond D-PAD RIGHT + PS4 SQUARE / XB1 X
  499. - No-scope D-PAD RIGHT + PS R2 / XB1 RT
  500. - Quick-scope D-PAD RIGHT + PS4 L2 / XB1 LT
  501. - Weapon-swap scope-shots D-PAD RIGHT + PS4 R1 / XB1 RB
  502. - Jumper Layout D-PAD RIGHT + PS4 R3 / XB1 R3
  503. */
  504. {
  505.  
  506. // No Scope (PS R2 / XB1 RT)
  507. if (event_press (4)) { SetToggle (10); }
  508.  
  509. // No Land Beyond (PS4 SQUARE / XB1 X)
  510. if (event_press (20)) { SetToggle (11); }
  511.  
  512. // Quick Scope (PS4 L2 / XB1 LT)
  513. if (event_press (7)) { SetToggle (12); }
  514.  
  515. // Jumper Button Layout (PS4 R3 / XB1 RS)
  516. if (event_press (5)) { SetToggle (13); }
  517.  
  518. // Weapon swap no-scope (PS4 R1 / XB1 RB)
  519. if (event_press (3)) { SetToggle (14); }
  520. }
  521.  
  522. //------------------------------------------------------------------------------
  523. // MENU NAVIGATION
  524.  
  525. /* - Using the in-game Menu via OPTIONS disables gun flags to prevent accidental flag swaps when changing load-outs
  526. - It's still possible to spawn into a match with the wrong flag if using SWAP WEAPON in Citadel vendor or Invite Friends menus
  527. - Pressing OPTIONS to Open Character then OPTIONS again to Return to Vendor disables the issue in the Citadel
  528. */
  529.  
  530. if (event_release (OPTIONS))
  531. { OptionsMenu = 0; NavState = 1; }
  532.  
  533. // Pressing CROUCH, ADS or SHOOT to exit Menu re-enables gun flags
  534. if (event_release (CROUCH) || get_val (ADS) || get_val (SHOOT) && NavState)
  535. { OptionsMenu = 1; NavState = 0; }
  536.  
  537. if (OptionsMenu) { // start OptionsMenu
  538.  
  539. //------------------------------------------------------------------------------
  540. // WEAPON TRACKING
  541.  
  542. // Changing weapons automatically updates the gun flags for Primary, Special and Heavy
  543. // Manually reset flags via FLAG_RESET (Default R3, Jumper D-PAD LEFT)
  544.  
  545. // Swap to Primary from Special on Change Weapon tap or R3 / D-PAD LEFT click (sets a green LED)
  546. if ( (test_bit (GunFlags, 2) || test_bit (GunFlags, 5)) && (event_press (WEAPON_SWAP) || event_press (FLAG_RESET)) )
  547. { combo_run (SetPrimary); }
  548.  
  549. //Swap to Special from Primary on change Weapon tap or R3 / D-PAD LEFT click (sets a red LED)
  550. else if ( (test_bit (GunFlags, 1) || test_bit (GunFlags, 4)) && (event_press (WEAPON_SWAP) || event_press (FLAG_RESET)) )
  551. { combo_run (SetSpecial); }
  552.  
  553. // Swap to Heavy from Primary or Special on Change Weapon or R3 / D-PAD LEFT hold (sets a yellow LED)
  554. else if ( (test_bit (GunFlags, 1) || test_bit (GunFlags, 2)) && (event_release (WEAPON_SWAP) && get_ptime (WEAPON_SWAP) > 300) || (event_release (FLAG_RESET) && get_ptime (FLAG_RESET) > 300) )
  555. { combo_run (SetHeavy); }
  556.  
  557. // Swap to Primary from Heavy on Change Weapon tap or hold (sets a green LED)
  558. else if ( test_bit (GunFlags, 3) && (event_release (WEAPON_SWAP) || event_release (FLAG_RESET)) )
  559. { combo_run (SetPrimary); }
  560.  
  561. // Reset Heavy to Primary while waiting for respawn (sets a green LED) if the left and right sticks are not moving
  562. if (test_bit (GunFlags, 3) && !(get_val(RX_AXIS) || get_val (RY_AXIS) || get_val (LX_AXIS) || get_val (LY_AXIS)) && event_release (RELOAD) && get_ptime (RELOAD) < 200 )
  563. { combo_run (SetPrimary); }
  564.  
  565. //------------------------------------------------------------------------------
  566. // SUPERS
  567.  
  568. // D-PAD UP + PS4 CIRCLE / XB1 B
  569. if(test_bit (ToggleFlags, 6))
  570. {
  571. // Disable AutoMelee for Super to prevent disruption to Stormcaller
  572. if ( event_press (GRENADE) && event_press (MELEE) )
  573. {
  574. if (test_bit (GunFlags, 1))
  575. {
  576. clear_bit (GunFlags, 1); set_bit (GunFlags, 4);
  577. combo_stop (AutoMelee); combo_stop (RapidFire);
  578. LED (1,0,1,0);
  579. }
  580.  
  581. else if (test_bit (GunFlags, 2))
  582. {
  583. clear_bit (GunFlags, 2); set_bit (GunFlags, 5);
  584. combo_stop (AutoMelee); combo_stop (RapidFire);
  585. LED (0,0,0,1);
  586. }
  587. }
  588.  
  589. if ( test_bit (GunFlags, 4) && get_val (ADS) && !event_press (WEAPON_SWAP)) { clear_bit (GunFlags, 4); combo_run (SetPrimary); }
  590. else if ( test_bit (GunFlags, 5) && get_val (ADS) && !event_press (WEAPON_SWAP)) { clear_bit (GunFlags, 5); combo_run (SetSpecial); }
  591. }
  592.  
  593. //------------------------------------------------------------------------------
  594. // RAPID-FIRE, ANTI-RECOIL & SENSITIVITY
  595.  
  596. // Hip-fire Settings
  597.  
  598. if (!get_val (ADS))
  599. {
  600. // Primary HIP
  601. if (test_bit(GunFlags, 1))
  602. {
  603. if (get_val (SHOOT))
  604. { if (test_bit (ToggleFlags, 2))
  605. { RapidFireSpeed (Pri_HIP_Hold, Pri_HIP_Rest); } // Rapid-fire
  606. if (test_bit (ToggleFlags, 9))
  607. { AntiRecoil(Pri_Hip_H, Pri_Hip_V); } // Anti-recoil
  608. }
  609. }
  610.  
  611. // Special HIP
  612. if (test_bit(GunFlags, 2) || test_bit (GunFlags, 5))
  613. {
  614. if (get_val (SHOOT))
  615. { if (test_bit (ToggleFlags, 3))
  616. { RapidFireSpeed (Sec_HIP_Hold, Sec_HIP_Rest); } // Rapid-fire
  617. if (test_bit (ToggleFlags, 9))
  618. { AntiRecoil(Sec_Hip_H, Sec_Hip_V); } // Anti-recoil
  619. }
  620. }
  621.  
  622. // Tighter turns
  623. if (get_val (SPRINT))
  624. {sensitivity (RX_AXIS, TT_MidPoint, TighterTurns) }
  625. }
  626.  
  627. // Aim Down Sights Settings
  628.  
  629. if (get_val(ADS))
  630. {
  631. // Primary ADS
  632. if (test_bit(GunFlags, 1))
  633. {
  634. if (get_val (SHOOT))
  635. { if (test_bit (ToggleFlags, 2))
  636. { RapidFireSpeed (Pri_ADS_Hold, Pri_ADS_Rest); } // Rapid-fire
  637. if (test_bit (ToggleFlags, 9))
  638. { AntiRecoil(Pri_ADS_H, Pri_ADS_V); } // Anti-recoil
  639. }
  640. }
  641.  
  642. // Special ADS
  643. if (test_bit(GunFlags, 2) || test_bit (GunFlags, 5))
  644. {
  645. if (get_val (SHOOT))
  646. { if (test_bit (ToggleFlags, 3))
  647. { RapidFireSpeed (Sec_ADS_Hold, Sec_ADS_Rest); } // Rapid-fire
  648. if (test_bit (ToggleFlags, 9))
  649. { AntiRecoil(Sec_ADS_H, Sec_ADS_V); } // Anti-recoil
  650. }
  651. }
  652.  
  653. // Sniper Mode
  654. if (get_val (SPRINT))
  655. { set_val (SPRINT, 0); // prevents SPRINT from breaking ADS if moving forward while in Sniper Mode
  656. sensitivity (RX_AXIS, SA_MidPoint_X, SteadyAim_X);
  657. sensitivity (RY_AXIS, SA_MidPoint_Y, SteadyAim_Y); }
  658. }
  659.  
  660. //------------------------------------------------------------------------------
  661. // AUTO-MELEE
  662.  
  663. // Hold MELEE to Auto-Melee. Also used for no-scope & quick-scope follow-up Melee attacks
  664.  
  665. if ( get_val(MELEE) && test_bit(ToggleFlags, 7))
  666. { combo_run(AutoMelee); }
  667.  
  668. //------------------------------------------------------------------------------
  669. // AUTO-REVIVE
  670.  
  671. // Press D-Pad DOWN to Auto-revive
  672.  
  673. if (get_val (DPAD_DOWN) && test_bit(ToggleFlags, 5))
  674. { combo_run (AutoRevive); }
  675.  
  676. //------------------------------------------------------------------------------
  677. // SPARROW MODE
  678.  
  679. // Prevents Auto-Sprint interference while riding a Sparrow
  680. // Press JUMP or WEAPON SWAP if Auto-Sprint appears to be blocked while not riding a Sparrow
  681.  
  682. if (event_release (PS4_TOUCH) || event_release (XB1_VIEW)) { SparrowToggle = 1; }
  683. if (SparrowToggle && event_release (RELOAD) && get_ptime (RELOAD) > 1000) { SparrowRide = 1; }
  684. if (SparrowRide && event_press (RELOAD) || event_press (JUMP) || event_press (WEAPON_SWAP)) { SparrowToggle = 0; SparrowRide = 0; }
  685.  
  686. //------------------------------------------------------------------------------
  687. // AUTO-SPRINT
  688.  
  689. // Hold left stick forward to SPRINT
  690. // Rapid-reload must be enabled to automatically SPRINT after RELOAD
  691.  
  692. if( get_val(LY_AXIS) < -SprintThreshold && !(get_val(ADS) || get_val(MELEE) || get_val(JUMP) || get_val(SHOOT) || get_val (CROUCH) || SparrowRide) && !(test_bit (GunFlags, 4) || test_bit (GunFlags, 5)) && test_bit (ToggleFlags, 8))
  693. { block (SPRINT, 500); set_val (SPRINT, 100); // Block allows for SHOOT to trigger while SPRINT is active. Needed for No-scope Auto-melee
  694. }
  695.  
  696. //------------------------------------------------------------------------------
  697. // RAPID RELOAD
  698.  
  699. // Rapid Reload reduces reload animation time with a SPRINT animation cancel
  700. // Auto-sprint must be enabled for Rapid Reload to function
  701.  
  702. if (event_press (RELOAD) && test_bit(ToggleFlags, 4)) {combo_run (RapidReload); }
  703.  
  704. //------------------------------------------------------------------------------
  705. // NO LAND BEYOND
  706.  
  707. // RELOAD animation cancel to shorten reload time and increase fire-rate. Requires No Land Beyond sniper rifle
  708. // NLB fire-rate increase does not apply when no reserve ammo is available
  709. // A timer rumbles two seconds after a shot to alert when NLB is ready to fire
  710.  
  711. // Apply NLB combo to Primary weapon (green LED)
  712. if ( test_bit (GunFlags, 1) && test_bit(ToggleFlags, 11))
  713. { if (get_val (SHOOT) )
  714. { combo_run (NLBCooldown); combo_run(NLB); }
  715. }
  716.  
  717. //------------------------------------------------------------------------------
  718. // TRICK SHOTS
  719.  
  720. // NO-SCOPE MELEE - tap SHOOT
  721. // Enable for Shotgunners, disable for Snipers
  722.  
  723. if (test_bit(ToggleFlags, 10) && test_bit(GunFlags, 2))
  724. {
  725. // MELEE after SHOOT while NOT sprinting
  726. if ( event_press (SHOOT) && test_bit(ToggleFlags, 7))
  727. { MeleeWait = NoScopeWait; combo_run (AutoMelee); }
  728. }
  729.  
  730. // QUICK-SCOPE - tap ADS
  731. // Enable for Snipers, disable for Shotgunners
  732.  
  733. if (test_bit(ToggleFlags, 12) && test_bit(GunFlags, 2))
  734. {
  735. if ( event_release (ADS) && get_ptime (ADS) < 200)
  736. {
  737. // ADS quick-scope followed by auto-SHOOT and auto-MELEE if moving backwards (Shotgun counter)
  738. if (get_val (LY_AXIS) > 70 )
  739. { combo_run (QuickScope);
  740. if (test_bit(ToggleFlags, 7)) { MeleeWait = ScopeWait; combo_run (AutoMelee); }
  741. }
  742. // ADS quick-scope only, for strafing in and out of cover
  743. else { combo_run (QuickScope); }
  744. }
  745. }
  746.  
  747. // WEAPON SWAP NO-SCOPE - double-tap ADS to swap weapons and auto no-scope. Disable for competitive 3v3 PvP
  748. // WEAPON SWAP QUICK-SCOPE - hold ADS, tap RELOAD. Keep holding ADS to swap weapons and auto quick-scope
  749.  
  750. if (test_bit(ToggleFlags, 14))
  751. {
  752. if (Timer > 0) { Timer = Timer - get_rtime(); }
  753. if (event_release(ADS)) { Timer = 200; } // 200ms to detect double-ADS tap
  754. if ((event_press(ADS) && Timer > 0) || (get_val (ADS) && event_press (RELOAD)))
  755. {
  756. Timer = 0;
  757. if (test_bit(GunFlags, 1)) { combo_run (SetSpecial); }
  758. else if (test_bit(GunFlags, 2) || test_bit (GunFlags, 3)) { combo_run (SetPrimary); }
  759. set_val (ADS, 0); combo_run (SwapQuickScope);
  760. }
  761. }
  762.  
  763. //------------------------------------------------------------------------------
  764. } // end OptionsMenu
  765.  
  766. //------------------------------------------------------------------------------
  767. } // end main
  768.  
  769. //==============================================================================
  770. // COMBOS
  771.  
  772. combo SetPrimary
  773. {
  774. clear_bit(GunFlags, 2);
  775. clear_bit(GunFlags, 3);
  776. clear_bit (GunFlags, 5);
  777. set_bit(GunFlags, 1); // Sets gun flag to Primary
  778. LED(0, 0, 1, 0); // Green
  779. ScopeHold = PriScope; // Quick-scope ADS
  780. ShootHold = PriShoot; // Quick-scope SHOOT
  781. ScopeSwap = PriSwap; // Weapon-swap quick-scope
  782. ReloadWait = PriReloadWait; // Reload wait
  783. }
  784.  
  785. combo SetSpecial
  786. {
  787. clear_bit(GunFlags, 1);
  788. clear_bit (GunFlags, 5);
  789. set_bit(GunFlags, 2); // Sets gun flag to Special
  790. LED(0, 1, 0, 0); // Red
  791. ScopeHold = SecScope; // Quick-scope ADS
  792. ShootHold = SecShoot; // Quick-scope SHOOT
  793. ScopeSwap = PriSwap; // Weapon-swap quick-scope
  794. ReloadWait = SecReloadWait; // Reload wait
  795. }
  796.  
  797. combo SetHeavy
  798. {
  799. clear_bit(GunFlags, 1);
  800. clear_bit(GunFlags, 2);
  801. clear_bit (GunFlags, 5);
  802. set_bit(GunFlags, 3); // Sets gun flag to Heavy
  803. LED(0, 1, 1, 0); // Yellow
  804. }
  805.  
  806. combo NLBCooldown
  807. {
  808. wait (2200); // Cooldown timer for NLB when out of reserve ammo
  809. combo_run (Rumble);
  810. }
  811.  
  812. combo AutoMelee
  813. {
  814. wait(MeleeWait); // wait times before MELEE are different for moving forward or backpeddling
  815. set_val(MELEE, 100);
  816. wait(50); // wait time set to ensure MELEE after SHOOT
  817. set_val(MELEE, 0);
  818. wait(50);
  819. set_val(MELEE, 0);
  820. }
  821.  
  822. combo AutoRevive
  823. {
  824. set_val (DPAD_DOWN, 0);
  825. set_val(RELOAD, 100);
  826. wait(ReviveTime); // Adjust in DEFINES if wearing fast revive gear
  827. set_val(RELOAD, 0);
  828. }
  829.  
  830. combo QuickScope
  831. {
  832. set_val(ADS, 100);
  833. wait(ScopeHold); // Adjust in DEFINES. Separate settings for Primary and Special
  834. set_val(SHOOT, 100);
  835. wait(ShootHold); // Adjust in DEFINES. Separate settings for Primary and Special
  836. set_val(ADS, 0);
  837. set_val(SHOOT, 0);
  838. }
  839.  
  840. combo SwapQuickScope
  841. {
  842. set_val (WEAPON_SWAP, 100);
  843. wait (100);
  844. wait (ScopeSwap); // Adjust in DEFINES. Separate settings for Primary and Special
  845. combo_run (QuickScope);
  846. }
  847.  
  848. combo Rumble
  849. {
  850. set_rumble (RUMBLE_A, RumbleStrength);
  851. wait(300);
  852. reset_rumble();
  853. }
  854.  
  855. combo RapidFire
  856. {
  857. set_val(SHOOT, 100);
  858. wait(HoldTime);
  859. set_val(SHOOT, 0);
  860. wait(RestTime);
  861. set_val(SHOOT, 0);
  862. }
  863.  
  864. combo RapidReload
  865. {
  866. set_val (SPRINT, 0);
  867. wait (ReloadWait); // Adjust in DEFINES. Separate settings for Primary and Special
  868. wait (50);
  869. set_val (SPRINT, 100);
  870. }
  871.  
  872. combo SprintLoop // SprintLoop prevents random NLB reloads
  873. {
  874. set_val(LY_AXIS, -100);
  875. wait(20);
  876. set_val(SPRINT, 100);
  877. }
  878.  
  879. combo NLB
  880. {
  881. set_val(SHOOT, 100);
  882. wait(50);
  883. set_val(SHOOT, 100);
  884. set_val(RELOAD, 100);
  885. wait(50);
  886. set_val(SHOOT, 0);
  887. set_val(RELOAD, 100);
  888. wait(50);
  889. set_val(RELOAD, 0);
  890. wait(50); // IMPORTANT! 50 by default
  891. set_val(LY_AXIS, -100);// |
  892. wait(20); // |- do not delete this block
  893. set_val(SPRINT, 100);// |
  894. combo_run (SprintLoop);
  895. wait (160); // IMPORTANT! 200 by default, 160 with SnapShot perk
  896. combo_stop (SprintLoop);
  897. }
  898.  
  899. //==============================================================================
  900. // FUNCTIONS
  901.  
  902. //------------------------------------------------------------------------------
  903. // RAPID-FIRE
  904.  
  905. function RapidFireSpeed (RF_HoldTime, RF_RestTime)
  906. {
  907. HoldTime = RF_HoldTime; RestTime = RF_RestTime;
  908. if (HoldTime > 0)
  909. { combo_run(RapidFire); }
  910. }
  911.  
  912. //------------------------------------------------------------------------------
  913. // ANTI-RECOIL
  914.  
  915. function AntiRecoil (AntiRecoil_H, AntiRecoil_V)
  916. {
  917. // Anti-recoil parameters
  918. if (get_val(SHOOT) && isqrt(pow(get_val(RX_AXIS), 2) + pow(get_val(RY_AXIS), 2)) <= abs(AntiRecoil_V))
  919. {
  920. if(abs(RY_AXIS) <= abs(AntiRecoil_V))
  921. {
  922. // Horizontal anti-recoil
  923. RightStick_X = (get_val(RX_AXIS) + (AntiRecoil_H*(100-abs(get_val(RX_AXIS))))/100);
  924. set_val(RX_AXIS, RightStick_X);
  925.  
  926. // Vertical anti-recoil
  927. if (Invert_Y) { RightStick_Y = (get_val(RY_AXIS) - (AntiRecoil_V*(100-abs(get_val(RY_AXIS))))/100); } // Y-axis invert
  928. else { RightStick_Y = (get_val(RY_AXIS) + (AntiRecoil_V*(100-abs(get_val(RY_AXIS))))/100); }
  929. if (RightStick_Y > (AntiRecoil_V)) {RightStick_Y = (AntiRecoil_V) ;}
  930. set_val(RY_AXIS, RightStick_Y);
  931. }
  932. }
  933. }
  934.  
  935. //------------------------------------------------------------------------------
  936. // SET TOGGLES
  937.  
  938. function SetToggle(FlagLocation) {
  939. if(test_bit(ToggleFlags, FlagLocation)) {
  940. clear_bit(ToggleFlags, FlagLocation);
  941. }
  942. else {
  943. set_bit(ToggleFlags, FlagLocation);
  944. if (RumbleStrength > 0) { combo_run(Rumble); }
  945. }
  946. set_pvar(PVAR_ToggleFlags, ToggleFlags);
  947. }
  948.  
  949. //------------------------------------------------------------------------------
  950. // LED LIGHTS
  951.  
  952. function LED(a, b, c, d) // Make the lights pretty
  953. {
  954. set_led(0, a);
  955. set_led(1, b);
  956. set_led(2, c);
  957. set_led(3, d);
  958. }
  959.  
  960. //------------------------------------------------------------------------------
  961. // LED DEFINITIONS FOR PS4 LIGHT BAR
  962.  
  963. // LED(0,0,0,0); // Off
  964. // LED(1,0,0,0); // Blue
  965. // LED(0,1,0,0); // Red
  966. // LED(0,0,1,0); // Green
  967. // LED(0,0,0,1); // Pink
  968. // LED(1,0,1,0); // SkyBlue
  969. // LED(0,1,1,0); // Yellow
  970. // LED(1,1,1,1); // White
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement