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

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-25-2007, 07:03 AM
originalfragster originalfragster is offline
PSP Newbie
 
Join Date: Nov 2006
Location: New Zealand
Posts: 49
originalfragster User Has a Beginner Reputation
Default

I'm trying to learn Lua, I'm at a simple level. however when i try to run this code, I receive the error:

Code:
error: script.lua:16: (eof) expected near 'end'
btw - this is running on windows Lua Player

Heres the code:

Code:
--test App
--Author: Originalfragster

--*Variables*
display = "lolz u suxorz"
red = Color.new(255,0,0)
pad = Controls.read()

--*Main Loop*
screen:clear()
if pad:up() then screen:print(100,100,display,red)
end

screen.waitVblankStart()
screen.flip()
end
I know it has something to do with the "end" statement at the end of the script, but I do not know how to remedy it.

Any help is greatly appreciated.
Reply With Quote
  #2  
Old 08-25-2007, 03:38 PM
LordCthulu LordCthulu is offline
Senior Member
PSP Veteran
 
Join Date: Mar 2005
Posts: 1,003
LordCthulu User Has a Beginner Reputation
Default

Why is that last end there? I don't see anything to end, other than the if statement, but you closed that already.
__________________
Member number: 3
Meat lover? Watch: http://www.chooseveg.com/animal-cruelty.asp
Reply With Quote
  #3  
Old 08-25-2007, 05:22 PM
romero126 romero126 is offline
PSP Neophyte
 
Join Date: Jan 2006
Posts: 85
romero126 User Has a Beginner Reputation
Default

That wont work because you dont have a loop


-- Variables
while true do

-- Your code


-- The bottom end in the script.


That might help
Reply With Quote
  #4  
Old 08-25-2007, 08:44 PM
originalfragster originalfragster is offline
PSP Newbie
 
Join Date: Nov 2006
Location: New Zealand
Posts: 49
originalfragster User Has a Beginner Reputation
Default

lol - its so simple now I see it like that :o

thanks romero and lordcthulu
Reply With Quote
  #5  
Old 08-25-2007, 11:20 PM
Blade_punk's Avatar
Blade_punk Blade_punk is offline
Moderator
PSP Monk
 
Join Date: Nov 2006
Location: Candy Mountain
Posts: 2,573
Blade_punk User Has a Beginner Reputation
Default

good to see someone getting into LUA coding. if you have any more problems i would be glad to help
Reply With Quote
  #6  
Old 08-23-2008, 12:34 AM
lua scripter lua scripter is offline
PSP Newbie
 
Join Date: Aug 2008
Posts: 14
lua scripter User Has a Beginner Reputation
Default

your code is messed up try putting this code in i edited it for you
you dident have a loop in your program display= what ever you had is not needed it will not work just use screen:print its much easyer

Code:
--test App
--Author: Originalfragster
red = Color.new(255,0,0)




while true do
pad = Controls.read()
screen:clear()

if pad:cross() then
screen:print (50,110 , "lolz u suxorz" ,red)
screen.waitVblankStart()
end


screen.waitVblankStart()
screen.flip()
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
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 06:35 AM.


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