Sectly_Playz

Test

Jan 1st, 2021
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. function fuelling()
  2. if turtle.getFuelLevel() <= 10 then
  3. print("Adding Fuel...")
  4. os.setComputerLabel("Adding Fuel...")
  5. label = ("Adding Fuel...")
  6. turtle.select(16)
  7. turtle.refuel(1)
  8. turtle.select(1)
  9. print("Done.")
  10. os.setComputerLabel(setname)
  11. label = (setname)
  12. end
  13. end
  14.  
  15. write('Host ID: ')
  16. sender = read()
  17. --ask for host id
  18.  
  19. shell.run('clear') --clear the screen
  20. rednet.open("right") --open the wifi port
  21. x=1
  22. while x == 1 do --start loop
  23. action, senderID, text = os.pullEvent() --wait for input
  24. if action == "rednet_message" then --if its a wireless message do
  25. if text == 'forward' then -- if the up button is pressed
  26. turtle.forward() -- go forward
  27. end
  28. if text == 'backward' then --you know...
  29. turtle.back()
  30. end
  31. if text == 'left' then
  32. turtle.turnLeft()
  33. end
  34. if text == 'right' then
  35. turtle.turnRight()
  36. end
  37. if text == 'up' then
  38. if turtle.detectUp() then
  39. turtle.digUp()
  40. else
  41. turtle.up()
  42. end
  43. end
  44. if text == 'down' then
  45. if turtle.detectDown() then
  46. turtle.digDown()
  47. else
  48. turtle.down()
  49. end
  50. end
  51.  
  52.  
  53.  
  54. if text == 'dig' then -- if the space button is pressed on dig mode
  55. turtle.dig() -- dig forward
  56. end
  57. if text == 'place' then -- if the space button is pressed on place mode
  58. turtle.place() --place the selected block in front
  59. end
  60. if text == 'rs' then -- if the ctrl button is pressed
  61. redstone.setOutput('front', true) -- set redstone in front to true
  62. end
  63. end
  64. if action=="key" and senderID == sender then -- check sender id
  65. x=0
  66. end
  67. end
Advertisement
Add Comment
Please, Sign In to add comment