Advertisement
Uranium_49

Untitled

Mar 1st, 2025
7
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.89 KB | None | 0 0
  1. rednet.open("bottom")
  2. m = peripheral.wrap("top")
  3. m.setBackgroundColor(colors.black)
  4. m.clear()
  5. m.setTextScale(0.5)
  6.  
  7. data = {}
  8.  
  9. local i = 0
  10.  
  11. for i = 0, 50 do
  12. data[i] = {}
  13. end
  14.  
  15. window[27] = window.create(m,50,10,30,15,true)
  16. window[28] = window.create(m,50,30,30,15,true)
  17. window[29] = window.create(m, 10, 10, 30, 15, true)
  18. window[30] = window.create(m, 10,30,30,15,true)
  19. window[31] = window.create(m, 140,5,15,7,true)
  20.  
  21. function boxe(x, y, xa, ya, mon, titre)
  22. mon.setTextScale(1)
  23. mon.setCursorPos(x, y)
  24. mon.setBackgroundColor(colors.gray)
  25. mon.write(" ")
  26. mon.setBackgroundColor(colors.black)
  27. mon.setTextColor(colors.yellow)
  28. mon.setCursorPos(x + 2, y)
  29. mon.write(" " .. titre .. " ")
  30. local xc, yc = mon.getCursorPos()
  31. for xc = xc, xa + x do
  32. mon.setCursorPos(xc, y)
  33. mon.setBackgroundColor(colors.gray)
  34. mon.write(" ")
  35. xc = xc + 1
  36. end
  37. local xc, yc = mon.getCursorPos()
  38. yc = y + 1
  39. for yc = y, ya + y do
  40. mon.setCursorPos(x, yc)
  41. mon.setBackgroundColor(colors.gray)
  42. mon.write(" ")
  43. mon.setCursorPos(x + xa, yc)
  44. mon.setBackgroundColor(colors.gray)
  45. mon.write(" ")
  46. yc = yc + 1
  47. end
  48. xb = x
  49. for xb = x, xa + x do
  50. mon.setCursorPos(xb, y + ya)
  51. mon.setBackgroundColor(colors.gray)
  52. mon.write(" ")
  53. xb = xb + 1
  54. end
  55. end
  56.  
  57. for i = 27,31 do
  58. window[i].setBackgroundColor(colors.white)
  59. window[i].setTextColor(colors.black)
  60. window[i].clear()
  61. x,y = window[i].getSize()
  62. boxe(1,1,x,y,window[i],"test")
  63. end
  64.  
  65. function fetchData()
  66.  
  67. while true do
  68.  
  69. e,a,b,c = os.pullEvent("rednet_message")
  70. data[a] = b
  71. data[a]["name"] = c
  72.  
  73. window[a].setCursorPos(1,1)
  74. window[a].write(" "..data[a]["name"])
  75. window[a].setCursorPos(1,2)
  76. window[a].write("Energy Used: "..data[a]["energyUse"])
  77. window[a].setCursorPos(1,3)
  78. window[a].write("input: "..data[a]["input1"].name.." ")
  79. window[a].setCursorPos(1,4)
  80. window[a].write("count: "..data[a]["input1"].count.." ")
  81. window[a].setCursorPos(1,5)
  82. window[a].write("output: "..data[a]["output1"].name.." ")
  83. window[a].setCursorPos(1,6)
  84. window[a].write("count: "..data[a]["output1"].amount.." ")
  85.  
  86.  
  87. end
  88.  
  89. end
  90.  
  91.  
  92. --window[i].setBackgroundColor(colors.green)
  93. --window[i].setTextColor(colors.black)
  94. --window[i].clear()
  95.  
  96. function printWindow(i)
  97.  
  98. window[i].setCursorPos(1,1)
  99. window[i].write(data[i]["name"])
  100. window[i].setCursorPos(1,2)
  101. window[i].write("input: "..data[i]["input1"].count)
  102.  
  103. end
  104.  
  105. function print()
  106.  
  107. --os.sleep(5)
  108.  
  109. for i=29,30 do
  110.  
  111. --printWindow(i)
  112.  
  113. end
  114.  
  115. end
  116.  
  117. parallel.waitForAll(fetchData, print)
  118.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement