Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pim = peripheral.wrap('front')
- local chest = peripheral.wrap('left')
- -- Monitor Setup
- local monitor = peripheral.wrap('top')
- monitor.setTextScale(0.5)
- function startCheck()
- if not pim then
- error('PIM not found')
- end
- if not chest then
- error('Chest not found')
- end
- if not stacks then
- error('No stacks found?')
- end
- end
- function initiate()
- startCheck()
- update()
- end
- function resetMonitor()
- monitor.clear()
- monitor.setCursorPos(1,1)
- end
- function newLine()
- local _,cY= monitor.getCursorPos()
- monitor.setCursorPos(1,cY+1)
- end
- function update()
- if ( pim.getInventorySize() > 0 ) then
- resetMonitor()
- local stacks = pim.getAllStacks()
- print(monitor)
- monitor.write('I am here')
- for name,stack in pairs(stacks) do
- print(stack.all().id)
- newLine()
- monitor.write(stack.all().id)
- end
- sleep(1)
- else
- print('Debug2');
- resetMonitor()
- monitor.write('No items found!')
- sleep(2)
- end
- update()
- end
- initiate()
Advertisement
Add Comment
Please, Sign In to add comment