Advertisement
Guest User

event

a guest
Aug 27th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. --loop de eventos
  2. while run do
  3.     event, button, x, y = os.pullEvent()
  4.  
  5.     if event == "mouse_click" and ms == 0 and button == 1 and x <= 7 and y == 1 then
  6.         sub_menu()
  7.         ms = 1
  8.         elseif event == "mouse_click" and ms == 1 and button == 1 and x <= 7 and y == 1 then
  9.             ms = 0
  10.             sub_menu_off()
  11.    
  12.         elseif event == "mouse_click" and ms == 1 and button == 1 and x <= 7 and y == 2 then
  13.             os.shutdown()
  14.  
  15.         elseif event == "mouse_click" and ms == 1 and button == 1 and x <= 7 and y == 3 then
  16.             clear()
  17.             run = false
  18.         elseif event == "mouse_click" and ms == 1 and button == 1 and x <= 7 and y == 4 then
  19.             turtle()
  20.            
  21.         elseif event == "mouse_click" and ms == 1 and button == 1 and x <= 7 and y == 5 then
  22.             paint()
  23.  
  24.            
  25.     end
  26.  
  27.      
  28.     if event == "mouse_click" and onclick == 0 and button == 2 and x >=1 and y >= 2 then
  29.         onclick = 1
  30.         mouse_button_left()
  31.        
  32.         posx = x
  33.         posy = y
  34.        
  35.         elseif event == "mouse_click" and onclick == 1 and button == 2 then
  36.             onclick = 0
  37.             backsys()
  38.             menu()
  39.      
  40.     end
  41.  
  42.     if event == "mouse_click" and onclick == 1 and button == 1 and x >= posx and x <= (posx+11) and y == posy then
  43.         os.shutdown()
  44.     end
  45.  
  46.     if event == "mouse_click" and onclick == 1 and button == 1 and x >= posx and x <= (posx+11) and y == (posy+1) then
  47.         clear()
  48.         run = false
  49.     end
  50.  
  51.     if event == "mouse_click" and onclick == 1 and button == 1 and x >= posx and x <= (posx+11) and y == (posy+2) then
  52.         turtle()
  53.     end
  54.  
  55.     if event == "mouse_click" and onclick == 1 and button == 1 and x >= posx and x <= (posx+11) and y == (posy+3) then
  56.         paint()
  57.     end
  58.  
  59.  
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement