![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on [Lua QUESTION] Exit Gracefully? within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Is there a built in function in Lua to immediately quit the program (besides the home function) Right now I ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#2 |
![]() |
would it be exit or something? im still learning lua also.. but i just made a program.
__________________
[url]http://rscx.com/RSCXTESTING/chris/siggy.jpg[/url] -=-=-=-=-=-=- "15% percent of programing is creating a program, 85% percent is getting to work like it f*cking should." - MagicianFB |
|
|
|
|
|
#3 |
![]() NDS Mod
|
Yes, that would be nice because when you press home it comes up with a wierd errorscreen before going back.
__________________
"15% percent of programing is creating a program, 85% percent is getting it to work like it should." - Me [URL=http://www.mozilla.org/products/firefox/][IMG]http://img439.imageshack.us/img439/5667/getfirefox0sr.png[/IMG][/URL] |
|
|
|
|
|
#4 | |
![]() |
doesnt this do the job ? I dont have my PSP hooked up right now, so try this:
Code:
while true do all of your code that needs to be in here if pad:start() then break end rest of your code here Quote:
Last edited by F34R; 09-25-2005 at 01:45 PM.. |
|
|
|
|
|
|
#5 |
![]() |
its just plain break to end the kill the code I guess.
__________________
[url]http://rscx.com/RSCXTESTING/chris/siggy.jpg[/url] -=-=-=-=-=-=- "15% percent of programing is creating a program, 85% percent is getting to work like it f*cking should." - MagicianFB |
|
|
|
|
|
#7 |
![]() |
Then there's no way to exit it gracefully.. only through home menu.
__________________
[url]http://rscx.com/RSCXTESTING/chris/siggy.jpg[/url] -=-=-=-=-=-=- "15% percent of programing is creating a program, 85% percent is getting to work like it f*cking should." - MagicianFB |
|
|
|
|
|
#8 |
|
To exit a simple program is just to break it. A simple example:
Code:
white = Color.new(255, 255, 255)
while true do
screen:clear()
screen:print(0, 0, "Hello World", white)
screen:print(0, 10, "Press Start to Exit.", white)
screen.flip()
pad = Controls.read()
if pad:start() then
break
end
end
|
|
|
|
|
|
|
#9 | |
![]() |
Quote:
__________________
[url]http://rscx.com/RSCXTESTING/chris/siggy.jpg[/url] -=-=-=-=-=-=- "15% percent of programing is creating a program, 85% percent is getting to work like it f*cking should." - MagicianFB |
|
|
|
|
|
|
#10 |
![]() |
it works if you are NOT in a function:
this pops an error: Code:
white = Color.new(255, 255, 255)
function PlayTheGame()
pad = Controls.read()
if pad:start() then
break
end
end
while true do
screen:clear()
screen:print(0, 0, "Hello World", white)
screen:print(0, 10, "Press Start to Exit.", white)
screen.flip()
PlayTheGame()
end
|
|
|
|
|
|
#12 | |
![]() I think I ripped my pants
Join Date: Jul 2005
Real First Name: Matt
Location: Toronto
Just Played: Trials HD
Posts: 6,485
Trader Feedback: 0
|
If you put "if pad:start() then
break end" That will just exit the lua script, then you will get a screen saying "press start to restart.
__________________
![]() |
|
|
|
|
![]() |
| Tags |
| exit , gracefully , lua , question |
| Thread Tools | |
|
|