Advertisement
gravitowl

[GraviBank] ATM TURTLE

Jan 12th, 2021
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. -- Variables
  2. local COMPUTER_ID = 0
  3. local TURTLE_ID = os.getComputerID()
  4.  
  5. rednet.open("right")
  6.  
  7. while true do
  8. local senderID, receivedMessage = rednet.receive("gATM")
  9. if type(receivedMessage) ~= "table" then
  10. print("isTable FALSE")
  11. rednet.send(senderID, {"unsuccesful"}, "gATM")
  12. else
  13. if receivedMessage[1] == "request" then
  14. rednet.send(senderID, {"succesful"}, "gATM")
  15. else
  16. print("isCorrectMessagetype FALSE")
  17. rednet.send(senderID, {"unsuccesful"}, "gATM")
  18. end
  19. end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement