Advertisement
Faited

ComputerCraft Menu!

May 23rd, 2022
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local monitor = peripheral.find("monitor")
  2. local image1 = paintutils.loadImage("icons/exit_icon.nfp")
  3. local image2 = paintutils.loadImage("icons/iron_icon.nfp")
  4.  
  5. monitor.setTextScale(0.5)
  6.  
  7. monitor.setCursorPos(1,1)
  8. paintutils.drawImage(image1, term.getCursorPos())
  9.  
  10. monitor.setCursorPos(3,6)
  11. paintutils.drawImage(image2, term.getCursorPos())
  12.  
  13. while true do
  14.   local event, button, x, y = os.pullEvent("mouse_click")
  15.  
  16.   if (x < 6 and y < 6) then
  17.     monitor.setBackgroundColor(32768)
  18.     monitor.clear()
  19.     return
  20.   end
  21.  
  22.  
  23.  
  24. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement