Posted 03 October 2012 - 08:05 PM
Anyone gimme a hand with this? It runs the elevate function upon starting or any key being pressed for some reason that evades me.
thanks
thanks
function clear()
term.clear()
term.setCursorPos (1,1)
end
local function centerText(text)
local x,y = term.getSize()
local x2,y2 = term.getCursorPos()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), (y / 2))
write(text)
end
function elevate()
for i = 1,40 do
rs.setBundledOutput("bottom", colors.blue)
sleep(0.2)
rs.setBundledOutput("bottom", colors.black)
sleep(0.2)
end
sleep(4)
for o = 1,40 do
rs.setBundledOutput("bottom", colors.red)
sleep(0.2)
rs.setBundledOutput("bottom", colors.black)
sleep(0.2)
end
sleep(1)
shell.run("elevator")
end
while true do
clear()
rednet.open("back")
centerText ("Secure area, clearance required.")
local event, param1 = os.pullEvent ()
if event == "char" or "rednet_message" then
if param1 == "]" or "215" then
elevate()
else
sleep (1.5)
shell.run("elevator")
end
else
sleep(1.5)
shell.run("elevator")
end
end