Advertisement
Convo_bomber34

MouseClick(API)

Sep 22nd, 2013
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. --MouseClick
  2. function click(x1,y1,x2,y2)
  3.    
  4.   local event,button,x,y = os.pullEvent()
  5.   if event == "mouse_click" then
  6.     if x1 == "get" then
  7.       return x,y
  8.     elseif x1 == nil or y1 == nil then
  9.       return true
  10.     else
  11.       x1 = tonumber(x1)
  12.       y1 = tonumber(y1)
  13.       x2 = tonumber(x2)
  14.       y2 = tonumber(y2)
  15.       if x > x1 - 1 and x < x2 + 1 and y > y1 - 1 and y < y2 + 1 then
  16.         return true
  17.       else
  18.         return false
  19.       end
  20.     end
  21.   end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement