Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --RCT Terminal
- rednet.open("back")
- term.clear()
- term.setCursorPos(1,1)
- print("RCT v1.6")
- print("Turtle ID: ")
- select = 1
- term.setCursorPos(12,2)
- id = read()
- id = tonumber(id)
- --Code
- function findTurtle()
- term.setCursorPos(1,2)
- term.clearLine()
- print("Searching...")
- rednet.send(id,"on")
- sid,msg,dis = rednet.receive(5)
- if msg == nill then
- term.setCursorPos(1,2)
- print("Turtle #"..id.." Is Not Online")
- elseif msg == "on" then
- term.setCursorPos(1,2)
- print("Connected To Turtle #"..id)
- elseif msg == "atk" then
- a = 1
- term.setCursorPos(1,2)
- print("Connected To Turtle #"..id)
- end
- end
- function printGui()
- term.setCursorPos(1,5)
- print("Controls:")
- print("W/Forward")
- print("A/Left")
- print("D/Right")
- print("S/Back")
- print()
- print("Space/Up")
- print("LShift/Down")
- if msg == "on" then
- print("F/Attack")
- print("G/Dig")
- print("Q/Dig Direction:")
- print()
- print("Press X To Reboot Turtle")
- print("Press T To Quit And Disconnect")
- elseif msg == "atk" then
- print("F/Attack")
- print("Q/Toggle Attack Direction: Off")
- print()
- print("Press T To Quit And Disconnect")
- end
- end
- function sendKey()
- event,key = os.pullEvent("key")
- if key == 17 then
- rednet.send(id,"w")
- elseif key == 30 then
- rednet.send(id,"a")
- elseif key == 31 then
- rednet.send(id,"s")
- elseif key == 32 then
- rednet.send(id,"d")
- elseif key == 42 then
- rednet.send(id,"lsft")
- elseif key == 57 then
- rednet.send(id,"spc")
- elseif key == 33 and select == 2 then
- rednet.send(id,"au")
- elseif key == 33 and select == 3 then
- rednet.send(id,"ad")
- elseif key == 33 then
- rednet.send(id,"f")
- elseif key == 34 and select == 2 then
- rednet.send(id,"du")
- elseif key == 34 and select == 3 then
- rednet.send(id,"dd")
- elseif key == 34 then
- rednet.send(id,"g")
- elseif key == 16 then
- if select < 3 then
- select = select + 1
- elseif select == 3 then
- select = 1
- end
- elseif key == 18 then
- if select > 1 then
- select = select - 1
- elseif select == 1 then
- select = 3
- end
- elseif key == 34 then
- rednet.send(id,"du")
- elseif key == 20 then
- rednet.send(id,"dsc")
- term.clear()
- term.setCursorPos(1,1)
- rednet.close("back")
- error()
- elseif keys.getName(key) == "x" then
- rednet.send(id,"sht")
- rednet.close("back")
- term.clear()
- term.setCursorPos(1,1)
- error()
- end
- term.setCursorPos(17,15)
- term.write(" ")
- term.setCursorPos(17,15)
- if select == 1 then
- print("Off")
- elseif select == 2 then
- print("Up")
- elseif select == 3 then
- print("Down")
- end
- end
- findTurtle()
- if msg == "on" then
- printGui()
- while true do
- sendKey()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment