/*
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// |=====================| @ |=============| @@@@@ |=====| |=======| @@@
// |=====================| @ |====| |====| @@@@ |=====| |=======| @@@
// @@@@@@ |=====| @@@@@@@@@@ |====| |=====| @@@ |=====| |=======| @@@
// @@@@@@ |=====| @@@@@@@@@@ |==============| @@@@ |=====| |===/ /=| @@@
// @@@@@@ |=====| @@@@@@@@@@ |====| |=====| @@@ |======| |===/ /==| @@@
// @@@@@@ |=====| @@@@@@@@@@ |====| |=====| @@@@ |===========/ /===| @@@
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Personal Script
-L3 left hand curry slide R3 right hand curry slide
-Shoot off rumble with square or shot aim with L1.
-Can toggle R2+L1 shooting by holding Options+R1
-Hold L2 & R2 for Advanced Defense. LED turns red while active
-Hold R2 & Tap R1 for quick stop
*/
define Green = 3;
define Yellow = 6;
define LED_OFF = 0;
define Red = 2;
//=========================================================//
//LED COLOURS//======Don't Touch===========================//
//=========================================================//
data( 1,
2,0,0,0 , //1. Blue
0,2,0,0 , //2. Red
0,0,2,0 , //3. Green
0,0,0,2 , //4. Pink
2,0,2,0 , //5. SkyBlue
0,2,2,0 , //6. Yellow
2,2,2,2); //7. White
//=========================================================//
//SAVE FEATURE//====Last value is default==================//
//=========================================================//
int MeterPosition = 16;
int CareerShooting = 0;
int release = 21;
int defenseOnOff = TRUE;
int blockButton;
int timeBetweenTriggers;
int Dribbles = 1;
//=========================================================//
define MAX_RANGE = 4700;
main
{
if(get_rumble(RUMBLE_A) || get_rumble(RUMBLE_B)) {combo_run(wait_time);}
if(CareerShooting) LED_CM(Red);
else LED_CM(Green);
// -- Advanced Defense
if(get_val(PS4_L2) && get_val(PS4_R2))
{
if(FindMax(abs(get_val(PS4_LX)),abs(get_val(PS4_LY))) > 15)
{
timeBetweenTriggers = MAX_RANGE - (FindMax(abs(get_val(XB1_LX)),abs(get_val(XB1_LY))) * 3);
combo_run(ALTERNATE_TRIGGERS);
combo_run(RUMBLE);
}
LED_CM(Red);
}
if(event_release(PS4_R2) || event_release(PS4_L2) && CareerShooting == 0)
{
LED_CM(Green);
}
if(CareerShooting) LED_CM(Yellow); //Green LED means Shoot aim with R2+L1
else LED_CM(Green); //No LED means Shoot aim with L1
// -- Toggles
if(get_val(PS4_OPTIONS))
{
if(event_press(PS4_L1))
{
CareerShooting=!CareerShooting;
set_val(PS4_L1, 0);
}
}
// -- Shooting
if(get_val(PS4_L1))
{
if(event_press(PS4_LEFT))
{
MeterPosition--;
combo_run(RUMBLE);
}
if(event_press(PS4_RIGHT))
{
MeterPosition++;
combo_run(RUMBLE);
}
}
if (CareerShooting == 1) //If "Meter" script is active, run commands below
{
if(get_val(PS4_R2))
{
if(get_val(PS4_L1))
{
set_val(PS4_RX, MeterPosition);
set_val(PS4_RY,100);
}
}
}
if (CareerShooting == 0) //If "No Meter" script is active, run commands below
{
if(get_val(PS4_L1))
{
set_val(PS4_RX, MeterPosition);
set_val(PS4_RY,100);
}
}
if(get_val(PS4_SQUARE))
{
if(event_press(PS4_LEFT))
{
timeBetweenTriggers--;
combo_run(RUMBLE);
}
if(event_press(PS4_RIGHT))
{
timeBetweenTriggers++;
combo_run(RUMBLE);
}
}
if(get_val(PS4_OPTIONS)) //Hold Options
{
if(event_press(PS4_SQUARE)) //If Options is held and (PS4)Square/(XBOX)X is pressed, toggle Meter/No Meter Script
{
CareerShooting =!CareerShooting ;
set_val(PS4_SQUARE, 0);
combo_run(RUMBLE);
}
}
if(Dribbles == 1)
{
if (get_val(PS4_R2))
{
if (event_press(PS4_UP))
{
combo_run(Takeover);
}
}
}
// -- Dribbles
if(get_val(PS4_R2))
{
if (event_press(PS4_L3))
{
combo_run(LHExplosiveBB);
}
if (event_press(PS4_R3))
{
combo_run(RHExplosiveBB);
}
}
if(get_val(PS4_L3))
{
combo_run(LHSLIDE);
set_val(PS4_L3, 75);
}
if(get_val(PS4_R3))
{
combo_run(RHSLIDE);
set_val(PS4_R3, 75);
}
if(combo_running(StickJumper)){set_val(PS4_RY,100)}
// -- Quickstop
if((get_val(PS4_LX))<0 && get_val(PS4_R2) && event_press(PS4_R1))
{
blockButton = PS4_R1;
combo_run(QuickStopLeftHand);
}
if((get_val(PS4_LX))>0 && get_val(PS4_R2) && event_press(PS4_R1))
{
blockButton = PS4_R1;
combo_run(QuickStopRightHand);
}
//--block output
if(blockButton)
{
if(event_release(blockButton))
{
blockButton = 0;
}
else
{
set_val(blockButton,0);
}
}
}
//=======================================
// Dribble Moves//=======================
//=======================================
combo LHSLIDE// Curryslide Left //
{
set_val(PS4_RX, 100);
set_val(PS4_RY, 75);
wait(300);
}
combo RHSLIDE// Curryslide Right //
{
set_val(PS4_RX, -100);
set_val(PS4_RY, 75);
wait(400);
}
combo RHExplosiveBB
{
set_val(PS4_RX, -75);
set_val(PS4_RY, 75);
wait(80);
set_val(PS4_LX, -75);
set_val(PS4_LY, -75);
wait(100);
set_val(PS4_LX, -75);
set_val(PS4_LY, -75);
wait(200);
}
combo LHExplosiveBB
{
set_val(PS4_RX, 75);
set_val(PS4_RY, 75);
wait(80);
set_val(PS4_LX, 75);
set_val(PS4_LY, -75);
wait(100);
set_val(PS4_LX, 75);
set_val(PS4_LY, -75);
wait(200);
}
combo QuickStopLeftHand
{
set_val(PS4_RX, 100);
wait(100);
}
combo QuickStopRightHand
{
set_val(PS4_RX, -100);
wait(100);
}
//=======================================
// Stick Shooting//======================
//=======================================
combo wait_time
{
wait(release);
set_val(PS4_L2, 100);
set_val(PS4_SQUARE, 0):
wait(100);
set_val(PS4_L2, 0);
wait(200):
}
combo Takeover
{
set_val(PS4_R3, 100);
wait(100);
set_val(PS4_R3, 0);
wait(100);
}
combo StickMovement
{
set_val(PS4_RX, MeterPosition);
wait(60);
set_val(PS4_RX, -40);
wait(20);
set_val(PS4_RX, -35);
wait(20);
set_val(PS4_RX, -30);
wait(20);
set_val(PS4_RX, -25);
wait(20);
set_val(PS4_RX, -20);
wait(20);
set_val(PS4_RX, -15);
wait(20);
set_val(PS4_RX, -10);
wait(20);
set_val(PS4_RX, -5);
wait(20);
set_val(PS4_RX, 0);
wait(20);
set_val(PS4_RX, 5);
wait(20);
set_val(PS4_RX, 6);
wait(20);
set_val(PS4_RX, 7);
wait(20);
set_val(PS4_RX, 8);
wait(20);
set_val(PS4_RX, 9);
wait(20);
set_val(PS4_RX, 10);
wait(20);
set_val(PS4_RX, 11);
wait(20);
set_val(PS4_RX, 12);
wait(20);
set_val(PS4_RX, 13);
wait(20);
set_val(PS4_RX, 14);
wait(20);
set_val(PS4_RX, 17);
wait(20);
}
combo StickJumper
{
call(StickMovement);
set_val(PS4_RX, MeterPosition);
wait(900);
}
combo LongStickJumper
{
wait(700);
call(StickMovement);
set_val(PS4_RX, MeterPosition);
wait(900);
}
combo RUMBLE
{
set_rumble(RUMBLE_A, 50);
wait(200);
set_rumble(RUMBLE_A, 0);
}
/*
============================================================================================================================
Defense
============================================================================================================================
*/
combo ALTERNATE_TRIGGERS {
set_val(XB1_LT,100);
set_val(XB1_RT,0);
wait(30);
set_val(XB1_LT,0);
set_val(XB1_RT,0);
wait(timeBetweenTriggers);
set_val(XB1_RT,100);
set_val(XB1_LT,0);
wait(30);
set_val(XB1_LT,0);
set_val(XB1_RT,0);
wait(timeBetweenTriggers);
}
/*
============================================================================================================================
FindMax
============================================================================================================================
*/
function FindMax(a,b) {
if(a > b){
return a;
}
return b;
}
//=========================================================
//LED COLOURS//============================================
//=========================================================
function LED_CM(Colour)
{
set_led(LED_1,dbyte(( Colour * 4)- 3 ));
set_led(LED_2,dbyte(((Colour * 4)- 3) + 1));
set_led(LED_3,dbyte(((Colour * 4)- 3) + 2));
set_led(LED_4,dbyte(((Colour * 4)- 3) + 3));
}