Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function RoxMaster()
- local run = 1
- while run == 1 do
- local sEvent, param = os.pullEvent("key")
- if sEvent == "key" then
- if param == 17 then
- rednet.broadcast("MoveForward")
- elseif param == 30 then
- rednet.broadcast("MoveLeft")
- elseif param == 31 then
- rednet.broadcast("MoveBack")
- elseif param == 32 then
- rednet.broadcast("MoveRight")
- elseif param == 18 then
- rednet.broadcast("MoveUp")
- elseif param == 16 then
- rednet.broadcast("MoveDown")
- elseif param == 33 then
- rednet.broadcast("DigForward")
- elseif param == 19 then
- rednet.broadcast("DigUp")
- elseif param == 46 then
- rednet.broadcast("DigDown")
- ------ Dav's additions for place, suck, and select -----
- elseif param == 13 then
- print("Which slot?")
- sleep(0.5)
- local selectslot = read()
- selectslot = tonumber(selectslot)
- if (selectslot~=nil) and (selectslot>0) and (selectslot<17) then
- rednet.broadcast("Select,"..selectslot)
- else
- print("Error: Must be number 1-16")
- sleep(2)
- end
- Menu()
- elseif param == 34 then
- rednet.broadcast("SuckForward")
- elseif param == 20 then
- rednet.broadcast("SuckUp")
- elseif param == 48 then
- rednet.broadcast("SuckDown")
- elseif param == 35 then
- rednet.broadcast("DropForward")
- elseif param == 21 then
- rednet.broadcast("DropUp")
- elseif param == 49 then
- rednet.broadcast("DropDown")
- elseif param == 36 then
- rednet.broadcast("PlaceForward")
- elseif param == 22 then
- rednet.broadcast("PlaceUp")
- elseif param == 50 then
- rednet.broadcast("PlaceDown")
- ------------------
- elseif param == 45 then
- rednet.broadcast("EndTurtle")
- textutils.slowPrint("Ended program on the")
- textutils.slowPrint("current Turtle and closed")
- textutils.slowPrint("it\'s Rednet connection.")
- print("--------------------------")
- elseif param == 44 then
- rednet.broadcast("EndBoth")
- run = 0
- rednet.close("back")
- textutils.slowPrint("Ended program on both")
- textutils.slowPrint("machines.")
- sleep(0.75)
- textutils.slowPrint("Closed rednet connection.")
- end
- end
- end
- end
- rednet.open("back")
- function Menu()
- term.clear()
- print("--------------------------")
- print("WASD to move.")
- print("E to rise.")
- print("Q to fall.")
- print("F to dig forward.")
- print("R to dig up.")
- print("C to dig down.")
- ----- Dav's Additions ---
- print("= to select slot.")
- print("G to suck forward.")
- print("T to suck up.")
- print("B to suck down.")
- print("H to drop forward.")
- print("Y to drop up.")
- print("N to drop down.")
- print("J to place forward.")
- print("U to place up.")
- print("M to place down.")
- ----------------
- print("X to stop current Turtle.")
- print("Z to exit.")
- end
- Menu()
- RoxMaster()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement