Submit Your Own Code

PSP Lua CodeBase : Parental Control Password Protect

Description:
this is a revamped edition of one of the other password codes here i have made it so you must enter your
parental control password and then you just change the bottom bit of the code so if the passord is correct
it does this if its incorrect it does this (see comments at bottom of code)
also i extracted this from my app and i had to change a few things so that it would
work without the other files in my app so you might have
to change a few thing but im pretty sure i got it all

-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Chair In/Out
-- SUBMITTED BY: emcp

white = Color.new(255,255,255)
yellow = Color.new(255,255,0)
blue = Color.new(128,128,255)



PasswordEntry = { 0, 0, 0, 0}

CurrentPasswordNumber = 1

TextGap = 20
TextStart = 184

LastPadState = Controls.read()


pass = io.open("flash1:/registry/system.dreg","r")
pass:seek("set", 0x11E0)
FlashPassword = pass:read(4)
pass:close()

while true do

if CurrentPadState:right() and not LastPadState:right()then
CurrentPasswordNumber = CurrentPasswordNumber + 1
if CurrentPasswordNumber > 4 then
CurrentPasswordNumber = 1
end
end

if CurrentPadState:left() and not LastPadState:left() then
CurrentPasswordNumber = CurrentPasswordNumber - 1
if CurrentPasswordNumber < 0 then
CurrentPasswordNumber = 4
end
end

if CurrentPadState:up() and not LastPadState:up() then
PasswordEntry[CurrentPasswordNumber] = PasswordEntry[CurrentPasswordNumber] + 1

if PasswordEntry[CurrentPasswordNumber] > 9 then
PasswordEntry[CurrentPasswordNumber] = 0
end
end

if CurrentPadState:down() and not LastPadState:down() then
PasswordEntry[CurrentPasswordNumber] = PasswordEntry[CurrentPasswordNumber] - 1

if PasswordEntry[CurrentPasswordNumber] < 0 then
PasswordEntry[CurrentPasswordNumber] = 9
end
end
local password = ""

for i=1,table.getn(PasswordEntry) do
password = password .. PasswordEntry[i]
end

LastPadState = CurrentPadState

screen:clear(blue)

screen:fontPrint(164,89,"Enter your password",white)

for i=1,table.getn(PasswordEntry) do
if i == CurrentPasswordNumber then
screen:fontPrint(TextStart+i*20, 109, PasswordEntry[i], yellow)
else
screen:fontPrint(TextStart+i*20, 109, PasswordEntry[i], white)
end
end
screen.waitVblankStart()
screen.flip()
screen:clear()
pad = Controls.read()
if password == FlashPassword and pad:cross()
then
screen:clear()
-----Enter Your Code Here If Password Is Correct-----
end

if password ~= FlashPassword and pad:cross()
then
-----Enter Your Code Here If Password Is Incorrect
end
end

Back to CodeBase
 

Please welcome stepbrother1988, our newest member.

Who's Online:

Total Members: 844
Total Posts: 13009
Total Topics: 1473
Total Categories: 7
Total Boards: 25

Recent Posts:

Re: chek it out i made front page of qj.net by chi-kitory
Re: chek it out i made front page of qj.net by Rick
Re: Hi everyone (remember me? :P) by Tdude_gamer
Re: Hi everyone (remember me? :P) by dan369
Hi everyone (remember me? :P) by Tdude_gamer
Re: Hows everyone doing? by osgeld
Re: Homebrew Idol 3: The Homebrew Horror Show by dan369
Problem on Tag game by andykd7


 
Copyright © 2006-2009 www.EvilMana.com All rights reserved.
EvilMana Logo by emcp and Charlie