Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ButtonAPI")
- local side = "monitor_2"
- function Button()
- ButtonAPI.initMonitor(side)
- ButtonAPI.addButton("button1", 1, 1, 11, 10, "test")
- ButtonAPI.addButton("button2", 11, 11, 5, 5, "test02")
- ButtonAPI.draw()
- ButtonAPI.initEventHandler(EventHandler)
- print("Done")
- end
- function EventHandler()
- while true do
- local event, name, x, y = os.pullEvent("button")
- print("Event: " .. event .. " Name: " .. name .. " X: " .. x .. " Y: " .. y)
- end
- end
- Button()
Advertisement
RAW Paste Data
Copied
Advertisement