Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bridge = peripheral.wrap("left")
- local net = peripheral.wrap("back")
- local width = 200
- local machines = {
- {
- ["id"] = "matter_fabricator_0",
- ["name"] = "Matter Fab"
- }
- }
- for key,value in pairs(machines) do
- value["label"] = bridge.addText(5,5,"Matter Fabricator:",0x1B1224)
- value["bar"] = bridge.addBox(5,15,0,5,0xC5360F,0.0)
- value["bar"].setZIndex(2)
- end
- local progress = 0
- while true do
- for i=#machines,1,-1 do
- machine = machines[i]
- if net.isPresentRemote(machine["id"]) then
- progress = net.callRemote(machine["id"],"getProgress")
- maxProgress = net.callRemote(machine["id"],"getMaxProgress")
- machine["bar"].setWidth(width * maxProgress / progress)
- else
- machine["bar"].delete()
- machine["label"].delete()
- end
- end
- os.sleep(1)
- end
- -- arguments: x, y, width, height, color, opacity
- -- mybox = bridge.addBox(0,0,80,40,0x0099FF,0.7)
- -- arguments: x, y, text, color
- -- mytext = bridge.addText(10, 10, "hello!", 0xCC0000)
- --while true do
- -- term.clear()
- -- term.setCursorPos(1,1)
- -- print("1. Clear Glasses.")
- -- print("2. Print a blue rectangle.")
- -- print("3. Show matter fabricator")
- -- print("0. Exit")
- -- local answer = tonumber(read())
- -- if answer == 1 then
- -- bridge.clear()
- -- elseif answer == 2 then
- -- box = bridge.addBox(0,0,80,40,0x0099FF,0.7)
- -- elseif answer == 0 then
- -- break
- -- end
- -- end
Advertisement
Add Comment
Please, Sign In to add comment