Code: Select all
black = Color.new(0, 0, 0)
white = Color.new(255, 255, 255)
newcwd = "ms0:/"
oldpad = Controls.read()
number=1
function openfile()
text = {}
i=1
cheatfile = number .. ".txt"
start=0
startx=0
cross=0
mode1=1
mode2=0
exit2=false
file = io.open(cheatfile,"r")
line=file:read("*l")
while line~=nil do
text[i]=line
i=i+1
line=file:read("*l")
end
if i>35 then
k=35
else
k=i
end
end
function textreader()
screen:clear(Color.new(0, 0, 0))
openfile()
while exit2==false do
pad = Controls.read()
if pad:select() then
exit2=true
end
if pad:cross() then
cross=10
elseif pad:circle() then
cross=34
else
cross=1
end
if pad:down() then
start=start+cross
if i<k+start then
start=i-k
end
elseif pad:up() then
start=start-cross
if start<0 then
start=0
end
end
if pad:right() then
startx=startx+cross
elseif pad:left() then
startx=startx-cross
if startx<0 then
startx=0
end
end
if oldpad ~= pad then
if pad:r() then
number = number + 1
if number > 3 then
number=1
end
openfile()
elseif pad:l() then
number = number - 1
if number < 1 then
number=3
end
openfile()
end
oldpad = pad
end
screen:clear(white)
for j = 1,k-1 do
if mode2==0 then
screen:print(0, 8*(j-1), string.format("%s",string.sub(text[j+start],startx,(string.len(text[j+start])-mode1))), black)
else
screen:print(0, 8*(j-1), string.format("%04d",j+start), black)
screen:print(36, 8*(j-1), string.format("%s",string.sub(text[j+start],startx,(string.len(text[j+start])-mode1))), black)
end
end
screen.waitVblankStart()
screen.flip()
screen.waitVblankStart(3)
end
end
while true do
textreader()
end
thanks in advance
darklitch