Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local r=require("robot")
- local c=require("component")
- print(r.level())
- l = 8
- w = 5
- h = 1
- dir = "1up"
- t=1
- floor = 0
- function cut()
- while r.detectDown() do
- r.swingDown()
- if r.detectDown() then
- r.select(16)
- c.inventory_controller.equip()
- r.swingDown()
- c.inventory_controller.equip()
- end
- end
- while r.detect() do
- r.swing()
- if r.detect() then
- r.select(16)
- c.inventory_controller.equip()
- r.swing()
- c.inventory_controller.equip()
- end
- end
- while r.detectUp() do
- r.swingUp()
- if r.detectUp() then
- r.select(16)
- c.inventory_controller.equip()
- r.swingUp()
- c.inventory_controller.equip()
- end
- end
- end
- for k = 1, h do
- for j = 1 , w do
- for i = 1, l-1 do
- cut()
- r.forward()
- end
- if j<w then
- if t==-1 then
- r.turnLeft()
- cut()
- r.forward()
- r.turnLeft()
- else
- r.turnRight()
- cut()
- r.forward()
- r.turnRight()
- end
- else
- r.turnAround()
- cut()
- end
- t=-t
- end
- t=-t
- if k<h then
- if dir == "up" then
- cut()
- r.up()
- cut()
- r.up()
- cut()
- r.up()
- if floor == 1 then
- cut()
- r.up()
- end
- else
- cut()
- r.down()
- cut()
- r.down()
- cut()
- r.down()
- if floor == 1 then
- cut()
- r.down()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement