Advertisement
LOLROW

Untitled

Nov 30th, 2023 (edited)
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. rednet.open("back")
  2.  
  3. exit = false
  4.  
  5. TurtleID = 0
  6.  
  7. protocol = "42069"
  8.  
  9. while ( exit == false ) do
  10. print("[1]: Goto, [2]: Connect Turtle, [3]: Exit")
  11.  
  12. local function getCommand()
  13.  
  14. local cmd = io.read()
  15.  
  16. if (tonumber(cmd) == 1) then
  17. print("suck my fat lard")
  18.  
  19. rednet.send(tonumber(TurtleID), "goto", "42069")
  20.  
  21. for i = 1, 3, 1 do --> Take in x, y, and z and send it to the turtle.
  22. local coord = io.read()
  23. rednet.send(tonumber(TurtleID), coord, protocol)
  24. end
  25. elseif (tonumber(cmd) == 2) then
  26. TurtleID = io.read()
  27.  
  28. print("Connected!")
  29. elseif (tonumber(cmd) == 3) then
  30. exit()
  31. end
  32. end
  33. getCommand()
  34. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement