Posted 13 January 2013 - 07:08 PM
Hi there, I have this program, however whenever i try and run it, it spits out random numbers?
I have no idea why! The login seems to work, but the rest dosn't run, and then lua spits out random numbers, which is why i have put the login as a note.
Any help is much appreactiated. :)/>
I have no idea why! The login seems to work, but the rest dosn't run, and then lua spits out random numbers, which is why i have put the login as a note.
Any help is much appreactiated. :)/>
-- {{
x = 7
function applelogin()
term.clear()
term.setCursorPos(1,1)
print("Apple (Staff Computer)")
print("V1.2.1")
term.setCursorPos(1,17)
print("Login..")
--
term.setCursorPos(7,5)
print("------------------------------------")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| Logging on? Enter your |")
term.setCursorPos(7,8)
print("| staff username bellow! |")
term.setCursorPos(7,9)
print("| |")
term.setCursorPos(7,10)
print("------------------------------------")
staffnumberinput = read()
rednet.open("right")
rednet.send(x, staffnumberinput)
id, msg = rednet.receive(5)
rednet.close("right")
if (id == x) then
term.clear()
term.setCursorPos(1,1)
print("Apple (Staff Computer)")
print("V1.2.1")
term.setCursorPos(1,17)
print("Login..")
--
term.setCursorPos(7,5)
print("------------------------------------")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| Enter Your Password: |")
term.setCursorPos(7,8)
print("| |")
term.setCursorPos(7,9)
print("------------------------------------")
staffpassinput = read("*")
if staffpassinput == msg then
print("Welcome "..staffnumberinput.."!")
sleep(2)
else
print("Sorry, that was incorrect!")
sleep(2)
applelogin()
end
else
print("Sorry, that was incorrect!")
sleep(2)
applelogin()
end
end
applelogin()
}}
local clear = "clear"
local mbpro = 15
local mbair = 17
local imac = 18
local macmini = 19
term.clear()
term.setCursorPos(1,1)
print("Apple (Genius Help Computer)")
print("V1.2.1")
term.setCursorPos(1,17)
print("Genius (Help)")
--
term.setCursorPos(7,5)
print("------------------------------------")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| Waiting for entry... |")
term.setCursorPos(7,8)
print("| Hold down CTRL-R to logout: |")
term.setCursorPos(7,9)
print("| |")
term.setCursorPos(7,10)
print("------------------------------------")
rednet.open("right")
id, msg = rednet.receive()
rednet.close("right")
if id == mbpro then
rednet.open("right")
rednet.send(id, "Help On the way")
rednet.close("right")
term.clear()
term.setCursorPos(1,1)
print("Apple (Genius Help Computer)")
print("V1.2.1")
term.setCursorPos(1,17)
print("Genius (Help)")
--
term.setCursorPos(7,5)
print("------------------------------------")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| Help needed at: |")
term.setCursorPos(7,8)
print("| MacBook Pro: 15 |")
term.setCursorPos(7,9)
print("| Type clear to clear: |")
term.setCursorPos(7,10)
print("------------------------------------")
write(">")
input = read()
if input ~= clear then
print("Hmm, that wasn't one of the options!")
sleep(2)
end
elseif id == mbair then
rednet.open("right")
rednet.send(id, "Help On the way")
rednet.close("right")
term.clear()
term.setCursorPos(1,1)
print("Apple (Genius Help Computer)")
print("V1.2.1")
term.setCursorPos(1,17)
print("Genius (Help)")
--
term.setCursorPos(7,5)
print("------------------------------------")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| Help needed at: |")
term.setCursorPos(7,8)
print("| MacBook Air: 17 |")
term.setCursorPos(7,9)
print("| Type clear to clear: |")
term.setCursorPos(7,10)
print("------------------------------------")
write(">")
input = read()
if input ~= clear then
print("Hmm, that wasn't one of the options!")
sleep(2)
end
elseif id == imac then
rednet.open("right")
rednet.send(id, "Help On the way")
rednet.close("right")
term.clear()
term.setCursorPos(1,1)
print("Apple (Genius Help Computer)")
print("V1.2.1")
term.setCursorPos(1,17)
print("Genius (Help)")
--
term.setCursorPos(7,5)
print("------------------------------------")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| Help needed at: |")
term.setCursorPos(7,8)
print("| iMac: 18 |")
term.setCursorPos(7,9)
print("| Type clear to clear: |")
term.setCursorPos(7,10)
print("------------------------------------")
write(">")
input = read()
if input ~= clear then
print("Hmm, that wasn't one of the options!")
sleep(2)
end
elseif id == macmini then
rednet.open("right")
rednet.send(id, "Help On the way")
rednet.close("right")
term.clear()
term.setCursorPos(1,1)
print("Apple (Genius Help Computer)")
print("V1.2.1")
term.setCursorPos(1,17)
print("Genius (Help)")
--
term.setCursorPos(7,5)
print("------------------------------------")
term.setCursorPos(7,6)
print("| |")
term.setCursorPos(7,7)
print("| Help needed at: |")
term.setCursorPos(7,8)
print("| MacMini: 19 |")
term.setCursorPos(7,9)
print("| Type clear to clear: |")
term.setCursorPos(7,10)
print("------------------------------------")
write(">")
input = read()
if input ~= clear then
print("Hmm, that wasn't one of the options!")
sleep(2)
end
end
end