SHOW:
|
|
- or go back to the newest paste.
| 1 | scriptName = "Schematic builder" | |
| 2 | version = "1.7" | |
| 3 | --[[ | |
| 4 | Builds structures using schematic files with a turtle or a command computer. Schematics can be downloaded from sites such as http://www.planetminecraft.com. | |
| 5 | ||
| 6 | Requires openperipherals in CC 1.7 - 1.79. Plethora in later versions. Other combinations might work, | |
| 7 | ||
| 8 | If interrupted, you can resume by placing the turtle back in the original location and restarting the program. | |
| 9 | ||
| 10 | Quick setup | |
| 11 | Copy a schematic file to the turtle/command computer (see downloading instructions if on a server) | |
| 12 | ||
| 13 | Turtles must be placed on top of a chest (any type). | |
| 14 | Command computers require a chest on any side. | |
| 15 | ||
| 16 | pastebin run Fm3xf6Z9 builder.lua <filename> | |
| 17 | --or if using Opus OS, just type | |
| 18 | builder.lua <filename> | |
| 19 | ||
| 20 | The first time you run the program, you must select a wrench. Place a wrench into the chest. Go to the supplies list and double-click the SelectAWrench item. Select the wrench and apply. EnderIO, Thermal Expansion, and Applied Energistics wrenches will work (only wrenches that can spin pistons will work). | |
| 21 | ||
| 22 | Downloading schematics | |
| 23 | Option 1: Use wget if the schematic is available for download. | |
| 24 | ||
| 25 | Option 2: Transferring via pastebin | |
| 26 | To create a base64 file from a command line, do: | |
| 27 | ||
| 28 | linux / max: | |
| 29 | base64 -w0 NAME.schematic > NAME.schematic.base64 | |
| 30 | ||
| 31 | windows (I haven't tried this - but google said this will work): | |
| 32 | certutil -encode NAME.schematic NAME.schematic.base64 | |
| 33 | ||
| 34 | Upload the base64 file to pastebin. | |
| 35 | ||
| 36 | To download and convert the base64 file back into a schematic file, do: | |
| 37 | pastebin run Fm3xf6Z9 base64dl.lua <filename> <url> | |
| 38 | ||
| 39 | You can download a simple test schematic using: | |
| 40 | pastebin run Fm3xf6Z9 base64dl.lua chicken.schematic https://pastebin.com/raw/vxpHBUky | |
| 41 | ||
| 42 | ||
| 43 | ||
| 44 | ]] | |
| 45 | ||
| 46 | ||
| 47 | local GIT_REPO = 'kepler155c/opus/master' | |
| 48 | local BASE = 'https://raw.githubusercontent.com/' .. GIT_REPO | |
| 49 | ||
| 50 | local function dourl(url, ...) | |
| 51 | local env = setmetatable({ }, { __index = _G })
| |
| 52 | for k,v in pairs(getfenv(1)) do | |
| 53 | env[k] = v | |
| 54 | end | |
| 55 | ||
| 56 | local h = http.get(url) | |
| 57 | if h then | |
| 58 | local fn, m = load(h.readAll(), url, nil, env) | |
| 59 | h.close() | |
| 60 | if fn then | |
| 61 | return fn(...) | |
| 62 | end | |
| 63 | end | |
| 64 | error('Failed to download ' .. url)
| |
| 65 | end | |
| 66 | ||
| 67 | dourl(BASE .. '/sys/boot/multishell.boot', ...) |