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

Can't find where i did wrong!

Started by TheRavenBlue, 11 July 2013 - 01:51 PM
TheRavenBlue #1
Posted 11 July 2013 - 03:51 PM
Titel: Can't find whre i did wrong!

i cant find where i did wrong here:


    term.clear()
    term.setCursorPos(1,1)
    os.pullEvent = os.pullEventRaw
	
    password = "Base"
    masterpassword = "Secret"
	
    print("B: Close S: Open")
    write: "Password:"
    local input = read("*")
	
    if input == (password) then
    print("Door Closing Please Wait...")
    redstone.setOutput("bottom",true)
    sleep(5)
    redstone.setOutput("bottom",true)
    sleep(5)
    redstone.setOutput("bottom",true)
    sleep(5)
    os.shutdown()
	
    elseif input == (masterpassword) then
    print("Door Opening Please Wait...")
    redstone.setOutput("back",true)
    sleep(5)
    redstone.setOutput("back",true)
    sleep(5)
    redstone.setOutput("back",true)
    os.shutdown()
	
    else
	
    print("Unknown Password, Check Spelling")
    sleep(5)
    os.shutdown()
	
    end
Cranium #2
Posted 12 July 2013 - 10:58 AM
Split to new topic.

Line 9, you need to do write("Password: "), rather than write: "Password: "
MatazaNz #3
Posted 13 July 2013 - 02:12 AM
Titel: Can't find whre i did wrong!

i cant find where i did wrong here:


	term.clear()
	term.setCursorPos(1,1)
	os.pullEvent = os.pullEventRaw
	
	password = "Base"
	masterpassword = "Secret"
	
	print("B: Close S: Open")
	write: "Password:"
	local input = read("*")
	
	if input == (password) then
	print("Door Closing Please Wait...")
	redstone.setOutput("bottom",true)
	sleep(5)
	redstone.setOutput("bottom",true)
	sleep(5)
	redstone.setOutput("bottom",true)
	sleep(5)
	os.shutdown()
	
	elseif input == (masterpassword) then
	print("Door Opening Please Wait...")
	redstone.setOutput("back",true)
	sleep(5)
	redstone.setOutput("back",true)
	sleep(5)
	redstone.setOutput("back",true)
	os.shutdown()
	
	else
	
	print("Unknown Password, Check Spelling")
	sleep(5)
	os.shutdown()
	
	end
Just a tip, next time, if there is an error, give us the error, because that gives a clue as to where the problem is.
TheRavenBlue #4
Posted 13 July 2013 - 04:25 AM
Okay thank you