Monitor

From ComputerCraft
Jump to: navigation, search
EventEventmonitor_resize
Occurs every time a connected Monitor resizes, for example when a player places or destroy Monitor blocks.
Returns
Part of CC:Tweaked
ExampleExampleNotify about resize
Notifies the user when a connected Monitor has been resized.
Code
while true do
  local event, peripheral_name = os.pullEvent("monitor_resize")
  local x, y = peripheral.call(peripheral_name, "getSize")
  print("Monitor", peripheral_name, "has been resized to", x, ",", y)
end
EventEventmonitor_touch
Occurs every time a player right clicks on an advanced monitor. Note Note: This event is only called on Advanced Monitors.
Returns
Part of CC:Tweaked
ExampleExamplePrint touched coordinates
Prints the touched coordinates every time a player touches a connected Advanced Monitor.
Code
while true do
  local event, peripheral_name, x, y = os.pullEvent("monitor_touch")
  print("A monitor has been pressed at " .. x .. ", " .. y)
end