Anvil is a simple scripting language added into the game for players to build their own scripts and exploits. Based on the open-source scripting language by Joe Strout (‣)

Launch a Script

A script can be launched in three ways: as a player-created script via terminal (however, not all methods can be launched)

mini FILE_NAME

Or as a story script that manages an entire mission, or launched by a story step.

Control Flow

if, else if, else, end if

if 2+2 == 4 then
	print "math works!"
else if pi > 3 then
	print "pi is tasty"
else if "a" < "b" then
	print "I can sort"
else
	print "last chance"
end if

while, end while

s = "Spam"
while s.len < 50
	s = s + ", spam"
end while
print s + " and spam!"

for, end for

for i in range(10, 1)
	print i + "..."
end for
print "Liftoff!"

break & continue

The break statement jumps out of a while or for loop. The continue statement jumps to the top of the loop, skipping the rest of the current iteration.

Data Types

All numbers are stored in full-precision format. Numbers also represent true (1) and false (0). Operators:

+, -, *, / standard math
% mod (remainder)
^ power
and, or, not logical operators
==, !=, >, >=, <, <= comparison