Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Define Portal Computer Here (if you do not know what this is use the command: print(os.getComputerID()) on the turtle you will get a number put it after the equal sign below):
- pc =
- function close()
- while true do
- os.pullEvent("redstone")
- if redstone.getInput("bottom") then
- os.sleep(2)
- rednet.send(pc,"close")
- print("close sent")
- turtle.suck()
- end
- end
- end
- function portal()
- id, message = rednet.receive()
- if id == pc and message == "99" then
- print("closing Portal")
- turtle.suck()
- rednet.send(pc,"close")
- elseif id == pc then
- turtle.suck()
- print("opening Portal "..message)
- local message = tonumber(message)
- turtle.select(message)
- turtle.drop()
- end
- end
- turtle.suck()
- while redstone.getInput("right") do
- rednet.open("left")
- parallel.waitForAny(portal, close)
- end
Advertisement
Add Comment
Please, Sign In to add comment