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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-02-2008, 01:56 PM
Organized_Chaos Organized_Chaos is offline
PSP Smarty
 
Join Date: May 2008
Location: Neosho, MO
Posts: 128
Organized_Chaos User Has a Beginner Reputation
Default

Here is my code. I want the text: "PAUSED --Press O to resume" to stay on the screen for a few seconds after I push X. Or maybe stay there until I press O. Right now it only displays when I am holding down the X button. Help please?

Code:
white = Color.new(255,255,255)
yellow = Color.new(255,255,0)
green = Color.new(0,255,0)
counter = Timer.new()
counter:start()
while true do
screen:clear()
pad = Controls.read()
currentTime = counter:time()
screen:print(10,10,"Counter Time: " .. currentTime,white)
if currentTime < 1000 then
screen:print(100,100,"Less than 1000",white)
end
if currentTime > 1000 and currentTime < 2000 then
screen:print(100,100,"Greater than 1000",yellow)
end
if currentTime > 2000 then
counter:reset(0)
counter:start()
end
if pad:cross() then
counter:stop()
screen:print(75,150,"PAUSED --Press O to resume",green)
end
if pad:circle() then
counter:start()
end
        if pad:start() then
            break
            end
screen.waitVblankStart()
screen.flip()
end
__________________
------------------------------------------------------------------------------------
A true master of control is one who never seems to be in control
------------------------------------------------------------------------------------
Reply With Quote
  #2  
Old 06-04-2008, 12:58 AM
Organized_Chaos Organized_Chaos is offline
PSP Smarty
 
Join Date: May 2008
Location: Neosho, MO
Posts: 128
Organized_Chaos User Has a Beginner Reputation
Default

Anyone at all? I mean I know this section is dead but still...

Wait.. its not dead, I heard a cricket chirping in the background. :lol:
__________________
------------------------------------------------------------------------------------
A true master of control is one who never seems to be in control
------------------------------------------------------------------------------------
Reply With Quote
  #3  
Old 06-29-2008, 09:08 PM
Dariusc123456 Dariusc123456 is offline
PSP Hacks Member
 
Join Date: Jun 2008
Posts: 218
Dariusc123456 User Has a Beginner Reputation
Default

add this at the end of your code. Maybe this will help

Code:
screen.flip()
while true do
screen.waitVblankStart()
end
Leaving the screen.flip() on the outside of the "while" cmd.

Hope this help, if you didnt get it.
__________________
Have you ever want to use your computer away from your home? Do you wish you can have your desktop/laptop at the palm of your hand.

Comming soon within 2008, homebrew program call \"NetPlay\" which will allow you to use your computer where ever you go. Ether through Adhoc or Wifi, it can be done. All you need is a router, for wifi, or a wifi card/adapter for adhoc. Goto http://www.psp-hacks.com/forums/viewtopic.php?id=146907 and learn more.
Reply With Quote
  #4  
Old 08-22-2008, 11:58 PM
lua scripter lua scripter is offline
PSP Newbie
 
Join Date: Aug 2008
Posts: 14
lua scripter User Has a Beginner Reputation
Default

your code should be this
Code:
white = Color.new(255,255,255)
yellow = Color.new(255,255,0)
green = Color.new(0,255,0)
counter = Timer.new()
counter:start()
while true do
screen:clear()
screen.flip()
pad = Controls.read()
currentTime = counter:time()
screen:print(10,10,"Counter Time: " .. currentTime,white)
if currentTime < 1000 then
screen:print(100,100,"Less than 1000",white)
end
if currentTime > 1000 and currentTime < 2000 then
screen:print(100,100,"Greater than 1000",yellow)
end
if currentTime > 2000 then
counter:reset(0)
counter:start()
end
if pad:cross() then
counter:stop()
screen:print(75,150,"PAUSED --Press O to resume",green)
end
if pad:circle() then
counter:start()
end
        if pad:start() then
            break
            end
screen.waitVblankStart()
screen.flip()
end
screen:clear() and screen.flip() need to be in the loop
__________________


Email me your lua scripts ill fix them or help you fix them and Email you back on what you wanted :D
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 09:24 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©