Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- receiverTurtle = 40
- buildmode = false
- rednet.open("left")
- function sendRednetMessage()
- local sides = {"top", "bottom", "left", "right", "front", "back"} -- List of all possible sides
- for _, side in ipairs(sides) do -- Loop through each side
- while rs.getInput(side) do
- if side == "left" and rs.getInput("bottom") then
- buildmode = false
- sleep(0.5)
- rednet.send(receiverTurtle, "right")
- return
- elseif side == "right" and rs.getInput("bottom") then
- buildmode = true
- sleep(0.5)
- rednet.send(receiverTurtle, "left")
- return
- end
- if buildmode == false then
- rednet.send(receiverTurtle, side)
- else
- rednet.send(receiverTurtle, side, "build")
- end
- local sender, message = rednet.receive("moveConfirm", 3)
- if message == nil then
- term.clear()
- term.setCursorPos(1,1)
- print("No connection!")
- --key = os.pullEvent("key")
- else
- print(side)
- end
- sleep(0.4)
- end
- end
- end
- while true do
- waitPlz = os.pullEvent("redstone")
- sendRednetMessage()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement