Advertisement
Bagura32rus

Cronus ДВА ПРОФИЛЯ

Jul 21st, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.42 KB | None | 0 0
  1. //Posted by , a member of the community in the CronusMAX Forums - https://cronusmax.com/forums
  2.  
  3. //Posted : Sunday 21st of July, 2019 15:15 UTC
  4.  
  5. int recoil_1 = 42;/*"ARecoil_V_Standing" profile 1 value*/int recoil_2 = 25;/*"ARecoil_V_Standing" profile 2 value*/
  6. int bUseAntiRecoil = TRUE;/*Use Anti-Recoil?*/
  7. int ARecoil_H_Standing = 0;/*Horizontal Anti-Recoil, -# = Left, +# = Right*/
  8. int ARecoil_V_Standing = 25;/*Vertical Anti-Recoil, -# = Up, +# = Down*/
  9. int ARecoilDelay = 75;/*Delay before Anti-Recoil*/
  10. int MinARecoilPercent = 30;/*Minimum Anti-Recoil*/
  11. int MinARecoilFactor; //Used for AntiRecoil function
  12. int MinARecoilToApply; //Used for AntiRecoil function
  13. int MovementARecoilToApply; //Used for AntiRecoil function
  14. int run_flag;/*AutoSprint toggle*/
  15. int toggle;/*RapidFire toggle*/
  16.  
  17.  
  18. init {
  19. deadzone(9, 10, DZ_CIRCLE, 6.32);/*Right Stick Deadzone radius 6.32*/
  20. deadzone(11, 12, DZ_CIRCLE, 6.32);/*Left Stick Deadzone radius 6.32*/
  21. }
  22.  
  23.  
  24. main {
  25. /*----------------------------Profile Switch----------------------------*/
  26. if(get_val(7) && event_press(13)) {/*If L2/LT when D-Up is pressed*/
  27. if(ARecoil_V_Standing == recoil_1) {/*If "ARecoil_V_Standing" is "recoil_1"*/
  28. ARecoil_V_Standing = recoil_2;/*"Arecoil_V_Standing" is "recoil_2"*/
  29. ARecoil_H_Standing = 0;/*"ARecoil_H_Standing" is 0*/
  30. ARecoilDelay = 75;/*"ARecoilDelay" is 75*/
  31. MinARecoilPercent = 30;/*"MinARecoilPercent" is 30*/
  32. }
  33. else {/*Otherwise*/
  34. ARecoil_V_Standing = recoil_1;/*"ARecoil_V_Standing" is "recoil_1"*/
  35. ARecoil_H_Standing = 9;/*"ARecoil_H_Standing" is 9*/
  36. ARecoilDelay = 115;/*"ARecoilDelay" is 115*/
  37. MinARecoilPercent = 45;/*"MinARecoilPercent" is 45*/
  38. }
  39. /*------------------------------Anti-Recoil-----------------------------*/
  40. if(bUseAntiRecoil) {/*If "bUseAntiRecoil" is True*/
  41. if(get_val(7) && get_val(4)) {/*If L2/LT and R2/RT are both pressed*/
  42. AntiRecoil(9, ARecoil_H_Standing);/*Run "AntiRecoil" function for Right Stick X*/
  43. AntiRecoil(10, ARecoil_V_Standing);/*Run "AntiRecoil" function for Right Stick Y*/
  44. }
  45. }
  46. /*-------------------------------Auto Run------------------------------*/
  47. 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*/
  48. run_flag = TRUE;/*"run_flag" is True*/
  49. combo_run(run);/*Run "AutoSprint" combo*/
  50. }
  51. else if(get_val(12) > -99 && event_release(12)) {/*When Left Stick released*/
  52. run_flag = FALSE;/*"run_flag" is False*/
  53. }
  54. /*------------------------------Rapid Fire-----------------------------*/
  55. // VIEW + RT to toggle rapidfire
  56. if(get_val(1) && event_active(4)) {/*If Select is pressed, when R2/RT is pressed*/
  57. toggle = !toggle;/*"toggle" changes states*/
  58. }
  59. if(toggle) {/*If "toggle" is True*/
  60. if(get_val(4)) {/*If R2 is pressed*/
  61. combo_run(Rapidfire);/*Run "RapidFire" combo*/
  62. }
  63. }
  64. }
  65.  
  66. combo run {
  67. set_val(8, 0);/*Release L3/LS*/
  68. wait(200);/*Wait 200ms*/
  69. set_val(8, 100);/*Press L3/LS*/
  70. wait(400);/*Hold 400ms*/
  71. set_val(8, 0);/*Release L3/LS*/
  72. }
  73.  
  74.  
  75. combo Rapidfire {
  76. set_val(4, 100);/*Fully press R2/RT*/
  77. wait(28);/*Hold 28 ms*/
  78. set_val(4, 0);/*Release R2/RT*/
  79. wait(16);/*Wait 16ms*/
  80. set_val(4, 0);/*Release R2/RT*/
  81. }
  82.  
  83.  
  84. function AntiRecoil(AxisToApply, ARecoilToApply) {/*Requires 2 components*/
  85. MinARecoilFactor = MinARecoilPercent / 100;/*"MinARecoilFactor" is "MinARecoilPercent" divided by 100*/
  86. MinARecoilToApply = MinARecoilFactor * ARecoilToApply;/*"MinARecoilToApply" is "MinARecoilFactor" times "ARecoilToApply"*/
  87. 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)))*/
  88. set_val(AxisToApply, MinARecoilToApply + MovementARecoilToApply + get_val(AxisToApply));/*Press "AxisToApply" ("MinARecoilToApply" plus "MovementARecoilToApply" plus "AxisToApply"'s amount)%*/
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement