---- Super Security Door, By Gustavo Wizard, @2014
---- This program needs Direwolf20 Button API
---- This program needs 2 monitors (bottom 1x1 and top 3x1) 
---- Plz give credit for me and for the button API author if using this program in any way


os.loadAPI("btn")
m = peripheral.wrap("top")

m.setTextScale(0.5)

while true do
m.setBackgroundColor(colors.black)
m.clear()
m.setCursorPos(5,1)
m.setTextColor(colors.cyan)
m.write("TELEPORT")
m.setTextColor(colors.white)
m.setCursorPos(2,13)
m.write("Terminal: T2")
m.setCursorPos(2,15)
m.write("Location:")
m.setCursorPos(2,16)
m.write("Main Section")
m.setCursorPos(2,18)
m.write("Destiny:")
m.setCursorPos(2,19)
m.write("Nuclear Core")

term.redirect(m)
paintutils.drawLine(2,3,14,3,colors.magenta)
paintutils.drawLine(2,9,14,9,colors.magenta)
paintutils.drawLine(2,3,2,9,colors.magenta)
paintutils.drawLine(14,3,14,9,colors.magenta)
m.setBackgroundColor(colors.blue)
m.setTextColor(colors.white)


function fillTable()
 btn.setTable("BEAM ME!", beam, 4,12,5,7)
 btn.screen()
end

function getClick()
 event,side,x,y = os.pullEvent("monitor_touch")
 btn.checkxy(x,y)
end

function beam()
 rs.setOutput("front", true)
 sleep(1)
 rs.setOutput("front", false)
end

fillTable()

getClick()

end

