Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ANVI.COREPROG-MINEFACTORY
- -- osirisgothra
- -- gabriel.sharp april.2017
- print("scanning...")
- local ifaces = {}
- for i,name in pairs(peripheral.getNames()) do
- if string.match(name,'transvector') then
- print("adding machine to interfaces: ",name)
- table.insert(ifaces,peripheral.wrap(name))
- else
- print("skipping: ",name)
- end
- end
- --- begin monitoring
- local mon = peripheral.wrap('monitor_134')
- local timeout = 2.5
- print("entering monitoring loop...")
- while true do
- ypos=1
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Name Item Complete")
- mon.setCursorPos(1,2)
- mon.write("-------------------------------------------")
- print("about to enter iteration...")
- for i,x in pairs(ifaces) do
- print("iteration of: ",i,x)
- uname = tostring( x.getInvName() )
- uitem = tostring( x.getStackInSlot(0).name )
- ypos=ypos+1
- mon.setCursorPos(1,ypos)
- mon.clearLine()
- mon.write(uname)
- mon.setCursorPos(16,ypos)
- mon.write(uitem)
- mon.setCursorPos(30,ypos)
- mon.write(tostring(math.floor(x.getWorkMax()/x.getWorkDone()*100)))
- end
- sleep(timeout)
- end
Add Comment
Please, Sign In to add comment