Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function slates()
- i = 0
- timeRemaining = totalTime
- slatesRemaining = slatesRequested
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print("Created: " .. i .. "")
- print("Remaining: " .. slatesRemaining .. "")
- print("Time until complete: " .. timeRemaining .. "")
- timeRemaining = timeRemaining - timePerSlate
- slatesRemaining = slatesRemaining - i
- i = i + 1
- turtle.drop(1)
- sleep(timePerSlate)
- if i = slatesRequested then finished()
- end
- end
- end
- function finished()
- print("I have finished creating " .. slatesRequested .. " " .. slateType .. "")
- sleep(3)
- main()
- end
- function continue()
- y = "y", "Y"
- n = "n", "Y"
- cont = read()
- if cont == y then
- print("Yes Test")
- sleep(2)
- slates()
- elseif cont == n then
- print("No Test")
- sleep(2)
- main()
- else
- print("Please make a valid selection.")
- end
- end
- function main()
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print("Enter the number that corresponds to the item you want crafted.")
- print("[1] Blank Slate")
- print("[2] Reinforced Slate")
- print("[3] Imbued Slate")
- print("[4] Demonic Slate")
- write("> ")
- input = read()
- while true do
- if
- input == "1" then
- slateType = " Blank Slates"
- timePerSlate = 11
- elseif
- input == "2" then
- slateType = " Reinforced Slates"
- timePerSlate = 11
- elseif
- input == "3" then
- slateType = " Imbued Slates"
- timePerSlate = 11
- elseif
- input == "4" then
- slateType = " Demonic Slates"
- timePerSlate = 11
- else
- print("That is not a vaild option, please try again")
- end
- end
- end
- do
- term.clear()
- term.setCursorPos(1, 1)
- print("How many" .. slateType .. " do you want crafted?")
- write("> ")
- slatesRequested = read()
- totalTime = timePerSlate*slatesRequested
- print("It will take apx " .. totalTime .. " seconds to complete this task.")
- print("You want " .. slatesRequested .. " of " .. slateType .. "?")
- write("Do you wish to continue? y/n > ")
- continue()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement