Advertisement
bobmarley12345

i

Jun 23rd, 2021 (edited)
970
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. monitor = peripheral.wrap("right")
  2.  
  3. function drawVertText(x, y, text, background, foreground)
  4.     local newY = y;
  5.     monitor.setCursorPos(x, newY)
  6.     monitor.setBackgroundColor(background)
  7.     monitor.setTextColor(foreground)
  8.     for i = 1, string.len(text), 1 do
  9.         monitor.write(text:sub(i,i))
  10.         newY = newY + 1
  11.         monitor.setCursorPos(x, newY)
  12.     end
  13. end
  14.  
  15. function main()
  16.     while (true) do
  17.         if (monitor == nil) then
  18.             monitor = peripheral.wrap("right")
  19.         end
  20.  
  21.         if (monitor ~= nil) then
  22.             monitor.setBackgroundColor(colours.grey)
  23.             monitor.clear()
  24.  
  25.             drawVertText(1, 1, "Machines", colours.grey, colours.white)
  26.             drawVertText(5, 1, "Trees", colours.grey, colours.white)
  27.             drawVertText(9, 1, "PAs", colours.grey, colours.white)
  28.         end
  29.  
  30.         os.sleep(5)
  31.     end
  32. end
  33.  
  34. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement