Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Robot builds creeper
- local sides = require("sides")
- local event = require("event")
- local c = require("component")
- local computer = require("computer")
- local robot = c.robot
- --local rs = c.redstone
- local chu = c.chunkloader
- local function moveUp(amount)
- local move = amount
- while move > 0 do
- robot.move(sides.up)
- move = move - 1
- end
- end
- local function moveDown(amount)
- local move = amount
- while move > 0 do
- robot.move(sides.down)
- move = move - 1
- end
- end
- local function moveLeft(amount)
- local move = amount
- robot.turn(false)
- while move > 0 do
- robot.move(sides.front)
- move = move - 1
- end
- robot.turn(true)
- end
- local function moveRight(amount)
- local move = amount
- robot.turn(true)
- while move > 0 do
- robot.move(sides.front)
- move = move - 1
- end
- robot.turn(false)
- end
- local function moveForward(amount)
- local move = amount
- while move > 0 do
- robot.move(sides.front)
- move = move - 1
- end
- end
- local function moveBack(amount)
- local move = amount
- while move > 0 do
- robot.move(sides.back)
- move = move - 1
- end
- end
- local function oneeighty()
- robot.turn(true)
- robot.turn(true)
- end
- local function place()
- robot.place(sides.front)
- end
- local function doplace()
- place()
- end
- robot.select(1)
- robot.setLightColor(0x00DB00) --green
- doplace()
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- moveRight(1)
- doplace()
- robot.select(2)
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- robot.select(1)
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveRight(1)
- doplace()
- robot.select(2)
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- robot.select(1)
- moveUp(1)
- doplace()
- robot.select(2)
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- robot.select(1)
- moveUp(1)
- doplace()
- moveRight(1)
- doplace()
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- robot.select(2)
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- robot.select(1)
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveRight(1)
- doplace()
- moveUp(1)
- doplace()
- robot.select(2)
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- robot.select(1)
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- moveRight(1)
- doplace()
- robot.select(2)
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- robot.select(1)
- moveDown(1)
- doplace()
- robot.select(2)
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- robot.select(1)
- moveDown(1)
- doplace()
- moveRight(1)
- doplace()
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- robot.select(2)
- moveUp(1)
- doplace()
- moveUp(1)
- doplace()
- robot.select(1)
- moveUp(1)
- doplace()
- moveRight(1)
- doplace()
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveDown(1)
- doplace()
- moveLeft(7)
- robot.setLightColor(0xFF0000) --red
- computer.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment