Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- local engines = {peripheral.find('minecraft:archiengine')}
- while true do
- term.clear()
- term.setCursorPos(1,2)
- term.setTextColor(colors.lightBlue)
- local manipulator = peripheral.find('manipulator')
- local ender = manipulator.getEnder()
- local totalAmount = 0
- for i,v in pairs(engines) do
- local amount = 0
- for _ = 1,4 do
- amount = amount + ender.pushItems(peripheral.getName(v),1)
- end
- totalAmount = totalAmount + amount
- if amount > 0 then
- print('Added '..amount..' items to engine '..i)
- end
- end
- print()
- term.setTextColor(colors.green)
- print('Total fuel restocked: '..totalAmount)
- term.setTextColor(colors.yellow)
- print('Average fuel stocked per engine: '..totalAmount/#engines)
- local filledAmount = 0
- for i,v in pairs(engines) do
- for ii,vv in pairs(v.list()) do
- filledAmount = filledAmount + vv.count
- end
- end
- term.setTextColor(colors.orange)
- print('Total fuel levels: '..filledAmount..'/'..#engines*256)
- if totalAmount > 0 then
- term.setTextColor(colors.cyan)
- write('Fueling: ')
- local success = (filledAmount==#engines*256)
- if success then
- term.setTextColor(colors.green)
- print('Successful')
- else
- term.setTextColor(colors.red)
- print('Failed')
- end
- end
- term.setTextColor(colors.white)
- print()
- print('Press any button to re-fuel . . .')
- os.pullEvent('key_up')
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement