Advertisement
Volaik

turtle.lua

Oct 5th, 2023
997
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.33 KB | Source Code | 0 0
  1. local modem = peripheral.find("modem")
  2.  
  3. rednet.open("left")
  4.  
  5. io.write("Input HUB ID: ")
  6.  
  7. local hubID = tonumber(read())
  8.  
  9. rednet.send(hubID, "connectMsg")
  10.  
  11. local id, message = rednet.receive()
  12. if message == "connectSuccess"  then
  13.     print("Connected to HUB." )
  14.     else
  15.     print("ERROR: Check HUB ID is correct.")
  16. end
  17.  
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement