Advertisement
Drunkmonkey

Computer craft/Tinkers Construct Auto pour *WORKING*

Jan 27th, 2021 (edited)
1,064
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.21 KB | None | 0 0
  1. --Version 0.8--
  2. --CHANGELOG--  
  3. --Added Time left too the poor loop--
  4. --Changed the program to ask what you are smelting before asking how many blocks--
  5. --Added Title announceing program--
  6. --Time now rounds up so as to not be confusing--
  7. --FUTURE PLANS--
  8. --Plan to add functions to clean up code--
  9. --Plan to add Rednet output--
  10. --Plan to add function that counts the amount of blocks smelted and stores that info--
  11. --Plan to add function that will bring up a "stats" page to display info about the smelter--
  12. --Plan to Add Error Handling--
  13. Version = 0.8
  14. term.clear()
  15. term.setCursorPos(1,1)
  16. print("Welcome to the Auto Pour!")
  17. print("Created by Kyle Hendry (V01D)!")
  18. sleep(3)
  19. term.clear()
  20. term.setCursorPos(1,1)
  21. --setTextColor(colors.red)
  22. print("Auto Pour Version " .. Version)
  23. --setTextColor(colors.white)
  24. print("What side is the spout on?")
  25. print("Options: front, back, left, right, top, bottom")
  26. side=read()
  27. term.clear()
  28. term.setCursorPos(1,1)
  29.     while true do
  30.         print("NO CAPITALS")
  31.         print("What are you smelting?")
  32.         input = { gold = 15, iron = 18, bronze = 25, aluminum = 20, copper = 30, lead = 23, stone = 10, cobalt = 45, tin = 16, brass = 25, glass = 18, clay = 15, zinc = 15}
  33.         time = input[io.read()]
  34.         term.clear()
  35.         term.setCursorPos(1,1)
  36.         print("How many block's are you smelting? Make sure its a number.")
  37.         blocks=tonumber(read())
  38.         doneIn = (time * blocks) / 60
  39.         print("It will take: " .. math.ceil(doneIn) .. " Minutes to complete")
  40.         sleep(2)
  41.         print("Starting..")
  42.         sleep(2)
  43.         blocksLeft = blocks
  44.  
  45.         for i=1, blocks do
  46.             term.setBackgroundColor(colors.black)
  47.             term.clear()
  48.             term.setCursorPos(1,1)
  49.             redstone.setOutput(side, true)
  50.             sleep(1)
  51.             redstone.setOutput(side, false)
  52.             print("Pouring block " .. i)
  53.             timeLeft = (time * blocksLeft) / 60
  54.             print("Time left: " .. math.ceil(timeLeft).. " Minutes")
  55.             sleep(time-1)
  56.             term.setBackgroundColor(colours.black)
  57.             term.clear()
  58.             term.setCursorPos(1,1)
  59.             blocksLeft = blocksLeft - 1
  60.          end
  61.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement