Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Spectrolus Generator
- By PancakePhD
- Put a turtle over the Spectorlus and install this code to it.
- Then add the wool to the turtle in the specified order.
- You can feed wool directly to the turtle via pipes.
- Finally add a lever to the left or right of the turtle and flip it.
- pastebin get EDXZL1CY startup
- then hold down ctrl + r until the turtle reboots
- Wool Order:
- 1.White 2.Orange 3.Magenta 4.Light Blue
- 5.Yellow 6.Lime 7.Pink 8.Grey
- 9.Light Grey 10.Cyan 11.Purple 12.Blue
- 13.Brown 14.Green 15.Red 16.Black
- dropDelay = time between each color being dropped
- timeAfterCycle = time after the black wool is dropped.
- Used as a mana buffer so your spreader and flowers
- don't get overloaded
- ]]--
- woolValid = true
- startPosition = 1
- dropDelay = 3
- timeAfterCycle = 5
- color = {
- "white",
- "orange",
- "magenta",
- "light_blue",
- "yellow",
- "lime",
- "pink",
- "gray",
- "light_gray",
- "cyan",
- "purple",
- "blue",
- "brown",
- "green",
- "red",
- "black"
- }
- local function dropWool()
- for i=startPosition,16 do
- if woolValid and turtle.getItemCount(i) > 1 then
- turtle.select(i)
- for x=1,4 do
- turtle.drop(1)
- turtle.turnRight()
- end
- --[[for j=1,dropDelay do
- os.setComputerLabel("Waiting: "..(dropDelay - j))
- sleep(1)
- end]]--
- else
- if woolValid then
- startPosition = i
- end
- woolValid = false
- end
- end
- end
- local function isWoolValid()
- woolValid = true
- for i=1,16 do
- if (turtle.getItemDetail(i).name ~= "minecraft:"..color[i].."_wool" or turtle.getItemCount(i) < 5) then
- woolValid = false
- print("Slot: "..i.." should be "..color[i])
- task = null
- if (turtle.getItemDetail(i).name == "minecraft:"..color[i].."_wool") then
- retrieved = refinedstorage.extractItem({name="minecraft:"..color[i].."_wool"}, 63, "down")
- if retrieved == nil then
- retrieved = 0
- end
- if retrieved > 5 then
- woolValid = true
- end
- task = refinedstorage.scheduleTask({name="minecraft:"..color[i].."_wool"}, 63 - retrieved)
- sleep(5)
- refinedstorage.extractItem({name="minecraft:"..color[i].."_wool"}, 63, "down")
- else
- os.setComputerLabel("Wool Invalid")
- end
- end
- end
- return woolValid
- end
- local function main()
- while isWoolValid() do
- term.clear()
- if rs.getInput("left") or rs.getInput("right") or rs.getInput("top") then
- os.setComputerLabel("Running")
- dropWool()
- for i=1,timeAfterCycle do
- os.setComputerLabel("Sleeping: "..timeAfterCycle-i)
- sleep(1)
- end
- else
- os.setComputerLabel("Flip Lever to Start")
- end
- sleep(1)
- end
- end
- while true do
- main()
- end
Add Comment
Please, Sign In to add comment