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 jramada, our newest member.

Who's Online: 4 Guests, 0 Users

Total Members: 555
Total Posts: 13057
Total Topics: 1480
Total Categories: 8
Total Boards: 35

Recent Posts:

Re: Lua Loader? by osgeld
Re: Lua Loader? by acer5050
Re: Lua Loader? by bumuckl
Re: Lua Loader? by acer5050
Re: Lua Loader? by bumuckl
Lua Loader? by acer5050
Re: PGELua Help - need term for a special rotation fix (mathematical issue) by bumuckl
Re: PGELua Help - need term for a special rotation fix (mathematical issue) by tacticalpenguin


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