Call of Duty Black Ops 4 / Open Source Script

Documentation, usage tips and configuration guides for the Titan Two scripts and bytecodes published by the community users.

Moderators: The_Rabid_Taco, pablosscripts, bonefisher

Call of Duty Black Ops 4 / Open Source Script

Postby USER101 » Sat Mar 30, 2019 1:15 am

Image
Call of Duty Black Ops 4 / Open Source Script with UI and Comments
First-Person Shooter script geared towards Call of Duty Black Ops 4 including Blackout mode enhancements.

To use: Make sure the controller rumble/vibrate is turned on in your game and console settings then simply load the script into a slot and play. If you play inverted click the INVERTED AUTOMATIC PRESET button on the IC then hit save and play.

DISCORD:
@User101 (ConsoleTuner discord channel link)

Team,
We are transitioning to version 3.0! In this version everything should be automatic including rapid fire and the anti recoil weapon selector. 3.0 is still in Beta so the code below has not been updated but once I can confirm that everything works for the PS4 like it does for the Xbox I will update the source code. Here is an example video of how well the anti recoil automatically detects the weapon being fired and compensates. If you have a PS4 and can confirm that the weapon detection is being displayed in the output window I would appreciate it. Enjoy!



FEATURES:

*Auto Select Recoil Mode (Beta)
*Users Dynamic Recoil(UDR)
*Users Rapid Fire(URF)
*Blackout Mode
*Rapid Fire
*Anti-Recoil
*Recoil Delay
*Recoil Timeout
*Hair Trigger
*Auto Sprint
*Auto Hold Breath
*Auto Aim Down Sights(ADS) / Easy Akimbo
*Auto Reload
*Auto Heal with Heal Time
*Auto ADS
*Auto ADS delay
*Auto reload time
*Auto stim
*Auto recoil timeout
*Presets
*Bonus content (NUKE emblem)

LED FEEDBACK:
Note** Runtime rapid fire toggles and led feedback are disabled when using URF.
RED:Rapid fire ALL OFF
GREEN:Rapid fire ON
BLUE:Rapid fire TEMP OFF in Blackout mode

CHANGE LOG:
v1.00
-Added simple rapid fire
v1.01
-Added rapid fire toggle
v1.02
-Added auto reload and auto heal
-Added hair trigger
v1.03
-Added auto sprint
v2.01
-Added Interactive Configuration (UI)
-Added rapid fire toggle
v2.02
-Added adjustable recoil
-Added recoil delay
-Added adjustable rapid fire
v2.03
-Added auto hold breath (sniper mode)
-Added auto heal wait time
v2.04
-Added auto rapid fire when weapon switch (blackout mode)
-Added rumble and LED feedback
-Added adjustable stick noise compensation
-Added easy akimbo / auto ADS
-Added recoil timeout
v2.05
-Added auto ADS
-Added auto ADS delay
-Added auto reload time
-Added auto stim
-Added recoil timeout
-Added presets
-Modified auto recoil code
-Added bonus content Nuke emblem
v2.07
-Added Users Rapid Fire(URF) auto rapid fire toggle
-Added Users Dynamic Recoil(UDR) auto ADS delay
v3.0
-Added Auto Recoil Select

TO DO:
Add aim abuse
Add turbo melee
Add auto slide
Add bunny hop
Add strafe
Add runtime recoil settings
Add grenade cook protection
Add other emblems
Add XIM support
Add jump shot
Add slide melee
Add drop shot


ACKNOWLEDGEMENTS:
@Scachi / ConsoleTuner Forums
for teaching me to code in GPC
@Don' at me / Discord
for helping with examples and proper syntax
@Buffy / Discord
for helping with examples and proper syntax
@bonefisher / ConsoleTuner Forums
for providing outstanding example code for everything from rapid fire to anti recoil
@AryanX
for releasing original anti recoil

INTERFACE PREVIEW:
Image

If you find this script useful please visit the online resources tab in your Gtuner and consider giving this GPC Script a thumbs up. I will work towards adding more functionality and optimization while trying to keep it simple. If you would like more elaborated comments I will add them. I will comment every single line if it will help you learn. With that being said I am still learning myself so if you see things that need to be changed please let me know.

Thanks
@USER101

FULL SCRIPT: Version 3.0
Code: Select all
#pragma METAINFO("COD_BO4", 3, 0, "USER101")
 
/*
<cfgdesc>
[CALL OF DUTY]
collapsible = 0
shortdesc    = <<<MULTILINE
<b><font style="font-size:72px">BLACK <font color=#FF6B00>OPS</font> 4</font>
<font color=#FF6B00 style="font-size:20px">   WITH <font color=#000000>BLACKOUT <font color=#FF6B00>MODE</font><font style="font-size:13px"> v3.0</b></font>
<i>(Open Source) First-Person Shooter script geared towards Call of Duty - Black Ops 4, including Blackout mode enhancements!</i>
 
<font color=#ff0000>BETA VERSION 3.0</font>
 
Discord:<b>@User101</b>  (<a href="https://discord.gg/JcM7AYe">Console Tuner discord channel link</a>)
</font>
MULTILINE
color        = #000000
 
[INSTRUCTIONS (EXPAND TO READ)]
collapsible = 2
shortdesc    = <<<MULTILINE
I am introducing two new modes. <b>Users Dynamic Recoil(UDR)</b> which will automatically start adjusting your recoil compensation based on your gameplay and <b>Users Rapid Fire(URF)</b> which will detect the type of weapon being fired and auto toggle rapid fire for you. Both concepts and code are original ideas. With these modes enabled you should not have to make any adjustments during runtime. <b>Users Dynamic Recoil(UDR)</b> is expeimental. If you are constantly using one weapon such as in multiplayer its best to keep the training multiplier on a low value. It will take longer to train but should stay more consitant. For battle rolay modes a high training multiplier value will train quicker but could produce some over compensation. Another way of using <b>UDR</b> is to goto a range, pick a weapon and shoot a single spot on the wall until you no longer have to compensate for recoil. Anti-Recoil is calculated while firing each time the right thumb stick is released. It is better to make smaller more frequent adjustments while firing for quicker results. It will display the anti recoil value for that weapon in the output window of Gtuner. You can then use that value to set the manual recoil then make presets for each weapon. I may try to add an auto way of doing this in the future. For now with it enabled it should always try to reduce recoil based on your previous attempts to stay on target. For <b>URF</b> the rapid fire Hold, Release, Delay and Falloff adjustments still apply. However, you will not be able to manually toggle rapid fire while this mode is enabled. You should not have to worry about that anyway. If you have questions or suggestions about these modes click the discord link above.   
 
<font color=#000000 style="font-size:11px">RUNTIME OPERATION FOR MANUAL RAPID FIRE:</font>
<b>[ADS / LEFT TRIGGER] + [D_DOWN]</b> Fully toggles rapid fire in game.
<b>[Y / TRIANGLE]</b> Toggles rapid fire when in Blackout mode and the main Rapid Fire on.
 
<b>LED FEEDBACK:</b> Rapid Fire <b><font color=#FF0000>ALL OFF</font></b> / Rapid Fire <b><font color=#00FF00>ON</font></b> / Rapid Fire <b><font color=#0000FF>TEMP OFF</font></b>
 
<b><font color=#FF6B00 style="font-size:15px">PRESETS:</b></font>
 
These presets are the settings I use. Feel free to change the settings as you go. See below on how to create your own presets. To apply these presets, you still need to hit "Save and Run" or "OK".
 
<b>FULL UDM (Experimental):</b> With blackout mode enabled rapid fire and anti-recoil will constantly adjust on its on. This mode should work for most games. The Dynamic Recoil is still experimental and takes some time to train. So if you experience compensation issues please let me know.
 
<b>BLACKOUT:</b> With blackout mode enabled rapid fire will automatically toggle based on the weapon you fire. This is useful in case you like to carry both semiautomatic and a fully automatic weapons at the same. For this preset you will need to enable anti-recoil manually. Or turn on the experimental User Dynamic Recoil.
 
<b>HARDCORE:</b> Geared towards SMG style run and gun in hardcore mode.
 
<b>CORE:</b> This preset has the auto stim shot enabled for playing in core mode.
 
<b>SNIPER MODE:</b> This preset will auto aim / quick scope then fire.
 
<b><font color=#FF6B00 style="font-size:15px">CUSTOM PRESETS:</b></font>
 
To customize these presets simply open the Interactive Configuration set things how you want it and click the copy configuration button at the top.
The copied text should look something like this:
<b><i>"GIVICFG:FFEC00000000000000010050005001000001000800000080000010"</b></i>
 
Then open the script code in you console tuner editor and look for the presets category which looks something like this:
<b><i>"item        = SMG Hardcore(Multiplayer):FFEE0000000000000001005000500100000100080000010"</b></i>
 
Then replace all the text to the right of the = sign with your copied text. Rename "GIVICFG" to whatever you want, just do not touch the letters to the right of the colon. After that save the code and install the active work to a memory slot. Run the script and you should see the changes.
 
<b><font color=#FF6B00 style="font-size:15px">OTHER OPTIONS:</b></font>
 
<b>Rapid Fire</b> will attempt to fire at the given interval. note that if you are using a fully auto weapon it may produce frame lag causing your weapon to shudder. I normally turn this off for fully auto weapons.
 
<b>Hold Time</b> how long to hold the trigger.
 
<b>Release Time</b> how long to release the trigger before attempting to fire again.
 
<b>Anti Recoil</b> Applies opposing force to your right analog when the right trigger is squeezed.
 
<b>Recoil Vertical</b> Applies opposing vertical force, use only if needed.
 
<b>Recoil Horizontal</b> Applies opposing horizontal force, use only if needed.
 
<b>Recoil Delay</b> Will wait before applying the anti-recoil if needed.
 
<b>Recoil Timeout</b> Will stop the anti-recoil after the time if needed.
 
<b>Blackout Mode</b> In this mode tapping Y to switch weapons will automatically toggle rapid on and off while rapid fire is enabled.
 
<b>Auto Sprint</b> Pressing forward more than 80% on the thumb stick will attempt to sprint.
 
<b>Hair Trigger</b> Any movement on the trigger sets the value to 100%.
 
<b>Auto Hold Breath</b> Will auto hold your breath when you aim down the sights.
 
<b>Auto ADS / Easy Akimbo</b> Will auto aim down sights when you squeeze the right trigger.
 
<b>Auto ADS Delay</b> Will delay aiming down the sight in case you need time to center your shot before firing the weapon.
 
<b>Auto Reload</b> Will attempt to reload after the fire trigger is released.
 
<b>Auto Reload Time</b> Time to reload if you plan to heal after.
 
<b>Auto Heal</b> Will attempt to heal after the fire trigger is released.
 
<b>Quick Stim</b> Will make you attempt to auto heal before you auto reload.
 
<b>Heal Time</b> Time it takes to heal if you plan to reload after.
 
<b>Stick Noise</b> This will help compensate for any noise in your right analog stick when using anti recoil. To set up just open your device monitor and wiggle your right analog stick a few times. Set this number to the highest value you noticed after letting the stick go. Do it a few times to get the best reading. Its best to go with a slightly higher number than a lower one.
 
</font>
MULTILINE
color        = #000000
control        = info
 
[LOGCAP:]
shortdesc   = <b>STATISTICAL FEEDBACK LOG:</b> Provides statistics to the output panel for development.
byteoffset  = 46
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[GLITCH:]
collapsible = 3
shortdesc   = <b>Toggle Glitch:</b> Hold LT / DPAD UP to activate.
byteoffset  = 47
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[PARTY:]
group        = true
shortdesc   = <b>Party:</b> Enable when in party.
byteoffset  = 48
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[PRESETS:]
color        = #FF6B00
control        = config
item        = NORMAL AUTOMATIC PRESET:00000000000000000001000F000F0100000100080000010000000000000000000000000000000000000019018A000000000100
item        = INVERTED AUTOMATIC PRESET:FFE50000000000000001000F000F0100000100080000010000000000000000000000000000000000000019018A000000000101
 
[RAPID FIRE:]
color        = #FF6B00
 
[DYNAMIC FIRE:]
group        = true
shortdesc   = <b>USERS RAPID FIRE(URF) / AKA BLACKOUT MODE:</b> Fully automatic rapid fire mode, will rapid fire if single shot is detected.
byteoffset  = 43
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 1
item        = Enable
 
[RAPID TIMER]
group        = true
shortdesc    = <b>RATE OF FIRE:</b> Increase this number until your slowest automatic weapon no longer stutters while firing. Or, enable the rate of fire log below to see the rate of fire of your slowest fully automatic weapon and set this a few milliseconds higher than the highest number displayed.
byteoffset    = 44
bitsize        = 8
control        = slider
default        = 138
minimum        = 0
maximum        = 300
step        = 1
 
[LOG STAT]
group        = true
shortdesc   = <b>RATE OF FIRE LOG:</b> While this is enabled it will show your rate of fire in the Output Panel within Gtuner. This must be disabled for the automatic rapid fire to work.
byteoffset  = 45
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[LOG GAP 1]
group        = true
shortdesc   =<<<MULTILINE
<font color=#c0c0c0>______________________________________________________________________________________________
</font>
MULTILINE
control        = info
 
[RAPID FIRE MANUAL]
group        = true
shortdesc   = <b>CONSTANT RAPID FIRE:</b> Rapid fire always ON. (To toggle this during game:<b> ADS+DPAD_DOWN</b>)
byteoffset  = 8
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[MANUAL RAPID TOGGLE]
group        = true
shortdesc   = <b>MANUAL TOGGLE MODE:</b> Manually toggle rapid fire with weapon switch. (Constant rapid fire required.)
byteoffset  = 23
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[HOLD TIME]
group        = true
shortdesc    = <b>HOLD TIME:</b> (ms)
byteoffset    = 10
bitsize        = 16
control        = spinbox
decimals    = 1
default        = 15
minimum        = 0
maximum        = 200
step        = 1
 
[RELEASE TIME]
group        = true
shortdesc    = <b>RELEASE TIME:</b> (ms)
byteoffset    = 12
bitsize        = 16
control        = spinbox
decimals    = 1
default        = 15
minimum        = 0
maximum        = 200
step        = 1
 
[ANTI-RECOIL:]
color        = #FF6B00
 
[DYNAMIC RECOIL:]
group        = true
shortdesc   = <b>USERS DYNAMIC RECOIL(UDR):</b> Fully automatic recoil compensation.<b><font color=#FF6B00 style="font-size:8px">(EXPERIMENTAL)</b></font>
byteoffset  = 41
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[RECOIL MULTIPLIER]
group        = true
shortdesc    = <b>RECOIL MULTIPLIER:</b> Change this value to increase or decrease the anti-recoil training speed. A smaller number will take longer to train the model but will be more consistant over time.
byteoffset    = 42
bitsize        = 8
control        = slider
default        = 25
minimum        = 0
maximum        = 100
step        = 1
 
[LOG GAP 2]
group        = true
shortdesc   =<<<MULTILINE
<font color=#c0c0c0>______________________________________________________________________________________________
</font>
MULTILINE
control        = info
 
[AUTO RECOIL:]
group        = true
color        = #FF6B00
shortdesc   = <b>AUTO ANTI-RECOIL SELECTOR:</b> Accurately auto sets recoil for BO4 weapons when you fire them. Turn on manual and set a value below as a backup setting. BETA**.
byteoffset  = 49
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 1
item        = Enable
 
[INVERTED:]
group        = true
color        = #FF6B00
shortdesc   = <b>INVERTED:</b> This only inverts the auto anti-recoil relector, for manual mode use negative values below.
byteoffset  = 50
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[MANUAL RECOIL:]
group        = true
color        = #FF6B00
shortdesc   = <b>MANUAL ANTI-RECOIL:</b> Use negative value for inverted players.
byteoffset  = 9
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 1
item        = Enable
 
[RECOIL VERTICAL]
group        = true
shortdesc    = <b>RECOIL VERTICAL:</b>
byteoffset    = 0
bitsize        = 32
control        = spinboxf
decimals    = 1
default        = 0
minimum        = -1000
maximum        = 1000
step        = 10
 
[RECOIL HORIZONTAL]
group        = true
shortdesc    = <b>RECOIL HORIZONTAL:</b>
byteoffset    = 4
bitsize        = 32
control        = spinboxf
decimals    = 1
default        = 0
minimum        = -1000
maximum        = 1000
step        = 10
 
[RECOIL DELAY]
group        = true
shortdesc    = <b>RECOIL DELAY:</b> (ms)
byteoffset    = 26
bitsize        = 32
control        = slider
default        = 0
minimum        = 0
maximum        = 2000
step        = 10
 
[RECOIL TIMEOUT]
group        = true
shortdesc    = <b>RECOIL TIMEOUT:</b> (ms)
byteoffset    = 30
bitsize        = 16
control        = slider
default        = 0
minimum        = 0
maximum        = 2000
step        = 10
 
[AUTO TOGGLES:]
color        = #FF6B00
 
[AUTO SPRINT]
group        = true
shortdesc   = <b>Auto Sprint</b>
byteoffset  = 14
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 1
item        = Enable
 
[HAIR TRIGGER]
group        = true
shortdesc   = <b>Hair Trigger</b>
byteoffset  = 17
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 1
item        = Enable
 
[SNIPER MODE]
group        = true
shortdesc   = <b>Auto Hold Breath</b>
byteoffset  = 22
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 1
item        = Enable
 
[AUTO ADS]
group        = true
shortdesc   = <b>Auto ADS / Easy-Akimbo</b>
byteoffset  = 32
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[AUTO ADS TOGGLE]
group        = true
shortdesc   = <b>Auto ADS Delay</b>
byteoffset  = 36
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[ADS DELAY]
group        = true
shortdesc    = <b>ADS Delay Time:</b> (ms)
byteoffset    = 34
bitsize        = 16
control        = spinbox
decimals    = 1
default        = 0
minimum        = 0
maximum        = 500
step        = 10
 
[AUTO RELOAD]
group        = true
shortdesc   = <b>Auto Reload</b>
byteoffset  = 16
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[RELOAD TIME]
group        = true
shortdesc    = <b>Reload Time:</b>  (ms)
byteoffset    = 37
bitsize        = 16
control        = spinbox
decimals    = 1
default        = 0
minimum        = 0
maximum        = 2000
step        = 10
 
[AUTO HEAL]
group        = true
shortdesc   = <b>Auto Heal</b>
byteoffset  = 15
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[QUICK STIM]
group        = true
shortdesc   = <b>Quick Stim</b>
byteoffset  = 39
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[HEAL TIME]
group        = true
shortdesc    = <b>Heal Time:</b> (ms)
byteoffset    = 24
bitsize        = 16
control        = spinbox
decimals    = 1
default        = 0
minimum        = 0
maximum        = 10000
step        = 10
 
[STICK NOISE:]
color        = #FF6B00
shortdesc    = This will help compensate for any noise in your right analog stick when using anti recoil. To set up just open your device monitor and wiggle your right analog stick a few times. Set this number to the highest value you noticed after letting the stick go. Do it a few times to get the best reading. Its best to go with a slightly higher number than a lower one.
byteoffset    = 18
bitsize        = 32
control        = spinboxf
decimals    = 2
default        = 800
minimum        = 0
maximum        = 5000
step        = 1
 
[ACKNOWLEDGEMENTS (expand to read)]
collapsible = 2
shortdesc    = <<<MULTILINE
<font color=#0000ff>
@Scachi / ConsoleTuner Forums
for teaching me to code in GPC
 
@Don' at me / Discord
for helping with examples and proper syntax
 
@Buffy / Discord
for helping with examples and proper syntax
 
@bonefisher / ConsoleTuner Forums
for providing outstanding example code for everything from rapid fire to anti recoil
 
@AryanX
for releasing original anti recoil code
</font>
 
MULTILINE
color        = #000000
control        = info
 
[BONUS CONTENT (expand to see)]
collapsible = 2
shortdesc    = <<<MULTILINE
<font color=#000000>Check here for emblem recordings. To start the creation process just open your emblem creator and start a new emblem. Make sure the next slot is available because the macro will create an extra emblem to let you know it is complete. Once the emblem creator is open and you have enabled the emblem you want to create simply hold the right bumper for 4 seconds. The controller will vibrate and the LED will turn purple. The LED should turn back RED when it is complete.</font>
MULTILINE
color        = #000000
control        = info
 
[NUKE]
group        = true
shortdesc   = <b>Nuke Sticker</b> 2.5 hours <a href="https://www.consoletuner.com/forum/viewtopic.php?f=23&t=11913">preview</a>
byteoffset  = 40
bitsize     = 1
bitoffset   = 0
control     = checkbox
default     = 0
item        = Enable
 
[CHANGE LOG (expand to read)]
collapsible = 2
shortdesc    = <<<MULTILINE
<font color=#008000>
<b>v1.00</b>
-Added simple rapid fire
 
<b>v1.01</b>
-Added rapid fire toggle
 
<b>v1.02</b>
-Added auto reload and auto heal
-Added hair trigger
 
<b>v1.03</b>
-Added auto sprint
 
<b>v2.01</b>
-Added Interactive Configuration (UI)
-Added rapid fire toggle
 
<b>v2.02</b>
-Added adjustable recoil
-Added recoil delay
-Added adjustable rapid fire
 
<b>v2.03</b>
-Added auto hold breath (sniper mode)
-Added auto heal wait time
 
<b>v2.04</b>
-Added auto rapid fire when weapon switch (blackout mode)
-Added rumble and LED feedback
-Added adjustable stick noise compensation
-Added easy akimbo / auto ADS
-Added recoil timeout
 
<b>v2.05</b>
-Added auto ADS
-Added auto ADS delay
-Added auto reload time
-Added auto stim
-Added recoil timeout
-Added presets
-Modified auto recoil code
-Added bonus content Nuke emblem
 
<b>v2.07</b>
-Added Users Rapid Fire(URF) auto rapid fire toggle
-Added Users Dynamic Recoil(UDR) auto ADS delay
 
To Do:
Add aim abuse
Add turbo melee
Add auto slide
Add bunny hop
Add strafe
Add runtime recoil settings
Add grenade cook protection
Add other emblems
Add XIM support
Add jump shot
Add slide melee
Add drop shot
 
</font>
 
MULTILINE
color        = #000000
control        = info
 
[LICENSING AND USAGE (expand to read)]
collapsible = 2
shortdesc    = <<<MULTILINE
<font color=#0000ff>
Open source code.
Still in beta and unoptimized.
Free to use and modify.
Please DO NOT distribute for profit.
 
If you use this code please credit:
@User101 - for concept and creation of
"Dynamic Recoil"
"Users Rapid Fire"
 
</font>
 
MULTILINE
color        = #000000
control        = info
 
</cfgdesc>
 
***************************************************************************** */

 
#define float fix32
#define MinARecoilPercent 20.0
 
bool UDR = FALSE;// Users Dynamic Recoil
bool UDF = FALSE;// Users Dynamic Fire
bool Modify = FALSE;
bool bAutoSprint = FALSE;
bool bAutoHeal = FALSE;
bool bAutoReload = FALSE;
bool bHairTrigger = FALSE;
bool bAntiRecoil = FALSE;
bool bRapid = FALSE;
bool bRumble = FALSE;
bool bRumbleTwice = FALSE;
bool button = FALSE;
bool run = FALSE;
bool brun = FALSE;
bool SniperMode = FALSE;
bool SwitchMode = TRUE;
bool bSwitchMode = FALSE;
bool BlackoutMode = FALSE;
bool AutoADS = FALSE;
bool bAutoADSDelay = FALSE;
bool bFirst = TRUE;
bool Aim = FALSE;
bool bAim = TRUE;
bool QuickStim = FALSE;
bool Nuke = FALSE;
bool bNuke = FALSE;
bool NukeRunning = FALSE;
bool LogStat = TRUE;
bool ROF = FALSE;
bool WaitModifier = FALSE;
bool AutoWeapon = FALSE;
bool RapidNotify = TRUE;
bool Reloading = FALSE;
bool glitchGame = FALSE;
bool glitch = FALSE;
bool party = FALSE;
bool autoRecoil = FALSE;
bool holdRecoil = FALSE;
bool inverted = FALSE;
 
uint8 i;
uint8 FireTimer = 0;
uint8 RapidTimer = 139;
uint8 TriggerCounter = 0;
uint8 RecoilMultiplierHolder;
 
uint16 timer = 0;
uint16 HoldTime;
uint16 ReleaseTime;
uint16 HealTime;
uint16 RecoilTimeout;
uint16 ShotCount = 0;
uint16 RecoilTimeoutPlaceHolder;
uint32 RecoilTimeoutPlaceHolder2;
uint16 EngagementCount = 0;
 
uint16 AutoADSDelay;
uint16 AutoReloadTime;
uint16 RumbleTimer = 0;
uint16 TriggerSum;
uint16 Modifier;
uint16 TriggerHoldTime;
uint16 FireTime = 80;
uint16 TriggerTimeStack[10];
 
float ARecoil_H = 0.0;
float ARecoil_V = 0.0;
float ARecoil_H_PlaceHolder = 0.0;
float ARecoil_V_PlaceHolder = 0.0;
float StickNoise = 0.0;
float ModifierSum;
float RecoilModifier[20];
float RecoilMultiplier;
float Rumble;
float OldRumble;
 
uint32 RecoilDelay = 0;
uint32 ARecoilDelay = 0;
 
init{
    bRumbleTwice = TRUE;
    pmem_load();
    pmem_read(0, &ARecoil_V);
    pmem_read(4, &ARecoil_H);
    pmem_read(8, &bRapid);
    pmem_read(9, &bAntiRecoil);
    pmem_read(10, &HoldTime);
    pmem_read(12, &ReleaseTime);
    pmem_read(14, &bAutoSprint);
    pmem_read(15, &bAutoHeal);
    pmem_read(16, &bAutoReload);
    pmem_read(17, &bHairTrigger);
    pmem_read(18, &StickNoise);
    pmem_read(22, &SniperMode);
    pmem_read(23, &BlackoutMode);
    pmem_read(24, &HealTime);
    pmem_read(26, &ARecoilDelay);
    pmem_read(30, &RecoilTimeout);
    pmem_read(32, &AutoADS);
    pmem_read(34, &AutoADSDelay);
    pmem_read(36, &bAutoADSDelay);
    pmem_read(37, &AutoReloadTime);
    pmem_read(39, &QuickStim);
    pmem_read(40, &bNuke);
    pmem_read(41, &UDR);
    pmem_read(42, &RecoilMultiplierHolder);
    pmem_read(43, &UDF);
    pmem_read(44, &RapidTimer);
    pmem_read(45, &ROF);
    pmem_read(46, &LogStat);
    pmem_read(47, &glitch);
    pmem_read(48, &party);
    pmem_read(49, &autoRecoil);
    pmem_read(50, &inverted);
 
    RecoilTimeoutPlaceHolder = RecoilTimeout + ARecoilDelay;
    RecoilTimeoutPlaceHolder2 = RecoilTimeoutPlaceHolder;
    ARecoil_H_PlaceHolder = ARecoil_H;
    ARecoil_V_PlaceHolder = ARecoil_V;
    RecoilMultiplier = (fix32)RecoilMultiplierHolder * 0.01;
    if (HealTime < 40) HealTime = 40;
    if(LogStat){
        printf("Anti Recoil Vertical Value: <b>%.2f", ARecoil_V);
        printf("Anti Recoil Horizontal Value: <b>%.2f", ARecoil_H);
        printf("Auto Heal Time: <b>%.2f</b> ms", HealTime);
        printf("Anti Recoil Delay: <b>%.2f</b> ms", ARecoilDelay);
        printf("Anti Recoil Timeout: <b>%.2f</b> ms", RecoilTimeout);
        printf("Auto ADS Delay: <b>%.2f</b> ms", AutoADSDelay);
        printf("Auto Reload Time: <b>%.2f</b> ms", AutoReloadTime);
        printf("Rapid Fire Hold Time: <b>%d</b> ms", HoldTime);
        printf("Rapid Fire Release Time: <b>%d</b> ms", ReleaseTime);
        printf("Stick Noise: <b>%.2f", StickNoise);
        if(UDR)printf("UDR Recoil Multiplier: <b>%d</b> %", RecoilMultiplierHolder);
        if(UDF)printf("UDF Rapid Fire Time Delay: <b>%d</b> ms", RapidTimer);
    }
    if(inverted)printf("<b>Playing Inverted");
}
 
main {
    if(ROF)LogStat = FALSE;
 
     if (bAutoSprint && get_val(STICK_2_Y) < -90.0) run = TRUE;
 
    if (!brun && run){
        combo_run(Sprint);
        brun = TRUE;
    }
    if (bAutoSprint && get_val(STICK_2_Y) >= -90.0) brun = FALSE;
 
    // Start XP glith
    if (glitch && !glitchGame && time_release(BUTTON_7) < 200 && event_active(BUTTON_7))glitchGame = TRUE;
    if (glitchGame)combo_run(GLITCH);
    if (glitchGame && is_active(BUTTON_16)){
        combo_stop(GLITCH);
        printf("<b>Game Glitch Combo Stopped");
        glitchGame = FALSE;
    }
    // End XP glitch
 
 
     if (!button && is_active(BUTTON_8) && is_active(BUTTON_11) && !UDF) {
        if(bRapid){
            bRapid = FALSE;
            SwitchMode = FALSE;
            bRumbleTwice = TRUE;
            button = TRUE;
        } else {
            bRapid = TRUE;
            SwitchMode = TRUE;
            bRumble = TRUE;
            button = TRUE;
        }
    }
 
    if (event_release(BUTTON_11) && button) button = FALSE;
 
    if (event_release(BUTTON_17))combo_run(ReloadNow);
 
    if (is_active(BUTTON_5)){
        TriggerHoldTime += elapsed_time();
        if (bHairTrigger)set_val(BUTTON_5,100);
        if (AutoADS){
            if (bAim) {
                Aim = TRUE;
                bAim = FALSE;
            }
            if (SniperMode) set_val(BUTTON_9,100);
        }
        if (UDF){
            if(ffb_get(FFB_1, NULL) > 0.0 && !WaitModifier && !bRapid && !AutoWeapon && !Reloading) {
                WaitModifier = TRUE;
            }
            if(WaitModifier) {
                RumbleTimer += elapsed_time();
                if(ffb_get_actual(FFB_1, NULL) > 0.0)Rumble = ffb_get_actual(FFB_1, 0)*255f/100f;
                if(Rumble > OldRumble){
                    OldRumble = Rumble;
                    if(ROF)printf("Rate of Fire:<b> %d</b> ms", RumbleTimer);
                    if(autoRecoil && !ROF && !holdRecoil && RumbleTimer > 47){// weapon recoil preset values
                        if(RumbleTimer > 47 && RumbleTimer < 53){
                            if(inverted){
                            ARecoil_V_PlaceHolder = -38.0;//Deamon
                            }else{
                                ARecoil_V_PlaceHolder = 38.0;//Deamon
                            }
                            RecoilTimeoutPlaceHolder2 = 576;
                            printf("Damon detected: <b>%d", RumbleTimer);
                            if(LogStat)printf("Recoil Timeout: <b>%d", RecoilTimeoutPlaceHolder2);
                            holdRecoil = TRUE;
                            bRapid = TRUE;
                            WaitModifier = FALSE;
                        }
                        if(RumbleTimer > 63 && RumbleTimer < 71){
                            if(inverted){
                            ARecoil_V_PlaceHolder = -38.0;//Spitfire, Saug9
                            }else{
                                ARecoil_V_PlaceHolder = 38.0;//Spitfire, Saug9
                            }
                            RecoilTimeoutPlaceHolder2 = 576;
                            printf("Spitfire, Saug9 detected: <b>%d", RumbleTimer);
                            if(LogStat)printf("Recoil Timeout: <b>%d", RecoilTimeoutPlaceHolder2);
                            holdRecoil = TRUE;
                            AutoWeapon = TRUE;
                            WaitModifier = FALSE;
                        }
                        else if(RumbleTimer > 79 && RumbleTimer < 84){
                            if(inverted){
                            ARecoil_V_PlaceHolder = -34.0;//Corridite
                            }else{
                                ARecoil_V_PlaceHolder = 34.0;//Corridite
                            }
                            RecoilTimeoutPlaceHolder2 = 810;
                            printf("Corridite detected: <b>%d", RumbleTimer);
                            if(LogStat)printf("Recoil Timeout: <b>%d", RecoilTimeoutPlaceHolder2);
                            holdRecoil = TRUE;
                            AutoWeapon = TRUE;
                            WaitModifier = FALSE;
                        }
                        else if(RumbleTimer > 83 && RumbleTimer < 89){
                            if(inverted){
                            ARecoil_V_PlaceHolder = -25.0;//MX9, Maddox
                            }else{
                                ARecoil_V_PlaceHolder = 25.0;//MX9, Maddox
                            }
                            printf("MX9, Maddox detected: <b>%d", RumbleTimer);
                            holdRecoil = TRUE;
                            AutoWeapon = TRUE;
                            WaitModifier = FALSE;
                        }
                        else if(RumbleTimer > 99 && RumbleTimer < 105){
                            if(inverted){
                            ARecoil_V_PlaceHolder = -20.0;//GKS, ICR, VaprXNG, Swat, Hades
                            }else{
                                ARecoil_V_PlaceHolder = 20.0;//GKS, ICR, VaprXNG, Swat, Hades
                            }
                            if(LogStat)printf("GKS, ICR, VaprXNG, Swat, Hades detected: <b>%d", RumbleTimer);
                            holdRecoil = TRUE;
                            AutoWeapon = TRUE;
                            WaitModifier = FALSE;
                        }
                        else if(RumbleTimer > 115 && RumbleTimer < 121){
                            if(inverted){
                            ARecoil_V_PlaceHolder = -22.0;//Rampart, KN57
                            }else{
                                ARecoil_V_PlaceHolder = 22.0;//Rampart, KN57
                            }
                            printf("Rampart, KN57 detected: <b>%d", RumbleTimer);
                            holdRecoil = TRUE;
                            AutoWeapon = TRUE;
                            WaitModifier = FALSE;
                        }
                        else if(RumbleTimer > 131 && RumbleTimer < 137){
                            if(inverted){
                            ARecoil_V_PlaceHolder = -15.0;//Titan, Tigershark
                            }else{
                                ARecoil_V_PlaceHolder = 15.0;//Titan, Tigershark
                            }
                            printf("Titan, Tigershark detected: <b>%d", RumbleTimer);
                            holdRecoil = TRUE;
                            AutoWeapon = TRUE;
                            WaitModifier = FALSE;
                        }
                        else if(RumbleTimer > 163 && RumbleTimer < 169){
                            if(inverted){
                            ARecoil_V_PlaceHolder = -15.0;//VKM750
                            }else{
                                ARecoil_V_PlaceHolder = 15.0;//VKM750
                            }
                            printf("VKM750 detected: <b>%d", RumbleTimer);
                            holdRecoil = TRUE;
                            AutoWeapon = TRUE;
                            WaitModifier = FALSE;
                        }
 
                    }
                    RumbleTimer = 0;
                    ShotCount++;
                    if(LogStat)printf("Shot Count: <b>%d", ShotCount);
//                     if(ShotCount > 3 && !ROF){//This compensates for burst fire weapons allowing auto rapid fire for those
//                         if(LogStat)printf("Automatic Weapon Detected");
//                         AutoWeapon = TRUE;
//                         WaitModifier = FALSE;
//                     }
                }
                else if(Rumble < OldRumble)OldRumble = Rumble;
            if(RumbleTimer >= RapidTimer && !ROF && !AutoWeapon){
                bRapid = TRUE;
                printf("Rapid Fire Engaged");
                WaitModifier = FALSE;
            }
            }
        }
 
        if(elapsed_time()){
          ++FireTimer;
          if(FireTimer == FireTime){
            ++Modifier;
            if(Modifier > 20) Modifier = 0;
            if(abs(get_actual(STICK_1_Y)) >= StickNoise) RecoilModifier[Modifier] = (get_actual(STICK_1_Y));
            FireTimer = 0;
          }
        }
        if(event_release(STICK_1_Y) && UDR)Modify = TRUE;
        if(Modify){
            for(i=0; i<20; i++){
                ModifierSum += RecoilModifier[i];
                RecoilModifier[i] = 0.0;
            }
        ModifierSum = ModifierSum / 20.0;
        ARecoil_V += ModifierSum * RecoilMultiplier;
        if(LogStat){
            printf("Average Multiplied Adjustment: <b>%.2f", ModifierSum);
            printf("New Anti Recoil Value: <b>%.2f", ARecoil_V);
        }
        Modifier = 0;
        ModifierSum = 0.00;
        memset(&RecoilModifier, (uint8)0.00, sizeof(RecoilModifier));
        Modify = FALSE;
        }   
        combo_run(cRapidFire);
    }
    if (event_release(BUTTON_5)) {
        if (QuickStim) combo_run(HealReload);
        else combo_run(ReloadHeal);
        if(LogStat)printf("___________________________________");
        AutoWeapon = FALSE;
        timer = 0;
        RumbleTimer = 0;
        RecoilTimeoutPlaceHolder2 = RecoilTimeoutPlaceHolder;
        if(LogStat)printf("Recoil Timeout: <b>%d", RecoilTimeoutPlaceHolder2);
        WaitModifier = FALSE;
        holdRecoil = FALSE;
        OldRumble = 0.0;
        ARecoil_H_PlaceHolder = ARecoil_H;
        ARecoil_V_PlaceHolder = ARecoil_V;
        bFirst = TRUE;
        bAim = TRUE;
        Aim = FALSE;
        AutoWeapon = FALSE;
        if(UDF)bRapid = FALSE;
        combo_stop(RapidFire);
        if(UDF && LogStat && !RapidNotify && bRapid){
            printf("Users Rapid Fire: <b>OFF");
            RapidNotify = TRUE;
        }
        if(LogStat)printf("Trigger Held: <b>%d</b> ms", TriggerHoldTime);
        ++TriggerCounter;
        if(TriggerCounter > 10)TriggerCounter = 0;
        TriggerTimeStack[TriggerCounter] = TriggerHoldTime;
        for(i=0; i<10; i++){
            TriggerSum += TriggerTimeStack[i];
        }
        TriggerSum = TriggerSum / 10;
        if(LogStat)printf("Average Trigger Hold Time: <b>%d</b> ms", TriggerSum);
        FireTime = TriggerSum / 20;
        if(FireTime < 30)FireTime = 30;
        if(LogStat)printf("Stack Count Delay <b>%d</b> ms", FireTime);
        TriggerHoldTime = 0;
        EngagementCount++;
        if(LogStat)printf("Total Engagement Count = <b>%d", EngagementCount);
        if(LogStat)printf("Anti Recoil Value = <b>%.2f", ARecoil_V);
        if(ROF)printf("Shots Fired:<b> %d",ShotCount);
        ShotCount = 0;
    }
    if (Aim) set_val(BUTTON_8,100);
 
    if (bRapid){
        if(UDF && LogStat && RapidNotify){
            printf("Users Rapid Fire: <b>ON");
            RapidNotify = FALSE;
        }
        if (!bSwitchMode && BlackoutMode && is_active(BUTTON_14)){
            if (SwitchMode){
                if(LogStat)printf("RAPID FIRE OFF");
                ColorLED('B');
                SwitchMode = FALSE;
                bSwitchMode = TRUE;
            } else {
                if(LogStat)printf("RAPID FIRE ON");
                ColorLED('G');
                SwitchMode = TRUE;
                bSwitchMode = TRUE;
            }
        }
        if (event_release(BUTTON_14)) bSwitchMode = FALSE;
    }
 
    if (SniperMode && is_active(BUTTON_8)) set_val(BUTTON_9,100);
 
    if (is_active(BUTTON_5)) {
        combo_stop(HealReload);
        combo_stop(ReloadHeal);
        combo_stop(Heal);
        combo_stop(Reload);
    }
 
    if (get_actual(BUTTON_5) && time_active(BUTTON_5) >= RecoilDelay){
        if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
        if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
        if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
        if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
    }
    if (bAntiRecoil && get_val(BUTTON_5)&& !bRapid && !ROF || UDR && get_val(BUTTON_5)&& !bRapid && !ROF){
        timer += elapsed_time();
        if(RecoilTimeout != 0 || RecoilTimeoutPlaceHolder2 !=0){
            if(timer >= RecoilTimeoutPlaceHolder2) {
                ARecoil_H_PlaceHolder = 0.0;
                ARecoil_V_PlaceHolder = 0.0;
            }
        }
        if (timer >= ARecoilDelay) {
        AntiRecoil(STICK_1_X, ARecoil_H_PlaceHolder);
        AntiRecoil(STICK_1_Y, ARecoil_V_PlaceHolder);
        }
    }
 
    if(bRumble){                                                
        combo_run(RumbleOnce);
    }
    if(bRumbleTwice){                                                
        combo_run(RumbleTwice);
    }   
 
    if(bNuke && check_active(BUTTON_4,4000)){ // Will execute Nuke macro
        Nuke = TRUE;
    }
 
    if(Nuke){
        macro_run("Nuke.gmk");
        NukeRunning = TRUE;
        bRumbleTwice = TRUE;
    }
 
    if(macro_time() ==-1 && NukeRunning){
        bRumbleTwice = TRUE;
    }
}
combo GLITCH {
    printf("<b>NOT FOR PUBLIC USE");
    wait(0);
    glitchGame = FALSE;
    wait(0);
}
combo Party {
    set_val(BUTTON_11,100);
    wait(40);
    set_val(BUTTON_11,0);
    wait(300);
}
combo Sprint {
    wait(40);
    set_val(BUTTON_9,100);
    wait(40);
    set_val(BUTTON_9,0);
    wait(40);
    set_val(BUTTON_9,100);
    wait(40);
    set_val(BUTTON_9,0);
    wait(0);
    run = FALSE;
}
combo ReloadNow {
    //if(LogStat)printf("<b>Reloading");
    wait(0);
    Reloading = TRUE;
    wait(856);
    Reloading = FALSE;
//    if(LogStat)printf("Rumble Timer:<b> %d</b> ms",RumbleTimer);
}
combo RumbleOnce {
    ffb_set(FFB_1, 80.0, 300);
    wait(0);
    wait(300);
      ffb_reset();
      wait(0);
    ColorLED('G');
    wait(0);
    printf("Rapid Fire: <b>ON");
    wait(0);
    bRumble = FALSE;
}
combo RumbleTwice {
    ffb_set(FFB_2, 100.0, 100);
    wait(0);
    wait(100);
      ffb_reset();
      wait(0);
    ColorLED('R');
    wait(0);
    if (Nuke) ColorLED('P');
    wait(0);
    if(!UDF)printf("Rapid Fire: <b>OFF");
    if(UDF)printf("Rapid Fire: <b>AUTO");
    if(UDR)printf("Dynamic Recoil: <b>ON");
    wait(0);
    Nuke = FALSE;
    wait(0);
    bRumbleTwice = FALSE;
}
combo cRapidFire {
    if (bAutoADSDelay && bFirst && is_release(BUTTON_8))call(DelayFire);
    wait(0);
    if (bRapid && SwitchMode || bRapid && UDF)call(RapidFire);
    wait(0);
}
combo RapidFire {
    set_val(BUTTON_5,100);
    wait(HoldTime);
    set_val(BUTTON_5,0);
    wait(ReleaseTime);
}
combo DelayFire {
    set_val(BUTTON_5,0);
    wait(AutoADSDelay);
    wait(40);
    Aim = FALSE;
    bFirst = FALSE;
}
combo Heal {
    set_val(BUTTON_7, 100);// Heal
    wait(HealTime);
    set_val(BUTTON_7, 0);
    wait(500);
}
combo Reload {
    set_val(BUTTON_17, 100);// Reload
    wait(40);
    set_val(BUTTON_17, 0);
    wait(AutoReloadTime);
}
combo ReloadHeal {
    if (bAutoReload) call(Reload);
    if (bAutoHeal) call(Heal);
}
combo HealReload {
    if (bAutoHeal) call(Heal);
    if (bAutoReload) call(Reload);
}
 
void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
{
    float CurrentX = get_val(STICK_1_X);
    float CurrentY = get_val(STICK_1_Y);
    float MinARecoilFactor = MinARecoilPercent / 100.0;
    float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
    float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
    set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
}
void ColorLED(char Color) {
  static int8 old_Color;
  int8 Color1, Color2, Color3, Color4;
 
  if(Color==old_Color) return;
  else {
    led_reset();
    switch(Color){
      case 'W': Color3 = 100;        // White
      case 'P': Color2 = 100;        // Purple
      case 'B': Color1 = 100; break; // Blue
      case 'R': Color2 = 100; break; // Red
      case 'C': Color1 = 100;        // Cyan
      case 'G': Color3 = 100;        // Green
    }
    led_set(LED_1, (fix32)Color1, 0); led_set(LED_2, (fix32)Color2, 0);
    led_set(LED_3, (fix32)Color3, 0); led_set(LED_4, (fix32)Color4, 0);
 
    old_Color = Color;
  }
  return;
}
 
 
Last edited by USER101 on Mon Jul 01, 2019 6:05 pm, edited 11 times in total.
User avatar
USER101
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Mon Dec 03, 2018 5:45 pm

Re: Call of Duty Black Ops 4 / Simplified Open Source Script

Postby bonefisher » Sat Mar 30, 2019 2:06 am

Code: Select all
 
void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
{
    float CurrentX = get_val(STICK_1_X);
    float CurrentY = get_val(STICK_1_Y);
    float MinARecoilFactor = MinARecoilPercent / 100.0;
    float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
    //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
    float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
    set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
}
 

Here I updated and fixed issue with the anti recoil and original builder is AryanX
bonefisher
Major General
Major General
 
Posts: 5136
Joined: Thu Jan 29, 2015 10:49 am

Re: Call of Duty Black Ops 4 / Simplified Open Source Script

Postby Havoc89 » Sat Mar 30, 2019 12:30 pm

Any chance in you giving a newb like me a chance at asking what settings are you using within your recoil script as far as the recoil values and delay/timeout to work best with blackout? I’m using a xim apex also
Xim Apex, T2, PS4 Pro, Corsair K70 rgb silent switches, hyperx precision mat, zowie ec2-b csgo model, Samsung UE590 4K monitor, Asus 24” LED monitor, Acer nitro 5 laptop, Astro A40 Pro TR with mod kit
User avatar
Havoc89
Private First Class
Private First Class
 
Posts: 3
Joined: Sat Mar 23, 2019 4:18 am
Location: Waco TX

Re: Call of Duty Black Ops 4 / Simplified Open Source Script

Postby USER101 » Sun Mar 31, 2019 10:37 pm

bonefisher wrote:
Code: Select all
 
void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
{
    float CurrentX = get_val(STICK_1_X);
    float CurrentY = get_val(STICK_1_Y);
    float MinARecoilFactor = MinARecoilPercent / 100.0;
    float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
    //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
    float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
    set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
}
 

Here I updated and fixed issue with the anti recoil and original builder is AryanX


You are the man! I will add this to my next push and give the credit to you and AryanX. THANKS!!!
User avatar
USER101
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Mon Dec 03, 2018 5:45 pm

Re: Call of Duty Black Ops 4 / Simplified Open Source Script

Postby USER101 » Sun Mar 31, 2019 10:58 pm

Havoc89 wrote:Any chance in you giving a newb like me a chance at asking what settings are you using within your recoil script as far as the recoil values and delay/timeout to work best with blackout? I’m using a xim apex also


Sure thing. I normally set my Vertical anti recoil to around 18 or negative [-18] if you play inverted. Do not use the delay or timeout unless you are playing multiplayer with a specific weapon that requires it. For example, the spitfire recoil will falloff after about a second so if you set timeout to around 1000 ms your aim should stay pretty consistent. However, in Blackout you might pick up any weapon so you don't want your weapon changing recoil as you shoot. I use 18 because its not that much and is perfect for the MX9.. For me it's a good all around recoil compensator value.

As for the Blackout rapid fire mode I plan to change the main run time toggle in the future but for now if you are holding a semiautomatic weapon and turn it on the LED will be green. If you tap Y to switch weapons the LED will turn blue indicating that your rapid fire is temporarily disabled. Tapping Y again to switch weapons again will toggle rapid fire back on. I use this when I pickup a semiautomatic like the demon (witch is OP close up) and a fully automatic weapon such as the rampart. If you ever find yourself holding two fully auto weapons just disable rapid fire all together. If you are in blackout mode and the rapid fire is on the wrong weapon simply hold the weapon swap button for a second instead of tapping it and it will switch the rapid fire mode without switching your weapon.

Let me know if you have any other questions or if you would like to have something added.
User avatar
USER101
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Mon Dec 03, 2018 5:45 pm

Re: Call of Duty Black Ops 4 / Simplified Open Source Script

Postby USER101 » Sat Apr 06, 2019 12:20 am

bonefisher,
I am updating my script. Do I still need to add the following to the end of my script in order for this to work?

Code: Select all
main {
  set_val(STICK_1_X, clamp(get_val(STICK_1_X),-100f, 100f));
  set_val(STICK_1_Y, clamp(get_val(STICK_1_Y),-100f, 100f));
}


I am need to be able to apply a negative value. I still do not completely understand the math and I don't want to mess up my working code. Eventually I will go line by line and learn what you have done here :)

bonefisher wrote:
Code: Select all
 
void AntiRecoil(uint8 AxisToApply, float ARecoilToApply)
{
    float CurrentX = get_val(STICK_1_X);
    float CurrentY = get_val(STICK_1_Y);
    float MinARecoilFactor = MinARecoilPercent / 100.0;
    float MinARecoilToApply = MinARecoilFactor * ARecoilToApply;
    //This sets the ARecoil to be dependent on both X and Y axis movement. With more emphasis on Y
    float MovementARecoilToApply = (1.0 - MinARecoilFactor) * ((ARecoilToApply * (100.0 - sqrt(CurrentX*CurrentX + CurrentY*CurrentY))) / (100.0 + abs(CurrentX) + (CurrentY*CurrentY*0.5)));
    set_val(AxisToApply,clamp(MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply),-100.00,100.00 - MinARecoilToApply));
}
 

Here I updated and fixed issue with the anti recoil and original builder is AryanX
User avatar
USER101
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Mon Dec 03, 2018 5:45 pm

Re: Call of Duty Black Ops 4 / Simplified Open Source Script

Postby bonefisher » Sat Apr 06, 2019 12:35 am

Copy the whole thing I sent then replace the old one that's it nothing else!
bonefisher
Major General
Major General
 
Posts: 5136
Joined: Thu Jan 29, 2015 10:49 am

Re: Call of Duty Black Ops 4 / Simplified Open Source Script

Postby USER101 » Sun Apr 07, 2019 7:02 pm

UPDATE 2.05
-Added auto ADS
-Added auto ADS delay
-Added auto reload time
-Added auto stim
-Added recoil timeout
-Added presets
-Modified auto recoil code
-Added bonus content Nuke emblem
Last edited by USER101 on Thu May 02, 2019 1:11 am, edited 1 time in total.
User avatar
USER101
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Mon Dec 03, 2018 5:45 pm

Re: Call of Duty Black Ops 4 / Open Source Script

Postby USER101 » Thu May 02, 2019 1:05 am

UPDATE 2.07
-Added Users Rapid Fire(URF) auto rapid fire toggle
-Added Users Dynamic Recoil(UDR) auto ADS delay
User avatar
USER101
Sergeant Major
Sergeant Major
 
Posts: 104
Joined: Mon Dec 03, 2018 5:45 pm

Re: Call of Duty Black Ops 4 / Open Source Script

Postby ycksy » Mon May 13, 2019 4:24 am

Project looking awesome mate; will check this out over my weekend.
User avatar
ycksy
Sergeant Major
Sergeant Major
 
Posts: 73
Joined: Tue Aug 28, 2018 3:07 pm

Next

Return to Scripts Documentation (Titan Two)

Who is online

Users browsing this forum: No registered users and 9 guests