Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bridge = peripheral.wrap("left")
- local width = 200
- local machines = {
- {
- ["id"] = "matter_fabricator_0",
- ["name"] = "Matter Fab"
- }
- }
- for key,value in pairs(machines) do
- machines["label"] = bridge.addText(5,5,"Matter Fabricator:",0xFF00FF)
- machines["bar"] = bridge.addBox(5,15,0,5,0xCC0000,0.0)
- machines["bar"].setZIndex(2)
- end
- while true do
- for i=#machines,1,-1 do
- machine = machines[i]
- if net.isPresentRemote(machine["id"]) then
- progress = net.callRemote(machine["id"],"getProgress")
- machine["bar"].setWidth(width*progress/100)
- else
- machine["bar"].delete()
- machine["label"].delete()
- end
- end
- 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