Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.redirect(peripheral.wrap("right"));
- chest = peripheral.wrap("bottom");
- function makeString(c)
- local h = tostring(c);
- if string.len(h) == 1 then
- return h.." ";
- end
- return h;
- end
- function makeInvStr(slot)
- return makeString(turtle.getItemCount(slot));
- end
- function getTotal()
- local h = 0;
- for i = 1, 16 do
- h = h +turtle.getItemCount(i);
- end
- turtle.getItemCount(slot)
- return h;
- end
- function getChest()
- local h = 0;
- for i = 1, chest.getInventorySize() do
- local l = chest.getStackInSlot(i);
- if l ~= null then
- h = h +l.qty;
- end
- i = i+1;
- end
- turtle.getItemCount(slot)
- return h;
- end
- while true do
- if turtle.detect() then
- turtle.dig();
- term.clear();
- term.setCursorPos(1, 1);
- print();
- print("Kiste: ");
- local ch = (getChest() *5);
- print(" " .. ch .. " (" .. (math.floor(ch /(chest.getInventorySize() *64) *100)) .. "%)");
- local tot = getTotal();
- print("Turtle: ");
- print(" " .. tot .. " (" .. (math.floor(tot /1024 *100)) .. "%)");
- print();
- print("+--+--+--+--+");
- print("|" .. makeInvStr(1) .. "|" .. makeInvStr(2) .. "|" .. makeInvStr(3) .. "|" .. makeInvStr(4) .. "|");
- print("|" .. makeInvStr(5) .. "|" .. makeInvStr(6) .. "|" .. makeInvStr(7) .. "|" .. makeInvStr(8) .. "|");
- print("|" .. makeInvStr(9) .. "|" .. makeInvStr(10) .. "|" .. makeInvStr(11) .. "|" .. makeInvStr(12) .. "|");
- print("|" .. makeInvStr(13) .. "|" .. makeInvStr(14) .. "|" .. makeInvStr(15) .. "|" .. makeInvStr(16) .. "|");
- print("+--+--+--+--+");
- print()
- print("by kingdingeling82")
- if turtle.getItemCount(16) == 64 then
- for i = 1, 16 do
- turtle.select(i);
- turtle.dropDown();
- end
- turtle.select(1);
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement