How to Make Your Own Cronus Zen Script
Cronus Zen scripts are written in GPC, a small language that looks like C. You write a .gpc text file and the Zen runs a compiled form of it. Write it in any text editor, then program it to a slot from Studio in Chrome, Edge or Opera, which compiles it as it programs. Collective Minds' Zen Studio has its own editor, and its Build and Run tests a script without programming a slot.
What a script is made of
| Part | What it does |
|---|---|
define | Gives a fixed value a name, such as the button a script uses |
int variables | Values the script changes as it runs, such as a timing in milliseconds |
init | Runs once, when the slot loads |
main | Runs over and over while the slot is active: it reads your controller and decides what the console gets |
combo | A timed sequence: set inputs, wait a number of milliseconds, set them again |
function | A block of code you call from main or a combo |
The functions most scripts use
get_ivalreads what your controller sent, andget_valreads the value asmainhas changed it so far. Buttons and triggers run from 0 to 100, stick axes from -100 to 100.set_valsets what the console gets:set_val(PS4_SQUARE, 100)presses Square andset_val(PS4_SQUARE, 0)lets it go.event_pressandevent_releaseare true only at the moment a button goes down or comes up.combo_runstarts a combo, andcombo_runningsays whether it still is.get_pvarreads a saved value andset_pvarsaves one, inSPVAR_1toSPVAR_64, so settings survive a power-off.cls_oled,printandrect_oleddraw on the Zen's 128 by 64 screen.block_all_inputsstops anything reaching the console, which is how menus keep your presses out of the game.
Buttons have PlayStation names such as PS4_SQUARE and Xbox names such as XB1_X. Both point at the same input, so one script works with either controller.
Example: a timed NBA 2K shot
In NBA 2K a jump shot on Square releases when Square is let go, so holding it for a set time is the core of a timed shot. This script does that when you click the right stick: it holds Square for 550 ms, and holding L2 while you press D-pad Up or Down changes the time by 5 ms and saves it.
int hold = 550;
init {
hold = get_pvar(SPVAR_1, 100, 1500, 550);
}
main {
if (get_ival(PS4_L2) > 50) {
if (event_press(PS4_UP)) {
hold = min(hold + 5, 1500);
set_pvar(SPVAR_1, hold);
}
if (event_press(PS4_DOWN)) {
hold = max(hold - 5, 100);
set_pvar(SPVAR_1, hold);
}
set_val(PS4_UP, 0);
set_val(PS4_DOWN, 0);
}
if (event_press(PS4_R3)) combo_run(Shot);
set_val(PS4_R3, 0);
}
combo Shot {
set_val(PS4_SQUARE, 100);
wait(hold);
set_val(PS4_SQUARE, 0);
wait(50);
}initreads the saved time fromSPVAR_1, between 100 and 1500 ms, and uses 550 the first time.- With L2 held, D-pad Up and Down change the time and save it straight away, and
set_val(PS4_UP, 0)keeps those presses out of the game. - Clicking R3 starts the
Shotcombo, andset_val(PS4_R3, 0)stops the click itself reaching the game. Shotholds Square forholdmilliseconds, lets go, and keeps it released for 50 ms so the game sees the release.
Shot early? Raise the time. Late? Lower it. How a 2K27 auto green Zen script times your shot explains the green window and the online delay this number has to cover.
Put it on your Zen
- Save the file with a
.gpcending. - Plug the Zen's PROG port into your computer and connect it in Studio (connect-pc).
- Press Add a script on a slot and use the Your own file tab, or drag the file onto the slot.
- Press Program.
- If it does not compile, Show details gives the line to fix.
- Plug the Zen into your console and press the right blue button until that slot shows.
Mistakes that stop a script
returnonly works inside afunction. Inmain, useifandelseinstead, or the compiler stops withCannot use 'return' outside of a function.- Saved values stay on a slot when you program another script over it. That is why
get_pvartakes a lowest value, a highest value and a default: anything the last script left outside your range falls back to the default. - If your script draws on the screen, call
cls_oledwhen it starts, or the Zen's own scrolling file name can draw over yours. - Block the buttons your menu uses while it is open, with
block_all_inputsorset_val(button, 0), or every press that changes a setting also reaches the game. - A script written for an older Zen Studio can define its own version of a function that is now built in. The compiler refuses it until that function is renamed.
Read a full script
Shot Tuner is our free NBA 2K script, published as readable source. It takes the shot on the right stick with a Timing and Tempo you set, saves three settings with get_pvar and set_pvar, and draws its own menu on the Zen's screen, opened with L2 + OPTIONS like cronus2K's. A .cz file from cronuszens.com is a sealed build: it can be programmed, not opened as code.
Before you play online
A script you wrote counts the same as any other. Activision says it detects the Zen by how your inputs behave, and 2K has banned NBA 2K27 accounts for scripts used as shooting aids. Read bans first.
Previous and next guide
- What Is a Cronus Zen Script?Previous guide
- Where to Enter a Cronus Zen Script License KeyNext guide
Related guides
- How to Program Scripts to Cronus Zen SlotsPut scripts on your Cronus Zen: connect through PROG, pick scripts from the catalogue, choose slots, press Program, then switch slots on the Zen.
- Cronus Zen Error Codes E3, E3001 and E3002: FixesFixes for Cronus Zen error messages: Firmware Version Incompatible, E3, E3001, E3002, Stack or Bytecode errors, a Zen that freezes, and every Studio message.
Tools and scripts
- All Cronus Zen guides36 guides: setup, consoles, controllers and fixes
- Program a script in the StudioWrite scripts to your Zen from this browser
- Update your firmwareInstall the latest Cronus Zen firmware
- How to install Cronus Zen scriptsFrom firmware to the script menu
- Cronus Zen scripts by gameEvery free and Club script, sorted by game
- NBA 2K27 Cronus Zen scriptsFree and Club scripts for NBA 2K27