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

Notices

Reply
 
Thread Tools Display Modes
  #11  
Old 05-28-2008, 06:27 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

I moved on to the next tutorial on that site and when I got my script done and tested it on my PSP I get the error that says:
Error: Button Input.LUA:52: '<eof>' expected near 'end'
Press Start to restart


Code:
-- +++++Variables+++++
green = Color.new(0,255,0)
red = Color.new(255,0,0)

upPressed = 'You are pressing the "UP" button'
downPressed = 'You are pressing the "DOWN" button'
leftPressed = 'You are pressing the "LEFT" button'
rightPressed = 'you are pressing the "RIGHT" button'
LPressed = 'You are pressing the "L" button'

-- +++++Main Loop+++++ while true do
screen:clear()

pad = Controls.read()
-- these next line of code uses the variables I just made.
if pad:up() then
screen:print(100,100,upPressed,green)
end
if pad:down() then
screen:print(100,100,downPressed,red)
end
if pad:left() then
screen:print(100,100,leftPressed,green)
end
if pad:right() then
screen:print(100,100,rightPressed,red)
end
if pad:l() then
screen:print(100,100,LPressed,green)
end

-- Now for those other five buttons. I will write the text directly in the print statement for these, just to practice 

different methods.
if pad:r() then
screen:print(100,100,'You are pressing the "R" button',green)
end
if pad:triangle() then
screen:print(100,100,'You are pressing the "TRIANGLE" button',green)
end
if pad:circle() then
screen:print(100,100,'You are pressing the "CIRCLE" button',green)
end
if pad:cross() then
screen:print(100,100,'You are pressing the "X" button',green)
end
if pad:square() then
screen:print(100,100,'You are pressing the "SQUARE" button',green)
end

screen.waitVblankStart()
screen.flip()
end
I have no clue what eof means. It's part of my error message I keep getting.
__________________
------------------------------------------------------------------------------------
A true master of control is one who never seems to be in control
------------------------------------------------------------------------------------
Reply With Quote
  #12  
Old 05-29-2008, 01:15 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

Quote:
Originally Posted by Organized_Chaos
-- +++++Main Loop+++++ while true do
screen:clear()
There was my problem. In the tutorial "-- *****Main Loop****** while true do" was all on one line and it needed to be split up. I moved "while true do" down to a line between those two lines. That section of code now reads
Code:
-- +++++Main Loop+++++ 
while true do
screen:clear()
I am glad I was able to figure that one out by myself.
__________________
------------------------------------------------------------------------------------
A true master of control is one who never seems to be in control
------------------------------------------------------------------------------------
Reply With Quote
  #13  
Old 05-29-2008, 01:17 AM
RazorChrist's Avatar
RazorChrist RazorChrist is offline
PSP Smarty
 
Join Date: Jan 2008
Location: Tulsa, OK
Posts: 191
RazorChrist User Has a Beginner Reputation
Default

Coo. Hey, if you need some help with errors or how to script something, you can always pm me and I can take a look at it. I'm pretty decent at LUA, and I've got a co-worker that does games in LUA as well.
__________________

PSP = Phat 3.71 m33-4 > 3.90 m33 > 3.90 m33-2 > 3.90 m33-3 > 3.93 GEN w/ 1.50 Kernel Addon >
3.95 GEN > 3.90 m33-3 > 4.01 m33 > 3.90 m33-3 w/ 1.50 Kernel Addon
PS2 = Slim Unmodded
Reply With Quote
  #14  
Old 08-23-2008, 01:00 AM
lua scripter lua scripter is offline
PSP Newbie
 
Join Date: Aug 2008
Posts: 14
lua scripter User Has a Beginner Reputation
Default

hey your words were messed when its myBrithyear it can be MyBrithYear just myBrithyear heres your code

Code:
-- NOTES
-- Green Color Object
green = Color.new(0, 255, 0)

-- Store birth year in variable myBirthYear
myBirthyear = 1991

-- Store current year in currentYear
currentYear = 2008

-- create an empty variable
myAge = nil

-- Store some text in a variable (Note the space after the last word before the end ")
someText = "My age is roughly "

-- Subtract myBirthYear from currentYear and store in myAge
myAge = currentYear - myBirthyear

-- Print our text variable to the screen 



screen:print(10,100, someText ,green) 



-- Buffer offscreen to onscreen (If this was a human, offscreen would be thinking about it, onscreen would be saying it)



screen.flip()
-- Loop forever
while true do
screen.waitVblankStart()
end
__________________


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
  #15  
Old 08-23-2008, 01:04 AM
lua scripter lua scripter is offline
PSP Newbie
 
Join Date: Aug 2008
Posts: 14
lua scripter User Has a Beginner Reputation
Default

dont mess with while true do
__________________


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:04 PM.


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