Skip to content

Variables

Everything a processor knows without asking: constants, time, map size. The list and the descriptions come from the game itself (v160.4).

Processor variables

The in-game window does not list them: they live in the processor, not in the global list.

@counterThe number of the instruction that will run next. The only built-in variable that can be changed: writing to it is a jump, and set @counter 0 starts the program over.
@unitThe unit taken by the last ubind. It is the one ucontrol and uradar are addressed to.
@queriesThe list query puts what it found into. Only a world processor has it.world processor only

Processor

@thisThe logic block executing the code
@thisxX coordinate of block executing the code
@thisyY coordinate of block executing the code
@iptExecution speed of the processor in instructions per tick (60 ticks = 1 second)

General

false0
true1
@piThe mathematical constant pi (3.141...)
@eThe mathematical constant e (2.718...)
@degToRadMultiply by this number to convert degrees to radians
@radToDegMultiply by this number to convert radians to degrees

Map

@timePlaytime of current save, in milliseconds
@tickPlaytime of current save, in ticks (1 second = 60 ticks)
@secondPlaytime of current save, in seconds
@minutePlaytime of current save, in minutes
@waveNumberCurrent wave number, if waves are enabled
@waveTimeCountdown timer for waves, in seconds
@mapwMap width in tiles
@maphMap height in tiles

Network/Clientside [World Processor Only]

@serverTrue if the code is running on a server or in singleplayer, false otherwise
@clientTrue if the code is running on a client connected to a server
@clientLocaleLocale of the client running the code. For example: en_US
@clientUnitUnit of client running the code
@clientNamePlayer name of client running the code
@clientTeamTeam ID of client running the code
@clientMobileTrue if the client running the code is on mobile, false otherwise
@clientMusicPlayingTrue if any music is currently playing
@clientCurrentMusicName of the current track being played, or null

Lookup

@blockCountTotal number of types of block content in the game; used with the lookup instruction
@unitCountTotal number of types of unit content in the game; used with the lookup instruction
@itemCountTotal number of types of item content in the game; used with the lookup instruction
@liquidCountTotal number of types of liquid content in the game; used with the lookup instruction
@waitThe game gives no description.
@ctrlProcessorThe game gives no description.
@ctrlPlayerThe game gives no description.
@ctrlCommandThe game gives no description.

Data taken from Mindustry v160.4 by the project generators.

Unofficial fan project, not affiliated with Anuke. Mindustry sprites, fonts and translations © Anuke, used under GPL-3.0; Fira Code under OFL-1.1. Site code is GPL-3.0.