Advertisement
Guest User

kiosk

a guest
Mar 19th, 2024
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. constants = require("shared/constants")
  2. monitor = peripheral.wrap("top")
  3.  
  4. -- Draws the welcome screen
  5. -- Returns all buttons and their bounding box
  6. function print_welcome_screen()
  7.     default_color()
  8.     monitor.clear()
  9.    
  10.     monitor.setCursorPos(2, 1)
  11.     monitor.write("Lotto")
  12.    
  13.     monitor.setCursorPos(1, 3)
  14.     monitor.write("Leg 1 Diamant in das Fass und klicke")
  15.    
  16.     invert_color()
  17.     monitor.setCursorPos(3, 8)
  18.     monitor.write("      ")
  19.     monitor.write(" Hier ")
  20.     monitor.write("      ")
  21.  
  22. end
  23.  
  24.  
  25. function default_color()
  26.     monitor.setBackgroundColor(constants.default_bg)
  27.     monitor.setTextColor(constants.default_fg)
  28. end
  29.  
  30. function invert_color()
  31.     local current_fg = monitor.getTextColor()
  32.     local current_bg = monitor.getBackgroundColor()
  33.    
  34.     monitor.setBackgroundColor(current_fg)
  35.     monitor.setTextColor(current_bg)
  36. end
  37.  
  38. print_welcome_screen()
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement