Advertisement
DOGGYWOOF

Doggy OS Suspend / system sleep service

Nov 21st, 2024 (edited)
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. -- Transition Effect
  2. local function transitionTo(colorSequence, delay)
  3. for _, color in ipairs(colorSequence) do
  4. term.setBackgroundColor(color)
  5. term.clear()
  6. sleep(delay)
  7. end
  8. end
  9.  
  10. -- Intro Transition: Fade to Black
  11. local function introTransition()
  12. local colorsToFade = {
  13. colors.white, colors.lightGray, colors.gray, colors.black
  14. }
  15. transitionTo(colorsToFade, 0.1)
  16. end
  17.  
  18. -- Outro Transition: Fade to White
  19. local function outroTransition()
  20. local colorsToFade = {
  21. colors.black, colors.gray, colors.lightGray, colors.white
  22. }
  23. transitionTo(colorsToFade, 0.1)
  24. end
  25.  
  26. -- Main Program
  27. introTransition() -- Smooth transition to blank screen
  28. os.pullEvent("key") -- Wait for any key press
  29. outroTransition() -- Smooth transition to white
  30. sleep(0.3) -- Wait an additional 0.1 seconds after the outro transition
  31. shell.run("/disk/os/lock") -- Run the lock program
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement