Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Setup:
- --
- -- (1) - Place a fluid transposer with power and a lava
- -- source (pipe) attached to it. These can be on any side
- -- except the top and the side you want the turtle to put
- -- the bucket in.
- --
- -- (2) - Place the turtle on top of the fluid transposer.
- -- Open the transposer interface and make sure the lava
- -- source's side is blue, the top side is orange, and
- -- the side that the turtle has its back to is blue.
- -- If the side the turtle has its back to is the front of
- -- the transposer, the transposer must be turned.
- --
- -- (3) - Lastly, put a bucket in the transposer and run
- -- the program.
- -- Additional Options:
- --
- -- Arguments:
- -- The first argument in the program is an option to make
- -- turtle refuel to that fuel level instead of the default
- -- 1,000,000 fuel.
- --
- -- Pausing:
- -- You can pause the turtle with a redstone signal to the
- -- front of the turtle while it is above the transposer
- -- example: / \ \
- -- []T []T [] = lever
- -- --F --F T = turtle
- -- -- = pipe
- -- F = fluid transposer
- openSlot = 1
- args = { ... }
- if table.getn(args) < 1 then
- fullyFueled = 1000000
- else
- fullyFueled = tonumber(args[1])
- end
- function saveFirstOpenSlot()
- for i=1,16 do
- if turtle.getItemCount(i) == 0 then
- openSlot = i
- break
- end
- end
- end
- function refuel()
- shell.run("refuel","all")
- turtle.select(openSlot)
- while not turtle.back() do
- end
- while not turtle.down() do
- end
- turtle.drop()
- while not turtle.up() do
- end
- saveFirstOpenSlot()
- while not turtle.forward() do
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Waiting for bucket --> Is the transposer out of lava?")
- event = os.pullEvent("turtle_inventory")
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Starting program...")
- while turtle.getFuelLevel() < fullyFueled do
- -- will stop refueling while on top of the fluid transposer
- -- if a redstone signal is applied to the front of the turtle
- -- until the redstone signal is removed (flipped off) the
- -- turtle waits
- while (not redstone.getInput("front")) and (turtle.getFuelLevel() < fullyFueled) do
- term.clear()
- term.setCursorPos(1,1)
- print("No Redstone Signal --> Fueling")
- refuel()
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Redstone Signal Detected --> Pausing")
- event = os.pullEvent("redstone")
- end
- term.clear()
- term.setCursorPos(1,1)
- print("Fuel Level: "..turtle.getFuelLevel())
Advertisement
Add Comment
Please, Sign In to add comment