So first you put the variables in:
event, button, x, y = os.pullEvent("mouse_click")
And now I'll tell you what each one does:button: Returns left, middle or right depending on what button you pressed.
x: The x in screen characters of your mouse click.
y: The y in screen characters of your mouse click.
So now let's use them:
if x == 1 and y == 1 then
print("You clicked in the top left corner!")
end
So the completed script is:
button, x, y = os.pullEvent("mouse_click")
if x == 1 and y == 1 then
print("You pressed on a monitr ajacent in the top left corner!")
end
You can also do monitor presses like this:So first you put the variables in:And now I'll tell you what each one does:event, side, x, y = os.pullEvent("monitor_press")
side: What side of the the monitor the press was on.
x: The x in screen characters of your mouse click.
y: The y in screen characters of your mouse click.
So now let's use them:So the completed script is:if x == 1 and y == 1 then print("You pressed on a monitor adjacent to the computer in the top left corner!") end
button, x, y = os.pullEvent("mouse_click") if x == 1 and y == 1 then print("You pressed on a monitor adjacent to the computer in the top left corner!") end