Advertisement
Guest User

startup

a guest
Jul 16th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. shell.run("clear")
  2. id = 12
  3. x = nil
  4. y = nil
  5. z = 0
  6. term.setCursorPos(1,1)
  7. print("Searching")
  8.  
  9. function Clear()
  10. rednet.broadcast("/clear")
  11. timer = 5
  12. repeat
  13. term.setCursorPos(10,10)
  14. print("Screen clearing in "..timer)
  15. timer = timer - 1
  16. sleep(1)
  17. until
  18. timer == 0
  19. shell.run("clear")
  20. print("Searching")
  21. end
  22.  
  23. function Pos()
  24. x,y = term.getCursorPos()
  25. end
  26.  
  27. function Send()
  28. Pos()
  29. input = read()
  30. rednet.broadcast(""..input)
  31. term.setCursorPos(x,y)
  32. print(id..": "..input)
  33. end
  34.  
  35. function Search()
  36. rednet.open("top")
  37. a,b = rednet.receive()
  38. Filter()
  39. end
  40.  
  41. function Filter()
  42. if b == "/clear" then
  43. Clear() else
  44. print(a..": "..b)
  45. end
  46. end
  47.  
  48. repeat
  49. parallel.waitForAny(Search ,Send)
  50. until
  51. z == nil
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement