Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sensor = peripheral.wrap("right")
- local targets = sensor.getTargets()
- local totalStackSize = 0
- local currentStackSize = 0;
- local percentage = 100;
- while true do
- local details = sensor.getTargetDetails("bottom")
- local firstSlot = details[1];
- currentStackSize = tonumber(firstSlot["size"])
- -- the stack size has increased, so we've probably added to the machine
- if currentStackSize > totalStackSize then
- totalStackSize = currentStackSize
- end
- percentage = (100 - ((100/totalStackSize) * currentStackSize));
- print( percentage.. "% of the way through")
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement