Modem distance, wired (blocks): 256
Modem distance, wireless (blocks): 64+ (16+ in thunderstorm)
Resolution (chars): 51x19 chars computer / 7x5 monitor
Disk Api
isPresent(side) / hasData(side) / hasAudio(side)
setLabel(side, label) / getLabel(side) / getID(side)
getAudioTitle(side)
playAudio(side) / stopAudio(side)
eject(side)
Etherpad.za3k.com Bootstrap
pastebin get LLia5Cd7 etherpad
etherpad get etherpad etherpad
etherpad get pull pull
pull push
File handles
close()
readLine() / readAll()"r"
write / writeLine(data)"w" or "a"
flush() "w" or "a"
read() / write(byte)"rb" or "wb"
Help Api
topics()
lookup(topic)
path() / setPath(path)
Http Api
get(url, [headers]) sync
post(url, postData, [headers]) sync
request(
url, [postData, [headers]])
nil, http_success or http_failure event sent later
Multishell Api
getCurrent()
setTitle(tabID, title) / getTitle(tabID)
Os Api
version()
computerID() / computerLabel() / setComputerLabel(label)
clock() Monotone since boot
time() / day()
sleep(seconds)
setAlarm(time) / cancelAlarm(alarm)
setTimer(seconds) / cancelTimer(timer)
pullEvent([target-event])
queueEvent(event, params...)
Native Os Events
key: keycode
char: letter
timer / alarm: id
redstone Any redstone input changed
disk / disk_detach: side
rednet_message: senderID, message, protocol
modem_message: side, frequency, replyFrequency, message, distanceTravelled
peripheral / peripheral_detach: side
mouse_click: button, x, y
mouse_scroll: direction, x, y
mouse_drag: button, x, y
monitor_touch: side, x, y Right click on an advanced monitor
term_resize
terminateos.pullEventRaw only
turtle_inventory Inventory changes
Peripheral Api
getType(side)
getMethods(side)
wrap(side) peripheral table
A wired modem can connect peripherals indirectly
Printer Peripheral
newPage() / endPage()
write(text)
getPageSize() / getCursorPos() / setCursorPos(x, y)
getPaperLevel() / getInkLevel()
setPageTitle()
Rednet Api
open / close / isOpen(side) for networking
send(receiverId, message, [protocol])
broadcast(message, [protocol])
receive([protocolFilter], [timeout])
host / unhost(protocol, hostname)
lookup(protocol, [hostname])
Redstone
getSides()
getInput(side)
setOutput(side) / getOutput(side)
getAnalogInput(side) / setAnalogOutput(side)
Shell Api
exit()
dir() / setDir(path)
path() / setPath(path)
resolve(localPath) / resolveProgram(name)
aliases() / setAlias(alias, program) / clearAlias(alias)
programs([showHidden])
getRunningProgram()
run(command, args...)
openTab(command, args...)
switchTab(tabID)
Term Api
write(text)
clear() / clearLine()
getCursorPos() / setCursorPos(x, y)
setCursorBlink(shouldBlink)
isColor()
getSize()
scroll(n)
redirect(target)
current() / native()
setTextColor(color) / setBackgroundColor(color)
setTextScale(scale) monitor only
window.setVisible(visible)
window.restoreCursor()
window.getPosition() (x,y) of top-left
window.reposition(x, y, [width, height])
Textutils Api
formatTime(time, [twentyFourHour])
serialize(data) / unserialize(serializedData)
serializeJSON(data)
urlEncode(urlUnsafeString)
Vector Api
new(
x,
y,
z)
v1:dot(v2) / v1:cross(v2)
v1:normalize() / v1:length()
v1:round()
v1:tostring()
Window Api
create(parentTerm, x, y, width, height, [visible])
Lua Reference
if condition then block else block end
while condition do block end
repeat block until condition end
for i = begin, end, [step] do block end
for k,v in pairs(table) do block end
for i,v in ipairs(array) do block end
function name(args) block end
name = function(args) do block end
table.__index / table.__newindex
Example values: nil, True, False, {}, 3, "yes", {"yes", 3}, {a="a", b=3}
Special Thanks
To the ComputerCraft Wiki for the recipe graphics, as well as excellent documentation.