Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.94 KB | None | 0 0
  1. int auto_spot;
  2. int spawn_in;
  3. int rapidfire;
  4. int anti_recoil;
  5. int time_to_stabalize; // The weapon in-game will start to stabilize on its own, so the amount of recoil required when you first start firing is higher than when you have been firing for an extended time.
  6.  
  7. int recoil_amount;
  8. int recoil_amount2;
  9. int ADJUSTED_RECOIL; // Yes, I know this isn't a constant and is in all caps. I have it this way to make it easier to read in the code so you know that ADJUSTED_RECOIL is the value ACTUALLY applied to the stick.
  10.  
  11.  
  12. define MOUSE_DEADZONE = 25; // This is the deadzone used in X-aim. If you are using a regular controller, set this value to match the IN_GAME_DEADZONE.
  13. define IN_GAME_DEADZONE = 22; /* This is the lowest thumbstick value the game will see, regardless of our Xaim deadzone.
  14. This is used for our recoil release when the amount of anti recoil applied is less than the game will see,
  15. Allowing us to aim down instead of applying an amount of anti recoil like 19 or some other crap that isn't going to be seen.
  16. This is called "Center Deadzone" in Battlefield 1 */
  17.  
  18.  
  19. // These are just added so you can switch between different guns by pressing an extra button.
  20. define WEAPON_1a /* lewis gun optical */ = 26; //press cemu_extra 7
  21. define WEAPON_1b = 24;
  22. define WEAPON_1_WAIT = 600;
  23.  
  24. define WEAPON_2a /* rigotti & mp18 optical */ = 28; //press cemu_extra 8
  25. define WEAPON_2b = 26;
  26. define WEAPON_2_WAIT = 600;
  27.  
  28. define WEAPON_3a /* automatico trench */ = 32; //press cemu_extra 9
  29. define WEAPON_3b = 29;
  30. define WEAPON_3_WAIT = 600;
  31. main {
  32.  
  33. if (get_val(XB1_RS)) combo_run (CUTABITCH);
  34.  
  35. if (event_press(CEMU_EXTRA4)) rapidfire = !rapidfire;
  36. if((rapidfire) && (get_val(XB1_RT))) combo_run(RAPIDFIRE);
  37.  
  38. if (event_press(CEMU_EXTRA1)) auto_spot = !auto_spot;
  39. if (auto_spot) {
  40. combo_run (SPOT);
  41.  
  42. if (!spawn_in && (event_press(CEMU_EXTRA2))) {
  43. spawn_in = !spawn_in;
  44. }
  45.  
  46. if (spawn_in && event_press(XB1_LS)) {
  47. spawn_in = !spawn_in;
  48. }
  49. }
  50.  
  51. if (event_press(CEMU_EXTRA5)) anti_recoil = !anti_recoil; // Toggle Anto_Recoil On/Off
  52.  
  53. if (event_press(CEMU_EXTRA7)) {
  54. recoil_amount = WEAPON_1a;
  55. recoil_amount2 = WEAPON_1b;
  56. time_to_stabalize = WEAPON_1_WAIT;
  57. }
  58. if (event_press(CEMU_EXTRA8)) {
  59. recoil_amount = WEAPON_2a;
  60. recoil_amount2 = WEAPON_2b;
  61. time_to_stabalize = WEAPON_2_WAIT;
  62. }
  63. if (event_press(CEMU_EXTRA9)) {
  64. recoil_amount = WEAPON_3a;
  65. recoil_amount2 = WEAPON_3b;
  66. time_to_stabalize = WEAPON_3_WAIT;
  67. }
  68.  
  69. if (anti_recoil) {
  70. if (get_val(XB1_RT)) combo_run(ANTI_RECOIL);
  71. if (get_val(XB1_RX) >= MOUSE_DEADZONE) combo_stop(ANTI_RECOIL);
  72. if (get_val(XB1_RX) <= inv(MOUSE_DEADZONE)) combo_stop(ANTI_RECOIL);
  73. }
  74.  
  75. }// end of main
  76.  
  77.  
  78. combo SPOT {
  79.  
  80. if (!spawn_in) {
  81. set_val(XB1_RB,100);
  82. }
  83. else {
  84. set_val(XB1_A,100);
  85. }
  86. wait(100);
  87. wait(901);
  88. }
  89.  
  90. combo RAPIDFIRE {
  91. set_val(PS4_R2,100);
  92. wait(45);
  93. set_val(PS4_R2,0);
  94. wait(60);
  95. }
  96.  
  97. combo CUTABITCH {
  98. set_val(XB1_RS,100);
  99. wait(45);
  100. set_val(XB1_RS,0);
  101. wait(60);
  102. }
  103.  
  104. combo ANTI_RECOIL {
  105.  
  106. if (get_ptime(XB1_RT) > time_to_stabalize) {
  107. ADJUSTED_RECOIL = (recoil_amount2);
  108. }
  109. else {
  110. ADJUSTED_RECOIL = recoil_amount;
  111. }
  112.  
  113. if (get_val(XB1_RY) < inv(MOUSE_DEADZONE)) { // if RY is less than -25 (Aiming_Down with regular Y-axis in-game - pushing thumbstick up)
  114. ADJUSTED_RECOIL = (recoil_amount + (get_val(XB1_RY) + MOUSE_DEADZONE));
  115. }
  116. if (get_val(XB1_RY) > (MOUSE_DEADZONE)) { // if RY is more than +25 (Aiming_UP with regular Y-axis in-game - pulling thumbstick down)
  117. ADJUSTED_RECOIL = (recoil_amount - (get_val(XB1_RY) - MOUSE_DEADZONE));
  118. }
  119.  
  120. if (ADJUSTED_RECOIL < IN_GAME_DEADZONE) combo_stop(ANTI_RECOIL);
  121.  
  122. else {
  123. set_val(XB1_RY, ADJUSTED_RECOIL);
  124. }
  125.  
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement