drProfessorGTA

[OC]Farbtest

Dec 14th, 2020 (edited)
644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. local component = require("component")
  2. local gpu = component.gpu
  3. local w, h = gpu.getResolution()
  4. local mon = require("tty")
  5. local event = require("event")
  6.  
  7. mon.clear()
  8.  
  9. gpu.setBackground(0x000000)
  10. gpu.fill(1, 1, w, h, " ")
  11.  
  12. gpu.setBackground(0xFF0000)
  13. gpu.fill(30, 15, 100, 25, " ")
  14.  
  15.  
  16.  
  17. while true do
  18.     local _,_,x,y = event.pull("touch")
  19.     if x>30 and x<130 and y>15 and y<40 then
  20.         local color = math.random(0x000000,0xFFFFFF)
  21.         gpu.setBackground(color)
  22.         gpu.fill(1, 1, w, h, " ")
  23.         gpu.setBackground(0x00FF00)
  24.         gpu.fill(30, 15, 100, 25, " ")
  25.         os.sleep(3.0)
  26.         gpu.setBackground(0x000000)
  27.         gpu.fill(1, 1, w, h, " ")
  28.         gpu.setBackground(0xFF0000)
  29.         gpu.fill(30, 15, 100, 25, " ")
  30.     end
  31. end
  32.  
Advertisement
Add Comment
Please, Sign In to add comment