Fxstriker's misc programs

Discussion in 'ComputerCraft Programming' started by fxstriker, 18 February 2013.

  1. fxstriker

    fxstriker Good Bye skcraft.

    Joined:
    14 January 2012
    Messages:
    259
    Likes Received:
    35
    Figured i would post some of my work to help others, self teaching is always hard mind you i am no expert but it helps seeing others code.

    feel free to leave positive feedback always looking to improve,
    You may use any code here but please leave credit.

    Password door
    Code:
    os.pullEvent = os.pullEventRaw
    pass = "password"
    debug = "debug password"
    term.clear()
    term.setCursorPos(1,1)
    print("==============")
    print("Login required")
    print("==============")
    sleep(2)
    print("Username:Admin")
    write("Password:")
    input = read("*")
    if input == pass then
    term.clear()
    term.setCursorPos(1,1)
    print("Login Confirmed Access Granted")
    rs.setOutput("top",true)
    sleep(5)
    rs.setOutput("top",false)
    os.reboot()
    elseif input == debug then
    print("Entering Debug Mode")
    sleep(2)
    exit()
    else
    term.clear()
    term.setCursorPos(1,1)
    print("password incorect")
    sleep(2)
    os.reboot()
    end
    
    Notes:if you use this the red stone to trigger the red stone door is output to the top side if you want to change that you will need to replace the top with another side eg
    Code:
    rs.setOutput("top",false)
    would become
    rs.setOutput("left",false)
    
    the code is defined by changing this in the code the debug password crashes the program unsure why exit() was supposed to Finnish a program anyway it allows you to edit the pc again
    Code:
    pass = "password"
    debug = "debug password"
    

    thanks for reading i will add more of my work as i you know create it =P