Skip to content

Print Flush

Accumulated text is shown not by print but by printflush — and it clears the buffer whatever happens

printflush has one field — who to hand the buffer to. It can be handed to a message block — called “Message” in the build menu — and that is the only block that can take text.

tick 0
Sensor0
=
in
Print1
Print2
Print Flush3
Wait4
@counter0number
coppernullnull
textBufferstring

Press “run”. copper: 120 appears under the message block, and the buffer is empty almost all the time: the program fills the line in and immediately hands it over.

That is the instruction’s main rule. printflush clears the buffer whether or not the text reached its destination: the wrong link, a demolished block, not a message block at all — the buffer ends up empty regardless.

Limit How much
text length 400 characters — same as the buffer
line breaks no more than 24
spaces at the edges trimmed

Text longer than 400 characters is not accepted at all — not trimmed, refused, and the old line stays. That differs from the buffer, which simply stops appending.

It has to be handed out in the same iteration

Section titled “It has to be handed out in the same iteration”

print accumulates, printflush hands out and clears. If you forget to hand it out, the buffer survives, and on the second iteration all the same text is appended again — the line starts repeating itself until it hits four hundred characters.

So the “fill in — hand out” pair almost always stands together, with no jumps and no waiting between them.

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.