Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Minecraft Turtle: Platform
- 2013 (c) psychedelixx
- 2013-12-15
- Builds a simple platform
- Usage:
- - use turtle and type "label set <name>"
- (to give your turtle an unique name so it remembers its programs)
- - type "pastebin get S5K1GvhA platform"
- --]]
- dirCounter = 1
- width = 2
- length = 2
- --[[ --- Parameter ---- ]]--
- local args = { ... }
- if #args == 1 then
- width = tonumber(args[1])
- length = width
- end
- if #args == 2 then
- width = tonumber(args[1])
- length = tonumber(args[2])
- end
- if width*length > 1024 then
- print("max size: 1024 (32*32)")
- end
- if turtle.getFuelLevel() < width * length then
- turtle.refuel()
- end
- if turtle.getFuelLevel() < width * length then
- print("Amount of missing fuel: ", width * length - turtle.getFuelLevel())
- print("Missing fuel in coal: ", (width * length - turtle.getFuelLevel())/80+1)
- end
- sumItems = 0
- for i=1, 16, 1 do
- sumItems = sumItems + turtle.getItemCount(i)
- end
- if sumItems < width*length then
- print("Not enough Resources")
- else
- print("======== 2013 (c) psychedelixx ========")
- print("=========== Platform Builder ==========")
- turtle.up()
- slot = 1
- for w=1, width, 1 do
- for l=1, length, 1 do
- if turtle.getItemCount(slot) == 0 and slot < 16 then
- slot = slot + 1
- end
- turtle.select(slot)
- turtle.digDown()
- turtle.placeDown()
- if l < length then
- turtle.dig()
- turtle.forward()
- end
- end
- if w < width then
- if dirCounter%2 == 1 then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- end
- else
- if dirCounter%2 == 1 then
- turtle.turnRight()
- turtle.turnRight()
- for l=1, length-1, 1 do
- turtle.forward()
- end
- end
- turtle.turnRight()
- for w=1, width-1, 1 do
- turtle.forward()
- end
- end
- dirCounter = dirCounter + 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement