Advertisement
Guest User

Untitled

a guest
Jul 12th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. function slates()
  2. i = 0
  3. timeRemaining = totalTime
  4. slatesRemaining = slatesRequested
  5. while true do
  6. term.clear()
  7. term.setCursorPos(1, 1)
  8. print("Created: " .. i .. "")
  9. print("Remaining: " .. slatesRemaining .. "")
  10. print("Time until complete: " .. timeRemaining .. "")
  11. timeRemaining = timeRemaining - timePerSlate
  12. slatesRemaining = slatesRemaining - i
  13. i = i + 1
  14. turtle.drop(1)
  15. sleep(timePerSlate)
  16. if i = slatesRequested then finished()
  17. end
  18. end
  19. end
  20.  
  21. function finished()
  22. print("I have finished creating " .. slatesRequested .. " " .. slateType .. "")
  23. sleep(3)
  24. main()
  25. end
  26.  
  27. function continue()
  28. y = "y", "Y"
  29. n = "n", "Y"
  30. cont = read()
  31. if cont == y then
  32. print("Yes Test")
  33. sleep(2)
  34. slates()
  35. elseif cont == n then
  36. print("No Test")
  37. sleep(2)
  38. main()
  39. else
  40. print("Please make a valid selection.")
  41. end
  42. end
  43.  
  44. function main()
  45. while true do
  46. term.clear()
  47. term.setCursorPos(1, 1)
  48. print("Enter the number that corresponds to the item you want crafted.")
  49. print("[1] Blank Slate")
  50. print("[2] Reinforced Slate")
  51. print("[3] Imbued Slate")
  52. print("[4] Demonic Slate")
  53. write("> ")
  54.  
  55. input = read()
  56. while true do
  57. if
  58. input == "1" then
  59. slateType = " Blank Slates"
  60. timePerSlate = 11
  61. elseif
  62. input == "2" then
  63. slateType = " Reinforced Slates"
  64. timePerSlate = 11
  65. elseif
  66. input == "3" then
  67. slateType = " Imbued Slates"
  68. timePerSlate = 11
  69. elseif
  70. input == "4" then
  71. slateType = " Demonic Slates"
  72. timePerSlate = 11
  73. else
  74. print("That is not a vaild option, please try again")
  75. end
  76. end
  77. end
  78.  
  79. do
  80. term.clear()
  81. term.setCursorPos(1, 1)
  82.  
  83. print("How many" .. slateType .. " do you want crafted?")
  84. write("> ")
  85. slatesRequested = read()
  86. totalTime = timePerSlate*slatesRequested
  87. print("It will take apx " .. totalTime .. " seconds to complete this task.")
  88. print("You want " .. slatesRequested .. " of " .. slateType .. "?")
  89. write("Do you wish to continue? y/n > ")
  90. continue()
  91.  
  92.  
  93. end
  94. end
  95. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement