Posted 07 December 2012 - 09:31 AM
Hello :D/>/>
Can anyone tell me why this doesnt work? it doesnt tell me any errors… it actually works fine, if i do not input extra word:
Usage: pass <function>
Functions:
edit
-^- edit the password
>
thats what works fine… but when i type in:
> pass edit – or any other words than edit, then this happens:
Usage: pass <function>
Functions:
edit
-^- edit the password
>
i want, when i type in:
> pass edit
– then it will display this:
Do you want to edit your current password?
Y or N > – i cant come to this part.. before the problem is solved…
no pastebin:
pastebin:
Thanks in advance.
PS: This is being used in my AdvLock.. so i really need to get this solved…
____________________
-Mikk809h
ComputerCraft is awesome
Try my Computer lock, called "AdvLock"…
http://www.computercraft.info/forums2/index.php?/topic/6683-advlock-v-13pr1-lock-your-computer-with-advanced-technology-updated/
Can anyone tell me why this doesnt work? it doesnt tell me any errors… it actually works fine, if i do not input extra word:
Spoiler
> passUsage: pass <function>
Functions:
edit
-^- edit the password
>
thats what works fine… but when i type in:
> pass edit – or any other words than edit, then this happens:
Usage: pass <function>
Functions:
edit
-^- edit the password
>
i want, when i type in:
> pass edit
– then it will display this:
Do you want to edit your current password?
Y or N > – i cant come to this part.. before the problem is solved…
no pastebin:
Spoiler
local tArgs = { ... }
local functions = {
"edit",
"-^- Edit your password"
}
local function fRead()
if fs.exists("main/config.cfg") then
fRead1 = fs.open("main/Config.cfg", "r")
fPass = fRead1.readLine()
fRead1.close()
else
print("Error..... opening_error")
sleep(3)
end
end
local function fNew()
fWrite1 = fs.open("main/Config.cfg", "w")
fWrite1.writeLine(nPass2)
fWrite1.writeLine("3.0")
fWrite1.writeLine("0.0")
fWrite1.close()
end
if #tArgs == 0 then
print("Usage: pass <function>")
print("functions:")
for i = 1, #functions do
print(functions[i])
end
return
end
if #tArgs == 1 then
if tArgs[1] == "edit" then
fRead()
print("Do you want to edit your current password?")
write(" Y or N > ")
YN = read()
if YN == "Y" or YN == "y" then
print("Please type your current password: ")
write("> ")
cPass = read("#")
if cPass == fPass then
print("Please type new password: ")
write("> ")
nPass1 = read("¤")
print("Please confirm new password: ")
write("> ")
nPass2 = read("&")
if nPass2 == nPass1 then
fNew()
term.clear()
term.setCursorPos(1,1)
print("Password set...")
print(nPass2)
sleep(5)
os.reboot()
else
term.clear()
term.setCursorPos(1,1)
print("Your passwords does not match...")
sleep(2)
term.clear()
term.setCursorPos(1,1)
end
else
print("your input, does not match to the current password!...")
sleep(4)
term.clear()
term.setCursorPos(1,1)
end
end
end
end
pastebin:
Spoiler
http://pastebin.com/dzwBLak3Thanks in advance.
PS: This is being used in my AdvLock.. so i really need to get this solved…
____________________
-Mikk809h
ComputerCraft is awesome
Try my Computer lock, called "AdvLock"…
http://www.computercraft.info/forums2/index.php?/topic/6683-advlock-v-13pr1-lock-your-computer-with-advanced-technology-updated/