Advertisement
Rolcam

Computercraft Money Booth Timer

Feb 13th, 2025 (edited)
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.83 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. check = 1
  4.  
  5. while check == 1 do
  6.     term.setTextColor(colors.yellow)
  7.     print("\"Money\" Booth V1")
  8.     print("Please enter duration in seconds:")
  9.     input = tonumber(read())
  10.     if tonumber(input) == nil then
  11.         term.setTextColor(colors.red)
  12.         print("Invalid Selection! Please try again.")
  13.     else
  14.         check = 0
  15.     end
  16. end
  17.  
  18. print("Timer set to: " .. input .. " seconds!")
  19. print("Press \"enter\" to begin!")
  20. read()
  21.  
  22. rs.setBundledOutput("back", colors.white)
  23. while input > 0 do
  24.     term.setTextColor(colors.yellow)
  25.     term.clear()
  26.     term.setCursorPos(1,1)
  27.     print("\"Money\" Booth V1")
  28.     print("There are " .. input .. " seconds remaining!")
  29.     sleep(1)
  30.     input = input - 1
  31. end
  32. rs.setBundledOutput("back", 0)
  33. term.clear()
  34. term.setCursorPos(1,1)
  35. print("Times Up!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement