Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("bottom")
- m = peripheral.wrap("top")
- m.setBackgroundColor(colors.black)
- m.clear()
- m.setTextScale(0.5)
- data = {}
- local i = 0
- for i = 0, 50 do
- data[i] = {}
- end
- window[27] = window.create(m,50,10,30,15,true)
- window[28] = window.create(m,50,30,30,15,true)
- window[29] = window.create(m, 10, 10, 30, 15, true)
- window[30] = window.create(m, 10,30,30,15,true)
- window[31] = window.create(m, 140,5,15,7,true)
- function boxe(x, y, xa, ya, mon, titre)
- mon.setTextScale(1)
- mon.setCursorPos(x, y)
- mon.setBackgroundColor(colors.gray)
- mon.write(" ")
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.yellow)
- mon.setCursorPos(x + 2, y)
- mon.write(" " .. titre .. " ")
- local xc, yc = mon.getCursorPos()
- for xc = xc, xa + x do
- mon.setCursorPos(xc, y)
- mon.setBackgroundColor(colors.gray)
- mon.write(" ")
- xc = xc + 1
- end
- local xc, yc = mon.getCursorPos()
- yc = y + 1
- for yc = y, ya + y do
- mon.setCursorPos(x, yc)
- mon.setBackgroundColor(colors.gray)
- mon.write(" ")
- mon.setCursorPos(x + xa, yc)
- mon.setBackgroundColor(colors.gray)
- mon.write(" ")
- yc = yc + 1
- end
- xb = x
- for xb = x, xa + x do
- mon.setCursorPos(xb, y + ya)
- mon.setBackgroundColor(colors.gray)
- mon.write(" ")
- xb = xb + 1
- end
- end
- for i = 27,31 do
- window[i].setBackgroundColor(colors.white)
- window[i].setTextColor(colors.black)
- window[i].clear()
- x,y = window[i].getSize()
- boxe(1,1,x,y,window[i],"test")
- end
- function fetchData()
- while true do
- e,a,b,c = os.pullEvent("rednet_message")
- data[a] = b
- data[a]["name"] = c
- window[a].setCursorPos(1,1)
- window[a].write(" "..data[a]["name"])
- window[a].setCursorPos(1,2)
- window[a].write("Energy Used: "..data[a]["energyUse"])
- window[a].setCursorPos(1,3)
- window[a].write("input: "..data[a]["input1"].name.." ")
- window[a].setCursorPos(1,4)
- window[a].write("count: "..data[a]["input1"].count.." ")
- window[a].setCursorPos(1,5)
- window[a].write("output: "..data[a]["output1"].name.." ")
- window[a].setCursorPos(1,6)
- window[a].write("count: "..data[a]["output1"].amount.." ")
- end
- end
- --window[i].setBackgroundColor(colors.green)
- --window[i].setTextColor(colors.black)
- --window[i].clear()
- function printWindow(i)
- window[i].setCursorPos(1,1)
- window[i].write(data[i]["name"])
- window[i].setCursorPos(1,2)
- window[i].write("input: "..data[i]["input1"].count)
- end
- function print()
- --os.sleep(5)
- for i=29,30 do
- --printWindow(i)
- end
- end
- parallel.waitForAll(fetchData, print)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement