It IS a variable and "s are called quotations. But i will just have the random number print text. Thanks alot!
Printable View
It IS a variable and "s are called quotations. But i will just have the random number print text. Thanks alot!
O yeah lol quotations that was it, thx.
Ok well if they are variables, then you have to define them first. So say like:
1="hello"
But i dont know if you can use numders as variables.
Yeah, i was thinking that but Ill do this for now. But what does this error mean??Code:error:script.lua:5: Argument Error: Image:clear([color]) zero or one argument
well i dont know whats at line 5 so i can only guess.
Or you have the wrong name for the image, or something is wrong with your spelling probably. But i cant tell without the code you have now. Check all the names!
Ok cool... I test on window lua player and when I press X nothing happens...
Hope this helps!
Code:r = 1
white = Color.new(255, 255, 255)
quotes = {}
quotes[0] = "Hello from number 0"
quotes[1] = "Hello from number 1"
quotes[2] = "Hello from number 2"
quotes[3] = "Hello from number 3"
quotes[4] = "Hello from number 4"
quotes[5] = "Hello from number 5"
while true do
screen:clear()
pad = Controls.read()
if pad:cross() and pad ~= oldpad then r = math.random(5) end
screen:print(130, 200, quotes[r], white)
oldpad = pad
screen.flip()
screen.waitVblankStart()
end
ok i really need to know how to make like a file browser, just to load files e.g bmp's and stuff. It says stuff about tables and i dont know how to use them, please help :$
Sorry i cant help ya there. I dont know, and im not planning on checking how the bmplib works so i cant help you.
Also, if i were you i would learn how to use tables they'll come in handy on many occasions. Its not that difficult either. And if you learn how it works maybe you can figure out how the bmplib works yourself?
Here's an example that builds a table and then prints the results to your screen. I'm sure you can figure out how to load the images and display them from here...
HTH!Code:white = Color.new(255, 255, 255)
tblImages = {}
count = 1
imageList = System.listDirectory("./images/")
for index, imageFile in imageList do
if not imageFile.directory then
tblImages[count] = imageFile.name
count = count + 1
end
end
while true do
y = 10
for _, v in pairs (tblImages) do
screen:print(0, y, v, white)
y = y + 10
end
screen.flip()
screen.waitVblankStart()
end
Hi everyone, The problem I am having is after I have writen my lua script, saved it as index.lua, I open the lua player, and it will say no script found (or something similar) What's the problem here?