Posted 20 January 2013 - 02:34 AM
Hello. I've been trying really hard lately to take a simple door lock with a masterpassword (It unlocks the pc allowing you to run programs)… I've been trying to input it somewhere into this code found here : http://pastebin.com/6egT38Jq …I've been trying to put this :
Into the first little bit of the Slots game, I get it to work, but then the game doesnt work. Is there any way that I can be able to password protect the program or make it only so I am able to get into it? I'm REAAALLY new to Computercraft but I'm trying….
Its not working as in, the numbers wont output on the monitor, so I think its not reading passed the first 41 lines of code…Because nothing happens, at all.
This is where I got to…http://pastebin.com/AEpLUDZN
masterpassword = "hco"
prizeamount = 10
detectside = "front"
monside = "right"
dispenserside = "bottom"
showloser = true
mon = peripheral.wrap(monside)
shell.run("clear",1)
mon.clear()
mon.setCursorPos(1,1)
mon.write(" Put")
mon.setCursorPos(1,2)
mon.write("Diamond")
mon.setCursorPos(1,3)
mon.write("In Chest")
mon.setCursorPos(1,4)
mon.write("To Play")
os.pullEvent = os.pullEventRaw
print("Password Lock by Cody and Neil")
write"Enter Password: "
local input = read("*")
if input == (masterpassword) then
term.clear()
term.setCursorPos(1,1)
print("Access Granted. Welcome master")
sleep(1)
print("Make your motherfucking changes.")
sleep(2)
term.clear()
term.setCursorPos(1,1)
return
else --
term.clear()
term.setCursorPos(1,1)
print("Password Incorrect")
sleep(1)
end
Into the first little bit of the Slots game, I get it to work, but then the game doesnt work. Is there any way that I can be able to password protect the program or make it only so I am able to get into it? I'm REAAALLY new to Computercraft but I'm trying….
Its not working as in, the numbers wont output on the monitor, so I think its not reading passed the first 41 lines of code…Because nothing happens, at all.
This is where I got to…http://pastebin.com/AEpLUDZN