This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Keego's profile picture

2 Passwords for 1 Computer

Started by Keego, 08 December 2012 - 08:27 AM
Keego #1
Posted 08 December 2012 - 09:27 AM
Hello I <3 this mod because I can learn with fun but I got a problem and I cant fix it. (Its the startup) Sry that i postet it in here!!!!!!!! Here the link if you want to help me http://www.computerc...for-1-computer/

shell.run("clear")
print("Passwort eingeben")
local input = read ("*")
if input == "k1iller5" then
shell.run("clear")
I = 0
while I < 100 do
sleep(0.5)
I =(I + 10)
shell.run("clear")
print(I)
end
shell.run("clear")
print("------------------------------")
print("")
print("	   Wilkommen Keego		")
print("	Windows XP Professional   ")
print("------------------------------")
else if input == "1234" then
shell.run("clear")
B = 0
while B < 100 do
sleep(0.5)
B =(B + 5)
shell.run("clear")
print(B)/>/>/>/>/>/>
end
print("------------------------------")
print("")
print("		   Wilkommen		  ")
print("	 Windows XP Professioal   ")
print("------------------------------")
else
os.shutdown
end
BigSHinyToys #2
Posted 08 December 2012 - 10:23 AM
It is great to hear you like this mod so could you please post questions in the ask a pro section.

That taken care of when posting a request for help it is useful to post as much information about the program you are trying to make and and error codes that are displayed. We here are happy to help new forums members .

Could you please post more information about what this program is indented to do and where the errors are.
rhyleymaster #3
Posted 08 December 2012 - 04:23 PM
I see your new here. I've learned quite a bit with passwords before.
When doing this, at the top to make it nicer try this:

os.pullEvent = os.pullEventRaw -- prevents ctrl + t
user = ("") -- Put username here.
pass = ("") -- Put pass here.

This is so when input is called, you can just put:

if input = user

to get rid of constantly typing the same password over again.
rhyleymaster #4
Posted 08 December 2012 - 04:25 PM
Also your problem appears to be this shell.run("clear")
clear is not a program. Instead to:

term.clear()
term.setCursorPos(1,1)
basdxz #5
Posted 08 December 2012 - 06:39 PM

os.pullEvent = os.pullEventRaw -- prevents ctrl + t
pass0 = ("k1iller5") -- Put pass 1 here.
pass1 = ("1234") -- Put pass 2 here.
term.clear()
term.setCursorPos(1,1)
print("Passwort eingeben")
local input = read ("*")
if input == pass0 then
term.clear()
term.setCursorPos(1,1)
I = 0
while I < 100 do
sleep(0.5)
I =(I + 10)
term.clear()
term.setCursorPos(1,1)
print(I.."%")
end
term.clear()
term.setCursorPos(1,1)
print("------------------------------")
print("")
print("    Wilkommen Keego			  ")
print(" Windows XP Professional   ")
print("------------------------------")
elseif input == pass1 then
term.clear()
term.setCursorPos(1,1)
B = 0
while B < 100 do
sleep(0.5)
B =(B + 5)
term.clear()
term.setCursorPos(1,1)
print(B.."%")
end
term.clear()
term.setCursorPos(1,1)
print("------------------------------")
print("")
print("		    Wilkommen			  ")
print("  Windows XP Professioal   ")
print("------------------------------")
else
term.clear()
term.setCursorPos(1,1)
print("Falsches Passwort! Herunterfahren!")
sleep(2)
os.shutdown()
end
Fixed, improved and tested :)/>.
rhyleymaster #6
Posted 08 December 2012 - 10:17 PM

os.pullEvent = os.pullEventRaw -- prevents ctrl + t
pass0 = ("k1iller5") -- Put pass 1 here.
pass1 = ("1234") -- Put pass 2 here.
term.clear()
term.setCursorPos(1,1)
print("Passwort eingeben")
local input = read ("*")
if input == pass0 then
term.clear()
term.setCursorPos(1,1)
I = 0
while I < 100 do
sleep(0.5)
I =(I + 10)
term.clear()
term.setCursorPos(1,1)
print(I.."%")
end
term.clear()
term.setCursorPos(1,1)
print("------------------------------")
print("")
print("	Wilkommen Keego			  ")
print(" Windows XP Professional   ")
print("------------------------------")
elseif input == pass1 then
term.clear()
term.setCursorPos(1,1)
B = 0
while B < 100 do
sleep(0.5)
B =(B + 5)
term.clear()
term.setCursorPos(1,1)
print(B.."%")
end
term.clear()
term.setCursorPos(1,1)
print("------------------------------")
print("")
print("			Wilkommen			  ")
print("  Windows XP Professioal   ")
print("------------------------------")
else
term.clear()
term.setCursorPos(1,1)
print("Falsches Passwort! Herunterfahren!")
sleep(2)
os.shutdown()
end
Fixed, improved and tested :)/>.
All that really needed to be changed was the shell.run("clear"). and instead of constantly rebooting, It should be changed to a loop.
ex)
while true do
print("fuudge")
sleep(0)
end