FFGFlash

menu

Sep 17th, 2021 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local eh = events.createHandler()
  2. local running = true
  3.  
  4. local test = {0,0}
  5.  
  6. eh:connect("mouse_up", function(btn, x, y)
  7.   test = {x, y}
  8. end)
  9.  
  10. function draw()
  11.   term.setBackgroundColor(colors.black)
  12.   term.setTextColor(colors.white)
  13.   term.clear()
  14.   term.setCursorPos(1,1)
  15.   paintutils.drawFilledBox(test[1],test[2],1,1,colors.white)
  16.   sleep(1/30)
  17. end
  18.  
  19. while running do
  20.   parallel.waitForAny(eh.update, draw)
  21. end
  22.  
Add Comment
Please, Sign In to add comment