Advertisement
jesusthekiller

test single use button

Jun 1st, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. os.unloadAPI("button")
  2. os.loadAPI("button")
  3.  
  4. button.makeSingleUseButton({["startx"] = 2, ["starty"] = 2, ["stopx"] = 4, ["stopy"] = 5},
  5.         {["color_bkg"] = colors.lime, ["color_text"] = colors.white, ["text"] = "lol", ["textStartPosX"] = 2, ["textStartPosY"] = 3, ["click_color_text"] = colors.black, ["click_color_bkg"] = colors.green, ["event_value"] = "lol"},
  6.         1,
  7.         function() while true do local e, k = os.pullEvent("key"); if k == keys.q then button.removeButton("lol"); return end end end,
  8.         function() term.setTextColor(colors.white); term.setBackgroundColor(colors.black); print("Click!"); end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement