Advertisement
ravneravn

serum screen

Nov 18th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. w, h = term.getSize()
  2.  
  3. function writeFile()
  4. handle = fs.open("serums", "w")
  5. handle.write(textutils.serialize(serum))
  6. handle.close()
  7. end
  8.  
  9.  
  10.  
  11.  
  12.  
  13. --mon = peripheral.wrap("right")
  14.  
  15. sleep(1)
  16. rednet.open("left")
  17. rednet.broadcast("id2")
  18. event, sid, mes, dis = os.pullEvent("rednet_message")
  19. if mes == "id2" then
  20. smelter = sid
  21. print(smelter)
  22. end
  23.  
  24. xpos = 1
  25. ypos = 1
  26. term.clear()
  27.  
  28. while true do
  29. event, sid, mes, dis = os.pullEvent("rednet_message")
  30. if sid == smelter then
  31. serum = textutils.unserialize(mes)
  32. writeFile()
  33. term.clear()
  34. term.setCursorPos(1,1)
  35. xpos = 1
  36. ypos = 1
  37. for k, v in ipairs(serum) do
  38. if string.find(v, "species") then
  39. term.setCursorPos(xpos, ypos)
  40. bee = string.sub(v, 14)
  41. print(bee)
  42. ypos = ypos +1
  43. if ypos == h then
  44. ypos = 1
  45. xpos = xpos + 26
  46. end
  47. elseif string.find(v, "Species") then
  48. term.setCursorPos(xpos, ypos)
  49. print(v)
  50. ypos = ypos +1
  51. if ypos == h then
  52. ypos = 1
  53. xpos = xpos + 26
  54. end
  55. end
  56. end
  57. end
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement