Advertisement
GravityCube

Untitled

Dec 13th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. text = "Welcome to CasinoName"
  2. os.loadAPI("gcapi")
  3. mons = {peripheral.find("monitor")}
  4.  
  5. function setCursorPos(x,y)
  6. for _,mon in pairs(mons) do
  7. mon.setCursorPos(x,y)
  8. end
  9. end
  10. function write(text)
  11. for _,mon in pairs(mons )do
  12. mon.write(text)
  13. end
  14. end
  15. function setBackgroundColor(color)
  16. for _,mon in pairs(mons) do
  17. mon.setBackgroundColor(color)
  18. end
  19. end
  20. function clear()
  21. for _,mon in pairs(mons) do
  22. mon.clear()
  23. end
  24. end
  25.  
  26. max_x, max_y = mons[1].getSize()
  27. c = 25
  28. reverse = false
  29. while true do
  30. setBackgroundColor(colors.black)
  31. clear()
  32. setCursorPos(gcapi.getCenter(max_x, text), gcapi.getCenter(max_y))
  33. write(text)
  34.  
  35. setBackgroundColor(colors.cyan)
  36. for x=1, max_x do
  37. for y=1, max_y do
  38. t = (x^2 + y^2)
  39. if t > (c^2) or t < (c-50)^2 or x == 1 or y == 1 or x == max_x or y == max_y then
  40. setCursorPos(x,y)
  41. write(" ")
  42. end
  43. end
  44. end
  45. if reverse then
  46. c = c -2
  47. end
  48. c= c + 1
  49. if c > 50 then
  50. sleep(3)
  51. reverse = true
  52. end
  53. if c < 22 then
  54. sleep(1)
  55. reverse = false
  56. end
  57. sleep(0.05)
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement