Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dispInvAsTbl(monitor,x,y)
- local c = 1
- while( c < 17) do
- monitor.setCursorPos((c - (4 * (math.ceil(c/4) - 1))) * 3 + x - 3, math.ceil(c/4) + y - 1)
- monitor.write(string.sub(turtle.getItemCount(c), -2))
- monitor.setCursorPos((c - (4 * (math.ceil(c/4) - 1))) * 3 + x - 1, math.ceil(c/4) + y - 1)
- if((c - (4 * (math.ceil(c/4) - 1))) ~= 4 ) then
- monitor.write("|")
- end
- c = c + 1
- end
- end
- function getInv() --Returns total inventory of the turtle
- local c = 1
- local total = 0
- while( c < 17) do
- total = total + turtle.getItemCount(c)
- c = c + 1
- end
- return total
- end
- cobble = 0
- mon = peripheral.wrap("left")
- mon.clear()
- term.clear()
- dispInvAsTbl(mon,3,3)
- mon.setCursorPos(3,8)
- mon.write(string.sub(getInv(),1))
- while(1) do
- if(turtle.detect() and redstone.getInput("right") and getInv() < 1024) then
- turtle.dig()
- cobble = cobble + 1
- mon.clear()
- dispInvAsTbl(mon,3,3)
- mon.setCursorPos(3,8)
- mon.write(string.sub(getInv(),1))
- end
- mon.setCursorPos(1,1)
- mon.write("C-Miner v10.7.14")
- mon.setCursorPos(1,2)
- mon.write("Total Mined: ".. cobble)
- mon.setCursorPos(7,8)
- mon.write("/1024")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement