From: Zachary Vance Date: Tue, 16 Jun 2015 07:58:47 +0000 (-0700) Subject: Add computercraft reference X-Git-Url: https://git.za3k.com/?a=commitdiff_plain;h=4035ec162eec21041965e80ed4d100af87fbe813;p=za3k.git Add computercraft reference --- diff --git a/cheatsheet.css b/cheatsheet.css new file mode 100644 index 0000000..f8d0509 --- /dev/null +++ b/cheatsheet.css @@ -0,0 +1,89 @@ +div#layout { + column-width: 400px; + -webkit-column-width: 400px; + -moz-column-width: 400px; +} + +body { +} + +section { + display: inline-block; + vertical-align: top; + width: 400px; + border: 1px solid; + border-radius: 10px; + margin: 5px; + padding: 0 5px 0 5px; +} + +section > .title { + font-variant: small-caps; +} + +section > div { + margin-left: 20px; +} + +.parameters { + font-style: italic; +} + +.note { + font-style: italic; + font-size: 10pt; + margin-left: 10px; +} +.note:before { content: "("; } +.note:after { content: ")"; } + +.shortcut { + background: lightgrey; + display: inline-block; + border-radius: 5px; + border: 2px solid; + margin-top: 2px; + padding: 2px; +} + +.returns { + display: block; + margin-left: 10px; + font-style: italic; +} + +.returns:before { + content: "Returns: " +} + +.code { + +} + +.code.condition { + font-family: monospace; + font-style: italic; +} +.code.condition:before { content: "{"; } +.code.condition:after { content: "}"; } + +.code.block { + font-family: monospace; + font-style: italic; +} + +.code.block:before { content: "{"; } +.code.block:after { content: "}"; } + + +.code.value { + font-style: italic; +} + +.code.variable { + font-weight: bold; +} + +.keyword { + font-variant: small-caps; +} diff --git a/colony.md b/colony.md index 07b1254..6adf8a1 100644 --- a/colony.md +++ b/colony.md @@ -11,6 +11,8 @@ Manual Downloads Client | Server | Version --------|--------|--------- +[colony-0.4.8.zip](http://za4k.com/~colony/colony-0.4.8.zip) | [colony\_server-0.4.8.zip](http://za4k.com/~colony/colony_server-0.4.8.zip) | 0.4.8 +[colony-0.4.7.zip](http://za4k.com/~colony/colony-0.4.7.zip) | [colony\_server-0.4.7.zip](http://za4k.com/~colony/colony_server-0.4.7.zip) | 0.4.7 [colony-0.4.6.zip](http://za4k.com/~colony/colony-0.4.6.zip) | [colony\_server-0.4.6.zip](http://za4k.com/~colony/colony_server-0.4.6.zip) | 0.4.6 [colony-0.4.5.zip](http://za4k.com/~colony/colony-0.4.5.zip) | [colony\_server-0.4.5.zip](http://za4k.com/~colony/colony_server-0.4.5.zip) | 0.4.5 [colony-0.4.4.zip](http://za4k.com/~colony/colony-0.4.4.zip) | [colony\_server-0.4.4.zip](http://za4k.com/~colony/colony_server-0.4.4.zip) | 0.4.4 @@ -26,6 +28,15 @@ Manual Downloads Changelog --- +v0.4.8 +- Add Computer Craft tutorial +- Add early automation tutorial +- Enable autocrafting via BetterStorage Crafting Station. + +v0.4.7 +- Add Forge Multipart (microblocks) +- Enable wood and stone hoe + v0.4.6 - Add Moonblock (Vanilla mechanics) HQM quests diff --git a/computercraft_reference.html b/computercraft_reference.html new file mode 100644 index 0000000..321f399 --- /dev/null +++ b/computercraft_reference.html @@ -0,0 +1,74 @@ + + + + + + +
+
+ Shortcuts +
Ctrl-S Shutdown computer
+
Ctrl-R Reboot computer
+
Ctrl-T Terminate running program
+
startup -> disk, then
+
+
+ Turtle Api +
forward / back / up / down()
+
turnLeft / turnRight()
+
select(slot) / getSelectedSlot()
+
craft([quantity])
+
getItemCount / getItemSpace()
+
getItemDetail() {name, count, damage}
+
equipLeft / equipRight()
+
attack / attackUp / attackDown()
+
dig / digUp / digDown() or till dirt
+
place / placeUp / placeDown([signText])or use bucket
+
detect / detectUp / detectDown()
+
inspect / inspectUp / inspectDown() success, {name, metadata}, error
+
compare / compareUp / compareDown()
+
compareTo()
+
drop / dropUp / dropDown()
+
suck / suckUp / suckDown([amount])
+
refuel([quantity])
+
getFuelLevel() / getFuelLimit()
+
transferTo(slot, [quantity])
+
+
+ Http Api +
get(url, [headers]) sync
+
post(url, postData, [headers]) sync
+
request(url, [postData, [headers]) + http_success or http_failure event sent later via os +
+
+ Os Api +
clock()
+
time() / day()
+
sleep(seconds)
+
setAlarm(time) / cancelAlarm(alarm)
+
setTimer(seconds) / cancelTime(timer)
+
+
+ Redstone +
getSides()
+
getInput(side)
+
setOutput(side) / getOutput(side)
+
getAnalogInput(side) / setAnalogOutput(side)
+
+
+ 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) do 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}
+
+
+ + diff --git a/index.html b/index.html index 3de99bf..ced6403 100644 --- a/index.html +++ b/index.html @@ -23,6 +23,7 @@