Submit Your Own Code

PSP Lua CodeBase : Password Program

Description:
This is a password program that I designed for something, but never used it.
I figured it might come in handy to someone, so I'd post it here.
The preset password is 27490, but you can change it by editing the code.

-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Password Program
-- SUBMITTED BY: ARza

white = Color.new(255,255,255)
yellow = Color.new(255,255,0)
blue = Color.new(128,128,255)
p1 = 0
p2 = 0
p3 = 0
p4 = 0
p5 = 0
current = 1
function Something()
while true do
screen:clear(blue)
screen:print(100,100,"This is where you should input your function 
if the password
was correct.",white)
screen.waitVblankStart(100)
screen.flip()
end
end
oldpad = Controls.read()
while true do
pad = Controls.read()
screen:clear(blue)
screen:print(164,89,"Enter your password",white)
screen:print(194,109,p1,white)
screen:print(214,109,p2,white)
screen:print(234,109,p3,white)
screen:print(254,109,p4,white)
screen:print(274,109,p5,white)
if current == 1 then
screen:print(194,109,p1,yellow)
end
if current == 2 then
screen:print(214,109,p2,yellow)
end
if current == 3 then
screen:print(234,109,p3,yellow)
end
if current == 4 then
screen:print(254,109,p4,yellow)
end
if current == 5 then
screen:print(274,109,p5,yellow)
end
if pad:right() and oldpad:right() ~= pad:right() and current < 5 then
current = current + 1
end
if pad:left() and oldpad:left() ~= pad:left() and current > 1 then
current = current - 1
end
if pad:up() and oldpad:up() ~= pad:up() and current == 1 and p1 < 9 then
p1 = p1 + 1
end
if pad:up() and oldpad:up() ~= pad:up() and current == 2 and p2 < 9 then
p2 = p2 + 1
end
if pad:up() and oldpad:up() ~= pad:up() and current == 3 and p3 < 9 then
p3 = p3 + 1
end
if pad:up() and oldpad:up() ~= pad:up() and current == 4 and p4 < 9 then
p4 = p4 + 1
end
if pad:up() and oldpad:up() ~= pad:up() and current == 5 and p5 < 9 then
p5 = p5 + 1
end
if pad:down() and oldpad:down() ~= pad:down() and current == 1 and 
p1 > 0 then
p1 = p1 - 1
end
if pad:down() and oldpad:down() ~= pad:down() and current == 2 and 
p2 > 0 then
p2 = p2 - 1
end
if pad:down() and oldpad:down() ~= pad:down() and current == 3 and 
p3 > 0 then
p3 = p3 - 1
end
if pad:down() and oldpad:down() ~= pad:down() and current == 4 and 
p4 > 0 then
p4 = p4 - 1
end
if pad:down() and oldpad:down() ~= pad:down() and current == 5 and 
p5 > 0 then
p5 = p5 - 1
end
if p1 == 2 and p2 == 7 and p3 == 4 and p4 == 9 and p5 == 0 then
Something()
end
screen.waitVblankStart()
screen.flip()
oldpad = pad
end

Back to CodeBase
 

Please welcome jramada, our newest member.

Who's Online: 3 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