Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function create(name,m,n)
- name = {}
- for i = 1,n do
- map[i] = {}
- for j = 1,m do
- map[i][j] = 0
- end
- end
- function Save(table,name)
- local file = fs.open(name,"w")
- file.write(textutils.serialize(table))
- file.close()
- end
- function Load(name)
- local file = fs.open(name,"r")
- local data = file.readAll()
- file.close()
- return textutils.unserialize(data)
- end
- timeS = 0
- timeM = 0
- timeH = 0
- timeD = 0
- term.clear()
- Reffils = 0
- Error = 0
- while true do
- while turtle.getItemCount(1) == 0 do
- term.setTextColor(colors.orange)
- term.setCursorPos(1,1)
- sleep(1)
- timeS = timeS + 1
- print("Standing by for:")
- term.setTextColor(colors.red)
- term.setCursorPos(3,3)
- term.clearLine(3)
- print(timeS, "seconds")
- if timeS == 60 then
- timeM = timeM + 1
- timeS = 0
- end
- if timeM == 60 then
- timeH = timeH + 1
- timeM = 0
- timeS = 0
- end
- if timeH == 24 then
- timeD = timeD + 1
- timeH = 0
- timeM = 0
- timeS = 0
- end
- if timeM ~= 0 then
- term.clearLine(2)
- term.setCursorPos(3,3)
- term.setTextColor(colors.red)
- print(timeM, "minutes", timeS, "seconds")
- end
- if timeH ~= 0 then
- term.clearLine(2)
- term.setCursorPos(3,3)
- term.setTextColor(colors.red)
- print(timeH, "hours", timeM, "minutes", timeS, "seconds")
- end
- if timeD ~= 0 then
- term.clearLine(2)
- term.setCursorPos(3,3)
- term.setTextColor(colors.red)
- print(timeD, "Days", timeH, "hours", timeM, "minutes", timeS, "seconds")
- end
- end
- local sorting, name = turtle.getItemDetail(1)
- if sorting.name == "minecraft:bucket" then
- turtle.drop()
- sleep(3)
- turtle.suck()
- turtle.dropDown()
- Reffils = Reffils + 1
- term.clearLine(8)
- term.setCursorPos(1,6)
- term.setTextColor(colors.green)
- print("Refills Done:")
- term.setCursorPos(3,8)
- term.setTextColor(colors.lime)
- print(Reffils, "refills")
- else
- turtle.dropDown()
- Error = Error + 1
- term.clearLine(11)
- term.setCursorPos(1,10)
- term.setTextColor(colors.red)
- print("Errors:")
- term.setCursorPos(3,12)
- print(Error, "errors")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement