Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Posted by , a member of the community in the CronusMAX Forums - https://cronusmax.com/forums
- //Posted : Sunday 21st of July, 2019 15:15 UTC
- int recoil_1 = 42;/*"ARecoil_V_Standing" profile 1 value*/int recoil_2 = 25;/*"ARecoil_V_Standing" profile 2 value*/
- int bUseAntiRecoil = TRUE;/*Use Anti-Recoil?*/
- int ARecoil_H_Standing = 0;/*Horizontal Anti-Recoil, -# = Left, +# = Right*/
- int ARecoil_V_Standing = 25;/*Vertical Anti-Recoil, -# = Up, +# = Down*/
- int ARecoilDelay = 75;/*Delay before Anti-Recoil*/
- int MinARecoilPercent = 30;/*Minimum Anti-Recoil*/
- int MinARecoilFactor; //Used for AntiRecoil function
- int MinARecoilToApply; //Used for AntiRecoil function
- int MovementARecoilToApply; //Used for AntiRecoil function
- int run_flag;/*AutoSprint toggle*/
- int toggle;/*RapidFire toggle*/
- init {
- deadzone(9, 10, DZ_CIRCLE, 6.32);/*Right Stick Deadzone radius 6.32*/
- deadzone(11, 12, DZ_CIRCLE, 6.32);/*Left Stick Deadzone radius 6.32*/
- }
- main {
- /*----------------------------Profile Switch----------------------------*/
- if(get_val(7) && event_press(13)) {/*If L2/LT when D-Up is pressed*/
- if(ARecoil_V_Standing == recoil_1) {/*If "ARecoil_V_Standing" is "recoil_1"*/
- ARecoil_V_Standing = recoil_2;/*"Arecoil_V_Standing" is "recoil_2"*/
- ARecoil_H_Standing = 0;/*"ARecoil_H_Standing" is 0*/
- ARecoilDelay = 75;/*"ARecoilDelay" is 75*/
- MinARecoilPercent = 30;/*"MinARecoilPercent" is 30*/
- }
- else {/*Otherwise*/
- ARecoil_V_Standing = recoil_1;/*"ARecoil_V_Standing" is "recoil_1"*/
- ARecoil_H_Standing = 9;/*"ARecoil_H_Standing" is 9*/
- ARecoilDelay = 115;/*"ARecoilDelay" is 115*/
- MinARecoilPercent = 45;/*"MinARecoilPercent" is 45*/
- }
- /*------------------------------Anti-Recoil-----------------------------*/
- if(bUseAntiRecoil) {/*If "bUseAntiRecoil" is True*/
- if(get_val(7) && get_val(4)) {/*If L2/LT and R2/RT are both pressed*/
- AntiRecoil(9, ARecoil_H_Standing);/*Run "AntiRecoil" function for Right Stick X*/
- AntiRecoil(10, ARecoil_V_Standing);/*Run "AntiRecoil" function for Right Stick Y*/
- }
- }
- /*-------------------------------Auto Run------------------------------*/
- if(!get_val(4) && !get_val(7) && !run_flag && get_val(12) < -99 && get_ptime(12) > 300) {/*If neither L2/LT or R2/RT are pressed, "run_flag" is false, and Left Stick is pushed Up at least 99% for more than 300ms*/
- run_flag = TRUE;/*"run_flag" is True*/
- combo_run(run);/*Run "AutoSprint" combo*/
- }
- else if(get_val(12) > -99 && event_release(12)) {/*When Left Stick released*/
- run_flag = FALSE;/*"run_flag" is False*/
- }
- /*------------------------------Rapid Fire-----------------------------*/
- // VIEW + RT to toggle rapidfire
- if(get_val(1) && event_active(4)) {/*If Select is pressed, when R2/RT is pressed*/
- toggle = !toggle;/*"toggle" changes states*/
- }
- if(toggle) {/*If "toggle" is True*/
- if(get_val(4)) {/*If R2 is pressed*/
- combo_run(Rapidfire);/*Run "RapidFire" combo*/
- }
- }
- }
- combo run {
- set_val(8, 0);/*Release L3/LS*/
- wait(200);/*Wait 200ms*/
- set_val(8, 100);/*Press L3/LS*/
- wait(400);/*Hold 400ms*/
- set_val(8, 0);/*Release L3/LS*/
- }
- combo Rapidfire {
- set_val(4, 100);/*Fully press R2/RT*/
- wait(28);/*Hold 28 ms*/
- set_val(4, 0);/*Release R2/RT*/
- wait(16);/*Wait 16ms*/
- set_val(4, 0);/*Release R2/RT*/
- }
- function AntiRecoil(AxisToApply, ARecoilToApply) {/*Requires 2 components*/
- MinARecoilFactor = MinARecoilPercent / 100;/*"MinARecoilFactor" is "MinARecoilPercent" divided by 100*/
- MinARecoilToApply = MinARecoilFactor * ARecoilToApply;/*"MinARecoilToApply" is "MinARecoilFactor" times "ARecoilToApply"*/
- MovementARecoilToApply = (1 - MinARecoilFactor) * ((ARecoilToApply * (100 - sqrt(get_val(9)*get_val(9) + get_val(10)*get_val(10)))) / (100 + abs(get_val(9)) + (get_val(10)*get_val(10)*0.5)));/*"MovementARecoilToApply" is (1 minus "MinARecoilFactor") times (("ARecoilToApply" times (100 minus the square root of (RX * RX + RY * RY))) divided by (100 plus the absolute value of RX plus RY times RY times 0.5)))*/
- set_val(AxisToApply, MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply));/*Press "AxisToApply" ("MinARecoilToApply" plus "MovementARecoilToApply" plus "AxisToApply"'s amount)%*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement