Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <xb1.gph>
- #define float fix32
- // Rapidfire values
- #define RF_HOLD 40
- #define RF_RELEASE 90
- //Anti Recoil value
- #define AR 26.00
- uint16 ARecoilDelay = 115;
- float MinARecoilPercent = 30.0;
- float StickNoise = 6.32;
- bool rapidfire;
- init {
- led(255,0,0);
- }
- main {
- // ADS + DPAD UP to toggle rapidfire
- if (is_active(7) && event_active(9)) {
- rapidfire = !rapidfire;
- if(rapidfire) led(0,255,0);
- else led(255,0,0);
- }
- if (get_actual(BUTTON_8) &&get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay){
- 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);
- AntiRecoil(STICK_1_Y, AR);
- }
- if(get_actual(4) && rapidfire) combo_run(RapidFire);
- ;
- ;
- if(is_active(XB1_UP) && is_active(XB1_DOWN)) {
- set_val(XB1_UP, 0); set_val(XB1_DOWN, 0);
- if(event_active(XB1_UP)) combo_run(prone);
- }
- }
- combo RapidFire {
- set_val(4, 100);
- wait(RF_HOLD);
- set_val(4, 0);
- wait(RF_RELEASE);
- }
- combo prone {
- set_val(XB1_B, 100);
- wait(300);
- }
- void led(int8 r, int8 g, int8 b) {
- led_set(LED_1, (fix32)b, 0);
- led_set(LED_2, (fix32)r, 0);
- led_set(LED_3, (fix32)g, 0);
- return;
- }
- 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));
- }
- bool run_flag;
- main
- {
- if(!get_actual(BUTTON_5) && !get_actual(BUTTON_8) && !run_flag &&
- get_val(STICK_2_Y) < -99.0 && time_active(STICK_2_Y) > 300) {
- run_flag = 1;
- combo_run(run);
- }else if(get_val(STICK_2_Y) > -99.0 && event_release(STICK_2_Y)) {
- run_flag = 0;
- }
- }
- combo run
- {
- set_val(BUTTON_9, 0.0);
- wait(200);
- set_val(BUTTON_9, 100.0);
- wait(400);
- set_val(BUTTON_9, 0.0);
- }
- bool toggle;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement