Posted 27 April 2012 - 03:34 AM
so i cant figure out the errors im getting. it would give me errors like: "bios:25: bad argument: double expected, got nil" and "test:28: attempt to perform arithmetic __addon string and number" and maybe others that i havent found yet. could you please help me with this? this is my first big program ive made.
here is a link to my program im making http://pastebin.com/x0qgAUj3
and here is the code
here is a link to my program im making http://pastebin.com/x0qgAUj3
and here is the code
function timer(fa)
for f = 1, fa do
term.clear()
term.setCursorPos(4,8)
print("You have been locked out for "..tostring(fa-f).." seconds.")
sleep(1)
end
end
a=0
repeat
term.clear()
term.setCursorPos(1,1)
print("|----------------------------|")
print("| (Enter the password) |")
print("|----------------------------|")
print("| |")
print("|----------------------------|")
print("[Q][W][E][R][T][Y][U][I][O][P]")
print(" [a][s][d][f][g][h][j][k][l]")
print(" [z][x][c][v][b][n][m]")
term.setCursorPos(2,4)
i=read("*")
if i ~= "pass" then
local x, y=term.getCursorPos()
term.setCursorPos(x, y)
print("WRONG!")
sleep(.4)
a=a+1
end
if a == 4 then
term.clear()
term.setCursorPos(1,1)
print("Did you forget your password?")
local n=1
while true do
local x, y=term.getCursorPos()
term.clearLine()
if n==1 then write(">YES< NO") else write(" YES >NO<") end
term.setCursorPos(x, y)
a, b=os.pullEvent()
while a~="key" do a, b=os.pullEvent() end
if b==203 and n==2 then n=1 end
if b==205 and n==1 then n=2 end
if b==28 then print("") break end
end
if n==1 then
print("password hint: the usual")
sleep(4)
elseif n==2 then
print("try again, but dont mess up otherwise your gonna get locked out")
sleep(4)
break
end
elseif a == 5 then
timer(101)
elseif a > 5 then
timer(151)
end
until i == "pass"
-- put whatever you want it to do if the password is correct right here
os.reboot()