Advertisement
Guest User

PCRC

a guest
Jan 23rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.09 KB | None | 0 0
  1. local function RoxMaster()
  2.   local run = 1
  3.   while run == 1 do
  4.     local sEvent, param = os.pullEvent("key")
  5.     if sEvent == "key" then
  6.       if param == 17 then
  7.         rednet.broadcast("MoveForward")
  8.       elseif param == 30 then
  9.         rednet.broadcast("MoveLeft")
  10.       elseif param == 31 then
  11.         rednet.broadcast("MoveBack")
  12.       elseif param == 32 then
  13.         rednet.broadcast("MoveRight")
  14.       elseif param == 18 then
  15.         rednet.broadcast("MoveUp")
  16.       elseif param == 16 then
  17.         rednet.broadcast("MoveDown")
  18.       elseif param == 33 then
  19.         rednet.broadcast("DigForward")
  20.       elseif param == 19 then
  21.         rednet.broadcast("DigUp")
  22.       elseif param == 46 then
  23.         rednet.broadcast("DigDown")
  24.       elseif param == keys.space then
  25.         rednet.broadcast("Attack")
  26.       elseif param == keys.p then
  27.         rednet.broadcast("PlaceFWD")
  28.       elseif param == 45 then
  29.         rednet.broadcast("EndTurtle")
  30.         textutils.slowPrint("Ended program on the")
  31.         textutils.slowPrint("current Turtle and closed")
  32.         textutils.slowPrint("it\'s Rednet connection.")
  33.         print("--------------------------")
  34.       elseif param == 44 then
  35.         rednet.broadcast("EndBoth")
  36.         run = 0
  37.         rednet.close("back")
  38.         textutils.slowPrint("Ended program on both")
  39.         textutils.slowPrint("machines.")
  40.         sleep(0.75)
  41.         textutils.slowPrint("Closed rednet connection.")
  42.       end
  43.     end
  44.   end
  45. end
  46. rednet.open("back")
  47. term.clear()
  48. term.setCursorPos(1,1)
  49. textutils.slowPrint("Rox Remote Control Console \(RoxRCC\) sending signal.")
  50. print("--------------------------")
  51. textutils.slowPrint("WASD to move.")
  52. textutils.slowPrint("E to rise.")
  53. textutils.slowPrint("Q to fall.")
  54. textutils.slowPrint("F to dig forward.")
  55. textutils.slowPrint("R to dig up.")
  56. textutils.slowPrint("C to dig down.")
  57. textutils.slowPrint("P to place block forward")
  58. textutils.slowPrint("Space to attack forward.")
  59. textutils.slowPrint("X to stop current Turtle.")
  60. textutils.slowPrint("Z to exit.")
  61. print("--------------------------")
  62. RoxMaster()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement