Advertisement
k_goos

HouseServer

Jun 24th, 2013
85
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("ButtonAPI")
  2.  
  3. local side = "monitor_2"
  4.  
  5. function Button()
  6.     ButtonAPI.initMonitor(side)
  7.     ButtonAPI.addButton("button1", 1, 1, 11, 10, "test")
  8.     ButtonAPI.addButton("button2", 11, 11, 5, 5, "test02")
  9.     ButtonAPI.draw()
  10.     ButtonAPI.initEventHandler(EventHandler)
  11.     print("Done")
  12. end
  13. function EventHandler()
  14.     while true do
  15.         local event, name, x, y = os.pullEvent("button")
  16.         print("Event: " .. event .. " Name: " .. name .. " X: " .. x .. " Y: " .. y)
  17.     end
  18. end
  19.  
  20. Button()
Advertisement
RAW Paste Data Copied
Advertisement