Driftix

Untitled

Mar 2nd, 2024 (edited)
1,238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1.  
  2.  
  3. local monitor = peripheral.find("monitor")
  4.  
  5. function display(message,x,y,speed)
  6.    
  7.     monitor.setTextScale(5)
  8.     monitor.clear()
  9.     monitor.setCursorPos(x,y)
  10.     monitor.write(message)
  11.     os.sleep(speed)
  12. end
  13.  
  14. function displayText()
  15.     if monitor then
  16.         local message = "Vive la démocratie"
  17.         local speed = 0.1
  18.         local width, height = monitor.getSize()
  19.         local y = math.floor((height/2)-1)
  20.         local x = width
  21.         print(x)
  22.         print(y)
  23.         while x > -string.len(message) do
  24.             display(message,x,y,speed)
  25.             x = x - 1
  26.         end
  27.         displayText()
  28.     else
  29.         print("Pas d'écran en sah")
  30.     end
  31. end
  32.  
  33. displayText()
Advertisement
Add Comment
Please, Sign In to add comment