Advertisement
Te-ki

CCQuarryStartup

Mar 28th, 2017
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. -- CCQuarryStartup by Teki
  2.  
  3. local monitor = term.current()
  4. local sizeX,sizeY = monitor.getSize()
  5.  
  6. local timeout = 5
  7. local elapsed = 0
  8.  
  9. monitor.setBackgroundColour(colors.black)
  10. monitor.setTextColor(colors.white)
  11. monitor.clear()
  12.  
  13. local myTimer
  14.  
  15. while true do
  16.     myTimer = os.startTimer(1)
  17.     if elapsed == timeout then
  18.         shell.run("ccquarry")
  19.         return 0
  20.     end
  21.    
  22.     event, side, xPos, yPos = os.pullEvent()
  23.     if event == "key" then
  24.         monitor.clear()
  25.         monitor.setCursorPos(1,1)
  26.         return 0
  27.     elseif event == "timer" then
  28.         elapsed = elapsed + 1
  29.     end
  30.    
  31.     monitor.clear()
  32.     monitor.setCursorPos(6,3)
  33.     write("Trying to resume ccquarry...")
  34.     monitor.setCursorPos(4,sizeY)
  35.     write("(Press any key to cancel... ".. timeout - elapsed .. ")")
  36.    
  37.     sleep(1)
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement