PSP Hacks - Forums
Go Back   PSP Hacks - Forums > Tech Talk > LUA Scripting

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2008, 09:00 PM
CarthageForever's Avatar
CarthageForever CarthageForever is online now
PSP Newbie
 
Join Date: Apr 2008
Location: New York
Posts: 49
CarthageForever User Has a Beginner Reputation
Default Problems With Dofile's In Script

Well I am working on a program that list conversion codes. In the future I will add math to allow actual conversions but for now it is in beta format. The problem is that when I try to select "More Conversions" which leads to a second page of conversions it reloads the main script. Now I made sure I wasn't being an idiot and accidentally overwrote the second script, I checked the code and see no errors. Oddly enough it seems the proper script will load every now and then.

Here Is My Code:

Code:
splashScreen=Image.load("splash.png")
screen:blit(0,0,splashScreen)
screen.flip()
screen.waitVblankStart(200)
screen:clear()
red=Color.new(255,0,0)
black=Color.new(0,0,0)
white=Color.new(255,255,255)
menustatus=1
while true do
screen:clear(black)
pad=Controls.read()
if pad:up() then
menustatus=menustatus-1
screen.waitVblankStart(10)   
end
if pad:down() then
menustatus=menustatus+1
screen.waitVblankStart(10)   
end
color={white, white, white, white, white, white, white, white, white, white, white, white, white, white, white, white, white, white, white, white} -- In Future Will Replace With Math.
color[menustatus]=red
screen:print(00,70,"Acceleration", color[1])
screen:print(00,80,"Angles", color[2])
screen:print(00,90,"Area", color[3])
screen:print(00,100,"Atronomical", color[4]) 
screen:print(00,110,"Clothing", color[5])
screen:print(00,120,"Computers/Electronics", color[6])
screen:print(00,130,"Cooking", color[7])
screen:print(00,140,"Date/Time", color[8])
screen:print(00,150,"Density", color[9])
screen:print(00,160,"Energy", color[10])
screen:print(00,170,"Finance", color[11])
screen:print(00,180,"Flow Rate", color[12])
screen:print(00,190,"Force", color[13])
screen:print(00,200,"Frequency", color[14])
screen:print(00,210,"Length/Distance", color[15])
screen:print(00,220,"Light", color[16])
screen:print(00,230,"Miscellaneous", color[17])
screen:print(00,240,"Numbers", color[18])
screen:print(00,250,"Power", color[19])
screen:print(00,260,"More Conversions", color[20])
screen:print(00,00,"Total Psp Converter", red) 
screen:print(00,10,"By: CarthageForever.", red)
screen:print(00,20,"Beta Version", red)
screen:print(00,50,"Select A Conversion Category:", white)
if menustatus==1 then
    if pad:cross() then
    dofile("./more/menu2.lua") -- menu2.lua is the second menu script.
    end
end

if menustatus==2 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==3 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==4 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==5 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==6 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==7 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==8 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==9 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==10 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==11 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==12 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==13 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==14 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==15 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==16 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==17 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==18 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==19 then
    if pad:cross() then
    dofile("./more/menu2.lua")
    end
end

if menustatus==20 then
    if pad:cross() then
    dofile("./more/menu2.lua") 
    end
end
if menustatus==21 then
menustatus=1
end
if menustatus<=0 then
menustatus=20
end
screen.flip()
screen.waitVblankStart()
end
I tried running my second script (menu2.lua) and it ran with no problems. But if you want me to post the code I will.
Reply With Quote
Reply

 



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 07:00 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©