kizz12

extend

Apr 22nd, 2015
816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. term.setBackgroundColor(colors.black)
  4.  
  5. print'How many minutes would you like to add?'
  6. local mint=read()
  7. mint=tonumber(mint)
  8. local getType=type(mint)
  9. if getType=="number" then
  10.     if mint<=1440 and mint>0 then
  11.         secs=mint*60
  12.         os.queueEvent("extendme", secs)
  13.         print('Extended logout timer '..mint..' minute(s).')
  14.     end
  15.     if mint>1440 or mint<1 then
  16.         print'Invalid choice!'
  17.     end
  18. end
  19. if getType=="nil" or getType=="string" then
  20.     print'Numbers only please!'
  21. end
  22. sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment