Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Made by @tetris
- I've developed this script with the assistance of ChatGPT and Gemini. I made the idea, and they provided valuable coding support.
- This script automates rhythm shooting in NBA 2K25 by remapping the right stick to the SQUARE/X button. While it doesn't guarantee green shots, it can help you execute rhythm shots more efficiently.
- How it works: When you press and hold SQUARE/X, the script automatically flicks the right stick downwards. Releasing SQUARE/X flicks it upwards. Timing is crucial for success.
- Timing tips:
- * Adjust your visual cue settings to "release."
- * In-game, shoot as if using "setpoint" for a perfect timing.
- * Experiment with the script's "28" line values to find the optimal tempo for your build and jumpshot. Decrease the value for slower tempos and increase it for faster ones.
- * Test the script in various scenarios like quickstops, off-the-dribble, catch-and-shoot, and pump fakes.
- Additional notes:
- * Use L1/LB to press SQUARE/X for steals or normal shots.
- SCRIPT CONTROLS:
- RHYTHM is activated by Holding LT/L2 and Pressing the MENU button
- UP OR DOWN ON D-PAD TO TURN RHYTHM ON OR OFF
- WHILE IN RHYTHM PRESS A BUTTON TO FOR WAIT TIME MENU
- LT and UP or DOWN D-PAD for +-1
- LT and LEFT OR RIGHT D-PAD for +-10
- Back out of the menu with the B button.
- MAKE SURE RHYTHM is ENABLED
- */
- //██████████████████████████████████████████████████████████████████
- int square_button;
- int wait_time = 30;
- //██████████████████████████████████████████████████████████████████
- const string Misc[] = { "On" , "Off" , "2K25" , "Made By" , "TETRIS" , "KillSwitch" , "Enabled" , "Disabled" , "" };
- const string ModNames[] = { "Rhythm","" };
- const string ValNames[] = { "wait_time","" };
- define AmountOfMods = 1
- define AmountOfValues = 3;
- int DisplayTitle = TRUE;
- int ScreenSaver, BlankScreen, ModMenu, DisplayMenu, EditMenu, Toggle, ValNameIdx, ModNameIdx, KillSwitch, Rhythm;
- //////////////////////////////////////////////////////
- // MAIN BLOCK
- //
- /////////////////////////////////////////////////////
- main{
- set_val(TRACE_1,wait_time);
- if(get_ival(PS4_L2)) {
- if(event_press(PS4_OPTIONS)) {
- ModMenu = TRUE;
- DisplayMenu = TRUE;
- EditMenu = FALSE;
- if(!ModMenu) DisplayTitle = TRUE;}
- if(event_press(PS4_PS)){
- KillSwitch =! KillSwitch;
- combo_run(KillSwitch)}
- set_val(PS4_OPTIONS,0);
- set_val(PS4_PS,0);}
- if(!DisplayTitle) {
- if(ModMenu) {
- ModNameIdx = MenuNavigation(ModNameIdx,0,0);
- Rhythm = ToggleSwitch(ModNameIdx == 0,Rhythm);
- }
- if(EditMenu) {
- ValNameIdx = MenuNavigation(ValNameIdx,0,0);
- wait_time = EditValues(ValNameIdx , 0, wait_time , 1, 2000);
- if(ModNameIdx == 0) ValNameIdx = cycle(ValNameIdx,0,0); } }
- if(DisplayMenu){
- cls_oled(OLED_BLACK);
- rect_oled(0, 0, OLED_WIDTH, OLED_HEIGHT, OLED_BLACK, OLED_WHITE);
- line_oled(0, 27, OLED_WIDTH - 1, 27, 1, OLED_WHITE);
- if(EditMenu) {
- print(center_x(get_valName_chars(ValNameIdx), OLED_FONT_MEDIUM_WIDTH),7,OLED_FONT_MEDIUM,OLED_WHITE,ValNames[ValNameIdx]); }
- else if(ModMenu) {
- print(center_x(get_modName_chars(ModNameIdx), OLED_FONT_MEDIUM_WIDTH),7,OLED_FONT_MEDIUM,OLED_WHITE,ModNames[ModNameIdx]);
- if(Toggle == 1)
- print(center_x(get_misc_chars(0), OLED_FONT_MEDIUM_WIDTH),37,OLED_FONT_MEDIUM,OLED_WHITE,Misc[0]);
- else if(Toggle == 0)
- print(center_x(get_misc_chars(1), OLED_FONT_MEDIUM_WIDTH),37,OLED_FONT_MEDIUM,OLED_WHITE,Misc[1]); }
- DisplayMenu = FALSE; }
- if(!ModMenu && !EditMenu) {
- if(DisplayTitle) {
- cls_oled(OLED_BLACK);
- rect_oled(0, 0, OLED_WIDTH, OLED_HEIGHT, OLED_BLACK, OLED_WHITE);
- print(center_x(get_misc_chars(2), OLED_FONT_SMALL_WIDTH),7,OLED_FONT_SMALL,OLED_WHITE,Misc[2]);
- print(center_x(get_misc_chars(3), OLED_FONT_SMALL_WIDTH),22,OLED_FONT_SMALL,OLED_WHITE,Misc[3]);
- print(center_x(get_misc_chars(4), OLED_FONT_SMALL_WIDTH),37,OLED_FONT_SMALL,OLED_WHITE,Misc[4]);
- print(center_x(get_misc_chars(5), OLED_FONT_SMALL_WIDTH),50,OLED_FONT_SMALL,OLED_WHITE,Misc[5]);
- DisplayTitle = FALSE;
- ScreenSaver = TRUE; }
- if(ScreenSaver) {
- BlankScreen += get_rtime();
- if(BlankScreen >= 5000) {
- cls_oled(OLED_BLACK);
- BlankScreen = 0;
- ScreenSaver = TRUE; } } }
- if(!KillSwitch){
- if(!Rhythm){colourled(0)}
- if(Rhythm){
- if (get_val(PS4_SQUARE)) {
- if (!square_button) {
- square_button = 1;
- }
- set_val(PS4_RY, 100);
- set_val(PS4_SQUARE, 0);
- set_val(PS4_R2, 0);
- } else {
- if (square_button) {
- square_button = 0;
- set_val(PS4_RY, 0);
- combo_run(rs_up_combo);
- }
- set_val(PS4_SQUARE, 0);
- }
- if (get_val(PS4_L1)) {
- // Block L1 output
- set_val(PS4_L1, 0);
- // Activate SQUARE output
- set_val(PS4_SQUARE, 100);
- }
- if (!square_button) {
- set_val(PS4_RY, get_val(PS4_RY));
- }
- }
- if (Rhythm) { colourled(1) }
- }
- }
- /////////////////////////////////////////////////////////////////////////////
- /// COMBO BLOCK
- /////////////////////////////////////////////////////////////////////////////
- // Combo for RS Up with delay and display
- combo rs_up_combo {
- if (!DisplayMenu && !ModMenu && !EditMenu) {
- show_value_OLED (0, wait_time)
- }
- wait(wait_time); // Use the adjustable wait_time here
- set_val(PS4_RY, -100); // Move RS Up
- wait(110); // Wait to ensure the game registers RS Up
- set_val(PS4_RY, 0); // Reset Right Stick to neutral after RS Up
- }
- combo save {
- save_edit();
- }
- /////////////////////////////////////////////////////////////////////////////
- /// FUNCTIONS
- /////////////////////////////////////////////////////////////////////////////
- function show_value_OLED (idPoswait_time, valuewait_time) {
- cls_oled(OLED_BLACK);
- rect_oled(0, 0, OLED_WIDTH, OLED_HEIGHT, OLED_BLACK, OLED_WHITE);
- line_oled(0, 27, OLED_WIDTH - 1, 27, 1, OLED_WHITE);
- print(center_x(get_valName_chars(idPoswait_time), OLED_FONT_MEDIUM_WIDTH),7,OLED_FONT_MEDIUM,OLED_WHITE,ValNames[idPoswait_time]);
- number_to_string(valuewait_time,find_digits(valuewait_time))
- }
- function save_edit() {
- set_pvar(SPVAR_1, wait_time);
- }
- function MenuNavigation(f_modorval, f_min, f_max) {
- if(get_val(PS4_L2) <= 50) {
- if(event_press(PS4_RIGHT)) {
- f_modorval = cycle(f_modorval + 1, f_min, f_max);
- DisplayMenu = TRUE;
- }
- if(event_press(PS4_LEFT)) {
- f_modorval = cycle(f_modorval - 1, f_min, f_max);
- DisplayMenu = TRUE;
- }
- set_val(PS4_RIGHT, 0);
- set_val(PS4_LEFT, 0);
- }
- if(f_modorval == 0) {
- if(event_press(PS4_CROSS)) {
- ValNameIdx = AmountOfValues + 1;
- EditMenu = TRUE;
- ModMenu = FALSE;
- DisplayMenu = TRUE;
- }
- set_val(PS4_CROSS, 0);
- }
- if(ModMenu) {
- if(event_press(PS4_CIRCLE)) {
- DisplayTitle = TRUE;
- ModMenu = FALSE;
- DisplayMenu = FALSE;
- }
- set_val(PS4_CIRCLE, 0);
- }
- if(EditMenu) {
- if(event_press(PS4_CIRCLE)) {
- EditMenu = FALSE;
- ModMenu = TRUE;
- DisplayMenu = TRUE;
- }
- set_val(PS4_CIRCLE, 0);
- }
- return f_modorval;
- }
- function ToggleSwitch(f_name, f_val) {
- if(f_name) {
- if(event_press(PS4_UP) || event_press(PS4_DOWN)) {
- f_val = !f_val;
- DisplayMenu = TRUE;
- }
- Toggle = f_val;
- set_val(PS4_UP, 0);
- set_val(PS4_DOWN, 0);
- }
- return f_val;
- }
- function EditValues(f_idx, f_num, ValueIndex, ValueIndexMin, ValueIndexMax) {
- if(f_num == f_idx) {
- if(get_val(PS4_L2) >= 75) {
- if(event_press(PS4_UP)) {
- ValueIndex = cycle(ValueIndex + 1, ValueIndexMin, ValueIndexMax);
- DisplayMenu = TRUE;
- combo_run(save);
- }
- if(event_press(PS4_DOWN)) {
- ValueIndex = cycle(ValueIndex - 1, ValueIndexMin, ValueIndexMax);
- DisplayMenu = TRUE;
- combo_run(save);
- }
- set_val(PS4_UP, 0);
- set_val(PS4_DOWN, 0);
- }
- if(get_ival(PS4_L2) >= 75) {
- if(event_press(PS4_RIGHT)) {
- ValueIndex = cycle(ValueIndex + 10, ValueIndexMin, ValueIndexMax);
- DisplayMenu = TRUE;
- combo_run(save);
- }
- if(event_press(PS4_LEFT)) {
- ValueIndex = cycle(ValueIndex - 10, ValueIndexMin, ValueIndexMax);
- DisplayMenu = TRUE;
- combo_run(save);
- }
- set_val(PS4_RIGHT, 0);
- set_val(PS4_LEFT, 0);
- }
- number_to_string(ValueIndex, find_digits(ValueIndex));
- }
- return ValueIndex;
- }
- combo KillSwitch {
- cls_oled(OLED_BLACK);
- if(KillSwitch) {
- print(center_x(get_misc_chars(6), OLED_FONT_SMALL_WIDTH), 15, OLED_FONT_SMALL, OLED_WHITE, Misc[6]);
- print(center_x(get_misc_chars(7), OLED_FONT_SMALL_WIDTH), 30, OLED_FONT_SMALL, OLED_WHITE, Misc[7]);
- }
- if(!KillSwitch) {
- print(center_x(get_misc_chars(6), OLED_FONT_SMALL_WIDTH), 15, OLED_FONT_SMALL, OLED_WHITE, Misc[6]);
- print(center_x(get_misc_chars(8), OLED_FONT_SMALL_WIDTH), 30, OLED_FONT_SMALL, OLED_WHITE, Misc[8]);
- }
- wait(1500);
- DisplayTitle = TRUE;
- }
- function cycle(f_val, f_lo, f_hi) {
- if(f_val > f_hi) return f_lo;
- if(f_val < f_lo) return f_hi;
- return f_val;
- }
- function get_misc_chars(f_idx) {
- if(Misc[f_idx + 1] != -1)
- return Misc[f_idx + 1] - Misc[f_idx] - 1;
- return sizeof(Misc) - Misc[f_idx];
- }
- function get_modName_chars(f_idx) {
- if(ModNames[f_idx + 1] != -1)
- return ModNames[f_idx + 1] - ModNames[f_idx] - 1;
- return sizeof(ModNames) - ModNames[f_idx];
- }
- function get_valName_chars(f_idx) {
- if(ValNames[f_idx + 1] != -1)
- return ValNames[f_idx + 1] - ValNames[f_idx] - 1;
- return sizeof(ValNames) - ValNames[f_idx];
- }
- function center_x(f_chars, f_font) {
- return (OLED_WIDTH / 2) - ((f_chars * f_font) / 2);
- }
- function number_to_string(value, f_digits) {
- i = 1;
- c_val = 10000;
- if(value < 0) {
- putc_oled(i, 45);
- i += 1;
- value = abs(value);
- }
- for(c = 5; c >= 1; c--) {
- if(f_digits >= c) {
- putc_oled(i, ASCII_NUM[value / c_val]);
- value = value % c_val;
- i += 1;
- if(c == 4) {
- putc_oled(i, 44);
- i += 1;
- }
- }
- c_val /= 10;
- }
- puts_oled(center_x(i - 1, OLED_FONT_LARGE_WIDTH), 37, OLED_FONT_LARGE, i - 1, OLED_WHITE);
- }
- function find_digits(f_num) {
- f_num = abs(f_num);
- if(f_num / 10000 > 0) return 5;
- if(f_num / 1000 > 0) return 4;
- if(f_num / 100 > 0) return 3;
- if(f_num / 10 > 0) return 2;
- return 1;
- }
- const uint8 ASCII_NUM[] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57};
- int i;
- int c,c_val;
- define ColorOFF = 0;
- define Blue = 1;
- define Red = 2;
- define Green = 3;
- define Pink = 4;
- define SkyBlue = 5;
- define Yellow = 6;
- define White = 7;
- data(
- 0,0,0, //0. ColorOFF
- 2,0,0, //1. Blue
- 0,2,0, //2. Red
- 0,0,2, //3. Green
- 2,2,0, //4. Pink
- 2,0,2, //5. SkyBlue
- 0,2,2, //6. Yellow
- 2,2,2 //7. White
- );
- int data_indx;
- function colourled(color) {
- for( data_indx = 0; data_indx < 3; data_indx++ ) {
- set_led(data_indx,duint8 ((color * 3) + data_indx));
- }
- } //END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement