Advertisement
Guest User

BTS

a guest
Jul 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. rednet.open("top")
  2. table = {"BTSHello", "Orange"}
  3. idT = {}
  4. while true do
  5. event, id, txt, dis = os.pullEvent("rednet_message")
  6. print("odebrano")
  7. if txt == "HelloBTS" then
  8. --rednet.send(id, "test")
  9. rednet.send(id, textutils.serialize(table))
  10. print("wyslano")
  11. elseif txt == "connectBTS" then
  12. rednet.send(id, "true")
  13. a = "true"
  14. for i=1, #idT do
  15. if id == idT[1] then
  16. a = "false"
  17. end
  18. end
  19. if a == "true" then
  20. idT[#idT+1] = id
  21. end
  22. print("potwierdzono")
  23. else
  24. for i=1, #idT do
  25. if idT[i] == id then
  26. else
  27. rednet.send(idT[i], txt)
  28. print("Poszlo w pizdu")
  29. end
  30. end
  31. end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement