Advertisement
Bagura32rus

Cronus

Jul 11th, 2019
904
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Posted by Crispy Croco, a member of the community in the CronusMAX Forums - https://cronusmax.com/forums
  2.  
  3. //Posted : Thursday 11th of July, 2019 14:58 UTC  
  4.  
  5. int UseAntiRecoil = TRUE;
  6. int ARecoil_H_Standing = 0; //Horizontal Anti-Recoil, -# = Left, +# = Right
  7. int ARecoil_V_Standing = 25; //Vertical Anti-Recoil, -# = Up, +# = Down
  8. int ARecoilDelay = 75; //Delay before Anti-Recoil
  9. int MinARecoilPercent = 30; //Minimum Anti-Recoil
  10. int MinARecoilFactor; //Used for AntiRecoil function
  11. int MinARecoilToApply; //Used for AntiRecoil function
  12. int MovementARecoilToApply; //Used for AntiRecoil function
  13. int run_flag; //AutoSprint toggle
  14. int toggle; //RapidFire toggle
  15.  
  16. init {
  17.     deadzone(9,10,6,32); //Right Stick Deadzone, X = 6, Y = 32
  18. }
  19.  
  20. main {
  21.     if(UseAntiRecoil) { //If "UseAntiRecoil" is True
  22.         if(get_val(7) && get_val(4) && get_ptime(4) >= ARecoilDelay) { //If L2/LT is pressed and R2/RT is pressed at least "ARecoilDelay"ms  
  23.             if(get_val(7) && get_val (4)) { //If L2/LT and R2/RT are pressed
  24.                  AntiRecoil(9, ARecoil_H_Standing); //Run "AntiRecoil" function for Right Stick X
  25.                  AntiRecoil(10, ARecoil_V_Standing); //Run "AntiRecoil" function for Right Stick Y
  26.             }
  27.         }
  28.     }
  29.     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
  30.         run_flag = TRUE; //"run_flag" is True
  31.         combo_run (AutoSprint); //Run "AutoSprint" combo
  32.     }
  33.     else if(get_val (12) > -99 && event_release(12)) { //When Right Stick released
  34.         run_flag = FALSE; //"run_flag" is False
  35.     }
  36.     if(get_val (1) && event_press(4)) { //If Select is pressed, when R2/RT is pressed
  37.         toggle = !toggle; //"toggle" changes states
  38.     }
  39.     if(toggle) { //If "toggle" is True
  40.         if(get_val (4)) { //If R2 is pressed
  41.             combo_run (Rapidfire); //Run "RapidFire" combo
  42.         }
  43.     }
  44. }
  45.  
  46. combo AutoSprint {
  47.     set_val (8, 0); //Release L3/LS
  48.     wait (200); //Wait 200ms
  49.     set_val (8, 100); //Press L3/LS
  50.     wait (400); //Hold 400ms
  51.     set_val (8, 0); //Release L3/LS
  52. }
  53.  
  54. combo Rapidfire {
  55.     set_val (4, 100); //Fully press R2/RT
  56.     wait (28); //Hold 28 ms
  57.     set_val (4, 0); //Release R2/RT
  58.     wait (16); //Wait 16ms
  59.     set_val (4, 0); //Release R2/RT
  60. }
  61.  
  62. function AntiRecoil(AxisToApply, ARecoilToApply) { //Requires 2 components
  63.     MinARecoilFactor = MinARecoilPercent / 100; //"MinARecoilFactor" is "MinARecoilPercent" divided by 100
  64.     MinARecoilToApply = MinARecoilFactor * ARecoilToApply; //"MinARecoilToApply" is "MinARecoilFactor" times "ARecoilToApply"
  65.     MovementARecoilToApply = (1 - MinARecoilFactor) * ((ARecoilToApply * (100 - isqrt(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)))
  66.     set_val(AxisToApply, MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply)); //Press "AxisToApply" ("MinARecoilToApply" plus "MovementARecoilToApply" plus "AxisToApply"'s amount)%
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement