Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("circles.lua")
- os.loadAPI("moveAPI.lua")
- chat = peripheral.wrap("left")
- cir = "23"
- function checkItems()
- currentSlot = 2
- while turtle.getItemCount() < 64 and currentSlot < 17 do
- turtle.select(currentSlot)
- turtle.transferTo(1)
- turtle.select(1)
- currentSlot = currentSlot + 1
- end
- if currentSlot == 17 then
- chat.say("I ran out of items, please bring more")
- turtle.select(1)
- while turtle.getItemCount() == 0 do
- os.sleep(5)
- end
- checkItems()
- end
- end
- function quarter(circleInput)
- checkItems()
- action = "r tl"
- list = {}
- for item in circleInput:gmatch("%S+") do
- list[#list + 1] = item
- end
- for i = 1, #list do
- cur = list[i]
- if cur == "s" then
- turtle.turnRight()
- action = "l tr"
- else
- moveAPI.repeatMoves("dd pd f", tonumber(cur))
- if i ~= #list then
- moveAPI.move(action)
- end
- end
- end
- end
- function createCircle(inputCircle)
- moveAPI.move("pd f")
- quarter(inputCircle)
- moveAPI.move("pd f")
- quarter(string.reverse(inputCircle))
- moveAPI.move("pd f")
- quarter(inputCircle)
- moveAPI.move("pd f")
- quarter(string.reverse(inputCircle))
- moveAPI.move("pd f")
- end
- function createMultiple(start, sequence)
- current = start
- for k, amount in ipairs(sequence) do
- for i = 1, amount do
- createCircle(circles.mapping["" .. current])
- moveAPI.move("b u")
- end
- current = current + 2
- moveAPI.move("l tr")
- end
- end
- function sameLevel(start, sequence)
- current = start
- for k, amount in ipairs(sequence) do
- for i = 1, amount do
- createCircle(circles.mapping["" .. current])
- moveAPI.move("b l tr")
- current = current + 2
- end
- turtle.up()
- end
- end
- for i = 39, 15, -2 do
- createCircle(circles.mapping["" .. i])
- moveAPI.move("b r tl")
- end
- --sameLevel(61, { 1, 2 })
- --createMultiple(73, { 2, 1, 3 })
- --createCircle(circles.mapping[cir])
Add Comment
Please, Sign In to add comment