This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Skullblade's profile picture

Advanced CPU Mouse Function

Started by Skullblade, 28 October 2012 - 10:07 PM
Skullblade #1
Posted 28 October 2012 - 11:07 PM
Okay guys so here is a small example program for how to use the mouse function. Nothing special but if you do use this EXACT program in your program then PLZ give credit. Otherwise have fun and edit the hell out of my program :D/>/>

Spoilerprint ("Menu-Click the Number")
print ("1.Option 1")
print ("2.Option 2")
print ("3.Option 3")

while true do
local event, button, X, Y = os.pullEvent("mouse_click")
XY = X..","..Y

if XY == "1,2" then
– Do stuff for Option 1
break
end


if XY == "1,3" then
– Do stuff for Option 2
break
end


if XY == "1,4" then
– Do stuff for Option 3
break
end
end

EDIT- By CPU I mean computer…sorry about the confusion
Mads #2
Posted 29 October 2012 - 03:54 PM
It's not a CPU, it's a computer.
Skullblade #3
Posted 29 October 2012 - 04:48 PM
Sorry ik CPU is central processing unit so your right its not technically a CPU but i like to use CPU as a abbreviation for computer even if its not completely correct.

Sorry about that bad habit.