Submit Your Own Code

PSP Lua CodeBase : Screenshot

Description:
  This is a screenshot function that will save the current screen in side a given folder and name it appropriately so it dosn't overwrite old screenshots

To use it just call the function with an argument that contains the folder. ex:

-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Screenshot
-- SUBMITTED BY: Soulkiller

oldpad = Controls.read()
while true do
pad=Controls.read()
if pad:select() and pad:select() ~= oldpad:select() then screenshot("ms0:/PSP/PHOTO")
end
oldpad = pad
end

Code:
function screenshot(folder)
local directory = {}
local counter = 1
for index, file in System.listDirectory(folder) do
directory[counter] = file.name
counter = counter+1
end
local max = 0
for length = 1,table.getn(directory) do
for length2 = 1,table.getn(directory) do
if directory[length2] == "screenshot"..length..".png" then
max = length
end
end
end
max = max+1
screen:save(folder.."screenshot"..max..".png")
end

Back to CodeBase
 

Please welcome daryy, our newest member.

Who's Online: 3 Guests, 0 Users

Total Members: 556
Total Posts: 13060
Total Topics: 1480
Total Categories: 8
Total Boards: 35

Recent Posts:

Re: Lua 5.1.4 help. by daryy
Re: PGELua Help - need term for a special rotation fix (mathematical issue) by yaustar
Re: Lua Loader? by Buddy4point0
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


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