Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ms = require("movescript")
- local robot = require("robot")
- local component = require("component")
- local sides = require("sides")
- local ic = component.inventory_controller
- local BLOCK = {
- name = "immersiveengineering:metal_decoration1",
- damage = 5
- }
- local SLAB = {
- name = "immersiveengineering:metal_decoration1_slab",
- damage = 5
- }
- local STAIR = {
- name = "immersiveengineering:aluminum_scaffolding_stairs0",
- damage = 0
- }
- local STEEL_FENCE = {
- name = "immersiveengineering:metal_decoration1",
- damage = 0
- }
- local ALU_FENCE = {
- name = "immersiveengineering:metal_decoration1",
- damage = 4
- }
- local AF_CONN = {
- name = "alternatingflux:connector",
- damage = 0
- }
- local RS_TORCH = {
- name = "minecraft:redstone_torch",
- damage = 0
- }
- local function getItem(item)
- repeat
- local success = false
- for i=1, robot.inventorySize() do
- local stack = ic.getStackInInternalSlot(i)
- if stack ~= nil and stack.name == item.name and stack.damage == item.damage then
- robot.select(i)
- success = true
- break
- end
- end
- if not success then
- print("Could not select "..item.name..":"..item.damage..", please add more and press enter.")
- io.read()
- end
- until success
- end
- local function buildStdPost()
- for i=1, 5 do
- getItem(BLOCK)
- ms.exec("UPd")
- end
- getItem(STAIR)
- ms.exec("BPUF")
- end
- local function placeInvertedStair()
- getItem(STAIR)
- robot.placeDown(sides.back)
- end
- -- Builds an arm of the pylon, starting from in front of where the aluminum fence would be.
- -- Ends at where the aluminum fence should be.
- local function buildOrthogonalPylonArm()
- getItem(SLAB) -- Start by placing the slabs at the end.
- ms.exec("U2FPu")
- getItem(SLAB)
- ms.exec("FPu")
- getItem(STEEL_FENCE)
- ms.exec("BP")
- getItem(BLOCK)
- ms.exec("BP")
- getItem(STAIR)
- ms.exec("BPD2F")
- for i=1, 2 do
- getItem(STEEL_FENCE)
- ms.exec("PB")
- end
- getItem(BLOCK)
- ms.exec("PB")
- getItem(STAIR)
- ms.exec("PD3F")
- for i=1, 3 do
- getItem(AF_CONN)
- robot.place(sides.up)
- ms.exec("B")
- end
- ms.exec("F")
- placeInvertedStair()
- getItem(BLOCK)
- ms.exec("BPU")
- end
- -- Builds an orthogonal pylon, starting in front of the near-left post.
- local function buildOrthogonalPylon()
- ms.exec("FR") -- Move to the first post's position.
- buildStdPost()
- ms.exec("L2FR6D")
- buildStdPost()
- ms.exec("4F2R6D")
- buildStdPost()
- ms.exec("L2FR6D")
- buildStdPost()
- ms.exec("FD") -- Place the first upside-down stair.
- placeInvertedStair()
- ms.exec("R2FL")
- placeInvertedStair()
- ms.exec("2F2R")
- placeInvertedStair()
- ms.exec("R2FL")
- placeInvertedStair()
- getItem(SLAB) -- Place the slabs on the first segment.
- ms.exec("FDPu")
- getItem(SLAB)
- ms.exec("L2F2RPu")
- getItem(SLAB)
- ms.exec("FL2F2RPu")
- getItem(SLAB)
- ms.exec("4F2RPuFURFL")
- buildStdPost() -- Build the next set of posts.
- ms.exec("L2FR6D")
- buildStdPost()
- ms.exec("2F2R6D")
- buildStdPost()
- ms.exec("L2FR6D")
- buildStdPost()
- getItem(SLAB) -- Build the slabs on the second segment.
- ms.exec("RF2DLPu")
- getItem(SLAB)
- ms.exec("2F2RPuFURF2R")
- buildStdPost() -- Build the third set of posts.
- ms.exec("2F2R6D")
- buildStdPost()
- ms.exec("FLF") -- Build the pylon arms.
- buildOrthogonalPylonArm()
- ms.exec("2RF")
- buildOrthogonalPylonArm()
- ms.exec("RD")
- for i=1, 2 do
- getItem(BLOCK)
- ms.exec("PdU")
- end
- getItem(ALU_FENCE)
- ms.exec("Pd")
- getItem(RS_TORCH)
- ms.exec("BP")
- -- Return to origin.
- ms.exec("BL2FR17D")
- end
- buildOrthogonalPylon()
Add Comment
Please, Sign In to add comment