Lua Programming Help Thread
This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I realize how this would be done in theory, however, don'thave the knowledge to actually program the code. (How would ...
-
12-31-2009, 07:15 PM #10201
Achievements:
- Registriert seit
- Dec 2009
- Ort
- east brunswick
- Beiträge
- 7
- Points
- 1.369
- Level
- 20
- Downloads
- 0
- Uploads
- 0
I realize how this would be done in theory, however, don'thave the knowledge to actually program the code.
(How would i do this code-wise?)
-
12-31-2009, 07:22 PM #10202QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
01-01-2010, 10:21 AM #10203
Achievements:
- Registriert seit
- Dec 2009
- Ort
- east brunswick
- Beiträge
- 7
- Points
- 1.369
- Level
- 20
- Downloads
- 0
- Uploads
- 0
I think you're misunderstanding me, i understand the mousex = mousex - 1 part. (Funny that you used a C++ comment. ^^) What i don't, however, is how to connect the "mouse" variable to the actual analog.
-
01-01-2010, 10:40 AM #10204Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
if pad:analogX() > 99 then
--moving right
end
if pad:analogX() <-99 then
--moving left;
end
That is if you using LP or LPE or LPHM.
Pge would be:
if pge.controls.analogx() > 99 then
if pge.controls.analogx() < -99 then
The range is 128 to -128
-
01-02-2010, 03:29 PM #10205
Achievements:
- Registriert seit
- Dec 2009
- Ort
- east brunswick
- Beiträge
- 7
- Points
- 1.369
- Level
- 20
- Downloads
- 0
- Uploads
- 0
My problem is the actual
--moving right
part.
-
01-02-2010, 04:11 PM #10206Lua Coder

- Registriert seit
- Jan 2008
- Ort
- Iowa
- Beiträge
- 834
- Points
- 18.915
- Level
- 87
- My Mood
-
- Downloads
- 2
- Uploads
- 0
heres some example code in lua
id try working your way through these tutorials linkyCode:cursor = { x = 0, y = 0, img = Image.load("img.png") } while true do pad = controls.read() if pad:analogX() > 90 then cursor.x = cursor.x + 1 end if pad:analogX() < -90 then cursor.x = cursor.x - 1 end end
-
01-11-2010, 01:55 AM #10207PSPInstaller Developer
- Registriert seit
- Jan 2007
- Ort
- _
- Beiträge
- 130
- Points
- 12.184
- Level
- 72
- Downloads
- 0
- Uploads
- 0
[PGELua] Search Function Help
Ok, I am looking to finally implement the search function in PSPInstaller.
I have a master list of all repo's eg;
and each repo contains the following (with there own files ofc) :Code:srclist[1] = {ho = "MeqSoft" , ha = "The PSPInstaller Default Repository", hd = "http://in.rsparrow.co.uk/MEQSOFT.LUA", hf="MEQSOFT.LUA"} srclist[2] = {ho = "Repo 1", ha = "REPO 1 Description", hd="http://www.domain.co.uk/REPO.LUA", hf="REPO1.LUA"} srclist[3] = {ho = "Repo 2", ha = "REPO 2 Description", hd="http://www.domain.co.uk/REPO.LUA", hf="REPO2.LUA"}
using the srclist.hf[ x ] in a loop, how would I find all the diffrent tables with a certain search keyword in it?Code:last_update=1262908073 directory_to_repo="http://repoprep.pspinstaller.lan/download.php?file=" gl[1]={i=8,n="Dummy Game 2",d="This is a dummy Game",f="Game2.zip"} gl[2]={i=9,n="Dummy Game 3",d="This is a dummy Game",f="Game3.zip"} gl[3]={i=10,n="Dummy Game 4",d="This is a dummy Game",f="Game4.zip"} gl[4]={i=11,n="Dummy Game 5",d="This is a dummy Game",f="Game5.zip"} al[1]={i=12,n="Dummy App 2",d="This is a dummy App",f="App2.zip"} al[2]={i=13,n="Dummy App 3",d="This is a dummy App",f="App3.zip"} al[3]={i=14,n="Dummy App 4",d="This is a dummy App",f="App4.zip"} al[4]={i=15,n="Dummy App 5",d="This is a dummy App",f="App5.zip"} al[5]={i=1,n="Dummy Application",d="This is a dummy app.",f="app.zip"} tl[1]={i=4,n="Dummy Theme 2",d="This is a dummy theme",f="theme2.zip"} tl[2]={i=5,n="Dummy Theme 3",d="This is a dummy theme",f="theme3.zip"} tl[3]={i=6,n="Dummy Theme 4",d="This is a dummy theme",f="theme4.zip"} tl[4]={i=7,n="Dummy Theme 5",d="This is a dummy theme",f="theme5.zip"} tl[5]={i=3,n="Dummy Theme",d="This is a dummy theme",f="theme.zip"} ol[1]={i=16,n="Dummy Other 2",d="This is a dummy Other",f="Other2.zip"} ol[2]={i=17,n="Dummy Other 3",d="This is a dummy Other",f="Other3.zip"} ol[3]={i=18,n="Dummy Other 4",d="This is a dummy Other",f="Other4.zip"} ol[4]={i=19,n="Dummy Other 5",d="This is a dummy Other",f="Other5.zip"} ol[5]={i=2,n="Dummy Other",d="This is a dummy file for other.",f="other.zip"}
something like (PSEUDO CODE) (Sorry for incorrect spelling of Pseudo :P)
Something like that... help?!Code:for k,1 to #srclist do open srclist.hf[k] as reading for g,1 to #gl do search string insert into new table all found results end for a,1 to #al do search string insert into new table all found results end for t,1 to #tl do search string insert into new table all found results end for o,1 to #ol do search string insert into new table all found results end close.file end_
-
01-11-2010, 02:40 AM #10208PSPInstaller Developer
- Registriert seit
- Jan 2007
- Ort
- _
- Beiträge
- 130
- Points
- 12.184
- Level
- 72
- Downloads
- 0
- Uploads
- 0
ok, I have :
But I keep getting an error on line 970:Code:if state == 3 then img_sear:activate() img_sear:draweasy(0,0) arial:activate() arial:print(120,55,white,"Please press (X) to start a search") searchstr="" if not pge.utils.oskinit("Enter Search String", "") then error("Error on osk init.") end while pge.running() do pge.gfx.enddrawing() pge.gfx.swapbuffers() pge.controls.update() pge.gfx.startdrawing() img_sear:activate() img_sear:draweasy(0,0) pge.gfx.enddrawing() result, searchstr = pge.utils.oskupdate() if result then state = 31 break end pge.gfx.swapbuffers() pge.gfx.startdrawing() end if pge.controls.pressed(PGE_CTRL_LTRIGGER) then state=2 end if pge.controls.pressed(PGE_CTRL_RTRIGGER) then state=4 end end if state == 31 then sr = {} q=1 while srclist[scan] do dofile(srclist[scan].hf) sglm = #gl for sg,1 to sglm then sgn = gl.n[sg] sgd = gl.d[sg] sgf = gl.f[sg] sgi = gl.i[sg] if string.find(sgn, searchstr) or string.find(sgd, searchstr) or string.find(sgf,searchstr) then sr[q] = { i = sgi, n = sgn, d = sgd, f = sgf, l = srclist[scan].hf, h=srclist[scan].ho } q = q + 1 else end end salm = #al for sa,1 to salm then san = al.n[sa] sad = al.d[sa] saf = al.f[sa] sai = al.i[sa] if string.find(san, searchstr) or string.find(sad, searchstr) or string.find(saf,searchstr) then sr[q] = { i = sai, n = san, d = sad, f = saf, l = srclist[scan].hf, h=srclist[scan].ho } q = q + 1 else end end stlm = #tl for st,1 to stlm then stn = tl.n[st] std = tl.d[st] stf = tl.f[st] sti = tl.i[st] if string.find(stn, searchstr) or string.find(std, searchstr) or string.find(stf,searchstr) then sr[q] = { i = sti, n = stn, d = std, f = stf, l = srclist[scan].hf, h=srclist[scan].ho } q = q + 1 else end end solm = #ol for so,1 to solm then son = ol.n[so] sod = ol.d[so] sof = ol.f[so] soi = ol.i[so] if string.find(son, searchstr) or string.find(sod, searchstr) or string.find(sof,searchstr) then sr[q] = { i = soi, n = son, d = sod, f = sof, l = srclist[scan].hf, h=srclist[scan].ho } q = q + 1 else end end end if #sr then state = 32 else state = 33 end endline 970 is offset from the rest but just to make clear line 970 is :Code:'<name>' expected near '1'
Code:stf = tl.f[st]
_
-
01-18-2010, 08:08 PM #10209QJ Gamer Green
- Registriert seit
- Nov 2008
- Beiträge
- 35
- Points
- 2.236
- Level
- 28
- Downloads
- 0
- Uploads
- 0
i need help with making a truncated number in LPHMv2
here's my code for it:
Everything shows and it's truncated with into hundredths the way i want it but the problem is that the number that appears is 0.00 MB/0.00 MB even though it's supposed to be the spaces on the memory stick.Code:freespace1 = System.getFreeSpace("ms0:/")/1024^2 freespace2 = string.format("%.2f", freespace1) totalspace1 = System.getTotalSize("ms0:/")/1024^2 totalspace2 = string.format("%.2f", totalspace1) screen.startDraw() screen.clear(0) Image.blit(0, 0, bg) Font.print(Arial, 295, 120, "" .. freespace2 .. " MB/" .. totalspace2 .. " MB", black) screen.endDraw() screen.flipscreen()
please help.
-
01-18-2010, 10:37 PM #10210words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
thatoneguy - Try printing System.getFreeSpace("ms0:/") and System.getTotalSize("ms0:/") as a test to see if they are returning > 0 values. Odds are its another dodgey LPHM function that doesn't work properly.

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
01-19-2010, 04:41 PM #10211QJ Gamer Green
- Registriert seit
- Nov 2008
- Beiträge
- 35
- Points
- 2.236
- Level
- 28
- Downloads
- 0
- Uploads
- 0
sg57 - it does work, i made sure of that before i posted the code. it's probably just another function that doesn't work like its supposed to.
-
04-10-2010, 04:06 PM #10212QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
Hello I'm brand new to programming. I'm trying to develop a way simulate the Multi-Tap key press style found in many cellphones where you can input text by pressing the numpad multiple times. Instead I want to map the letters onto the PSP pad.
As I said I'm still very new to programming, I'm just following a lot of tutorials online. So sorry if my code is really sloppy or nonsensical:
Code:white = Color.new(255,255,255) red = Color.new(255,0,0) characters = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", " " } crap = { "x", "y", "z", "v", "w", "x", "y", "z", " " } selector = Image.createEmpty(10,10) selector:clear(red) charX = 100 charY= 100 currentX = 107 currentY = 98 currentLetter = 1 uppercase = false name = "" oldpad = Controls.read() addX = 0 addY = -10 addRow = -9 function drawLetters() for a = 1, 3 do addX = 0 addY = addY + 10 addRow = addRow + 9 for b = 1, 9 do addX = addX + 10 if uppercase == false then screen:print(charX + addX,charY + addY, characters[b + addRow],white) else screen:print(charX + addX,charY + addY,string.upper(characters[b + addRow]),white) end end end addX = 0 addY = -10 addRow = -9 end while true do pad = Controls.read() screen:clear() screen:print(10,10,"Enter Name: "..name,white) screen:blit(currentX,currentY, selector) drawLetters() if pad:cross() and oldpad:cross() ~= pad:cross() then if uppercase == false then name = string.sub(name, 1, string.len(name) - 1) name = name .. characters[currentLetter] currentLetter = currentLetter + 1 currentX = 107 if currentLetter == 4 then currentLetter = currentLetter - 3 end end end if pad:right() and oldpad:right() ~= pad:right() then if uppercase == false then name = name .. crap[currentLetter] end end screen.flip() screen.waitVblankStart() oldpad = pad end
-
04-10-2010, 05:12 PM #10213words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
04-10-2010, 06:17 PM #10214QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
04-11-2010, 11:00 AM #10215QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
Hello, my apologies for the previous post I was still getting my feet wet in lua. Well I spent the other night tinkering around some more and have a better understanding. So I made a new script to try to explain what I'm trying to achieve better:
Now for the section in the code where I press pad:cross(), I used the code "name = string.sub(name, 1, string.len(name) - 1)" in order for the text entry to stay stationary. Then I add "name = name .. abc[currentLetter]" and "currentLetter = currentLetter + 1" so when I tap X it should alternate between ABC. Finally I included "if currentLetter == 4 then currentLetter = currentLetter - 3" so it would go back to A once it goes beyond letter C.Code:blue = Color.new(0, 0, 255) pink = Color.new(255, 0 , 153) abc = { "a", "b", "c" } -- I want the X button to display letters "ABC" def = { "d", "e", "f" } -- I want the Triangle button to display letters "DEF" oldpad = pad name = "" currentLetter = 1 while true do pad = Controls.read() screen:clear() screen:print(100,100,""..name,pink) if pad:cross() and oldpad:cross() ~=pad:cross() then name = string.sub(name, 1, string.len(name) - 1) name = name .. abc[currentLetter] currentLetter = currentLetter + 1 if currentLetter == 4 then currentLetter = currentLetter - 3 end end if pad:triangle() and oldpad:triangle() ~=pad:triangle() then name = name .. def[currentLetter] currentLetter = currentLetter + 1 if currentLetter == 4 then currentLetter = currentLetter - 3 end end screen.flip() screen.waitVblankStart() oldpad = pad end
Now how would I make it so when I press triangle, that the letters def would show up in the same effect, and if I press X it will go back to ABC. It seems when I tap X again it will just erase my previous entry from def & start on the letter according to what value the currentLetter is at. Also I would like the currentLetter to start back at 1 whenever I press a new button so it can goto the first string of the letter.
I'm trying to make it so it can emulate the style of a multiTap keyboard found in cell phones. Can anybody give me some advice?
-
04-11-2010, 02:37 PM #10216Lua guy
- Registriert seit
- Jan 2008
- Ort
- Wales, cardiff
- Beiträge
- 1.442
- Points
- 11.690
- Level
- 71
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Interesting, i see what your trying to do.
You want a menu system to move through your sets of characters though there's another issue. Your character sets should be in one table as elements rather than individual tables like you have now.
i.e
Instead of what you have:Code:characterSets = {} characterSets[1] = {"a", "b", "c"}; characterSets[2] = {"d", "e", "f"};
Two reasons, one it's generally bad and two not enough buttons to go through your system and even if there is (i haven't counted cba, probably not though) you won't have any room for your planned features i see, i.e uppercase, numbers etc.Code:abc = {"a", "b", "c"}; def = {"d", "e", "f"};
Every time you'd move your set would move via a variable so for example:
pseudo:
Then instead of:Code:if right then characterSet[currentSet] = ++; elseif left and currentSet > 1 then characterSet[currentSet] = --; end
It would be:Code:name = name .. abc[currentLetter]
Here your just reference a table within a table, so if your currentSet is 1 and so is your currentLetter then you'd render A and the rest is etc.Code:name = name .. characterSet[currentSet][currentLetter]
-
04-11-2010, 03:29 PM #10217QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
ah I see, thanks for the tip dan369. Good to know in the future. Well I tried implementing your code but it seems to produce the same result. How about this, is there a way where to have a letter print according to how many button presses? For instance, 1 press for letter A, double press for letter B, and three presses for letter C?
I'm really just trying to make a simple OSK with the letters mapped onto the PSP buttons. Numbers and Caps I probably won't be using as I'm trying to make a trivia game where the users have to input text
-
04-11-2010, 03:35 PM #10218QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
u need 2 serperate counters, for 2 seperate tables, otherwise using the same counter for both well point to the wrong letter in the other table
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
04-11-2010, 03:44 PM #10219QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
Oh yes thank you for pointing that out, I realized that earlier so I added another counter for the table DEF and named it currentLetter2. So that part is solved, but now I have a problem with the counter not returning back to 1 after I press a different button. Like if I press X for letter A, then triangle for letter D, if I hit X again the counter will still add + 1 and print letter B instead of reverting back to A. If anybody can help me on that I'll be very thankful
-
04-11-2010, 04:09 PM #10220QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
when u hit triangle, simple reset currentletter back to it's starting value, same for currentletter2 when u hit x
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
04-11-2010, 07:01 PM #10221QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
OMG something so simple and I missed it haha. Ok I almost got it, now one final problem is the code "name = string.sub(name, 1, string.len(name) - 1)". When I put that line of code in for the Triangle button, The letters DEF also stays stationary in the same position with ABC. Is there a way to have the letters DEF move over to the next when I press the triangle button?
Hey man I really appreciate your help
-
04-13-2010, 09:52 PM #10222QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
Woo Hoo! I finally figured out a way to achieve the effect I was aiming for. I know the code is tedious but **** I'm just glad it works
here's the code I used:
I don't need my High School Diploma Anymore! time to get cracking on my game. I'll probably be back againCode:white = Color.new(255, 255, 255) blue = Color.new(100, 149, 237) pink = Color.new(255, 0 , 153) abc = { "a", "b", "c", "a" } def = { "d", "e", "f", "d" } space = { "" } oldpad = pad name = "" currentLetter = 1 currentLetter2 = 1 while true do pad = Controls.read() screen:clear() screen:print(130,56,"Type dead & press Start",white) screen:print(200,86,""..name,blue) if pad:right() and oldpad:right() ~=pad:right() and currentLetter ~= 7 then name = name .. abc[1] currentLetter = currentLetter + 1 currentLetter2 = 1 end if pad:right() and oldpad:right() ~=pad:right() and currentLetter == 3 then name = string.sub(name, 1, string.len(name) - 2) name = name .. abc[2] currentLetter = currentLetter + 1 currentLetter2 = 1 end if pad:right() and oldpad:right() ~=pad:right() and currentLetter == 5 then name = string.sub(name, 1, string.len(name) - 2) name = name .. abc[3] currentLetter = currentLetter + 1 currentLetter2 = 1 end if pad:right() and oldpad:right() ~=pad:right() and currentLetter == 7 then name = string.sub(name, 1, string.len(name) - 2) name = name .. abc[4] currentLetter = currentLetter - 5 currentLetter2 = 1 end if pad:left() and oldpad:left() ~=pad:left() and currentLetter2 ~= 7 then name = name .. def[1] currentLetter2 = currentLetter2 + 1 currentLetter = 1 end if pad:left() and oldpad:left() ~=pad:left() and currentLetter2 == 3 then name = string.sub(name, 1, string.len(name) - 2) name = name .. def[2] currentLetter2 = currentLetter2 + 1 currentLetter = 1 end if pad:left() and oldpad:left() ~=pad:left() and currentLetter2 == 5 then name = string.sub(name, 1, string.len(name) - 2) name = name .. def[3] currentLetter2 = currentLetter2 + 1 currentLetter = 1 end if pad:left() and oldpad:left() ~=pad:left() and currentLetter2 == 7 then name = string.sub(name, 1, string.len(name) - 2) name = name .. def[4] currentLetter2 = currentLetter2 - 5 currentLetter = 1 end if pad:r() and oldpad:r() ~=pad:r() then name = name .. space[1] currentLetter = 1 currentLetter2 = 1 end if pad:start() and oldpad:start() ~=pad:start() then currentLetter = 1 currentLetter2 = 1 if name == "dead" then screen:print(180,110,"Correct!",pink) screen.flip() screen.waitVblankStart(200) else screen:print(180,110,"WRONG!",pink) screen.flip() name = "" screen.waitVblankStart(50) end end screen.flip() screen.waitVblankStart() oldpad = pad endGeändert von ponlork (04-13-2010 um 10:07 PM Uhr)
-
04-14-2010, 07:43 AM #10223
-- Code Monkey : Sarien, Fishguts, Cracks and Crevices --
"Did IQ's just drop sharply while I was away?" (Ripley)
-
04-14-2010, 10:14 AM #10224QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
I tried my best with the limited knowledge I have, but since no one was willing to help me or had an answer I said screw it, I'll do it. Sometimes it's not about how long the code is but if you can understand it. And by golly I do understand it even though I'm still a noob.
Down the line when I improve I will optimize it though. But hey if you got a suggestion or a better method then I'll gladly utilize it but I'm not spending anymore time on it. No offense but It's easy to come after the fact and say you can do better but where were you the past 5 days when I was pleading for help? haha I say that with no disrespect, right now I'm just glad it works so....moving on, I got a project to Finnish. can't sit around experimenting all day, I got a full time job also. Time is everything. Thanks for the advice though, you are right, I'm doing too much. Fall back, fall back
-
04-14-2010, 04:05 PM #10225QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
what are you talking about?, 2 others including myself took time to answer most every question you asked here, it's funny how you complain about having a job and can't sit around then complain to someone whom most likly has a job and things to do then visit this forum everyday and answer your questions, _df_ simply pointed out that it could be optimized not that you had to optimize it
attitude like this makes me want to not help you in the future, claiming you got no help, that's pretty disrespectful to everyone that helped youGeändert von slicer4ever (04-14-2010 um 04:17 PM Uhr)
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
04-14-2010, 05:37 PM #10226QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
-
04-16-2010, 02:10 AM #10227QJ Gamer Green
- Registriert seit
- Apr 2010
- Ort
- E/S LBC
- Beiträge
- 51
- Points
- 3.419
- Level
- 36
- Downloads
- 0
- Uploads
- 0
Man I was in the process of posting a new thread for my release but I got a message saying my post count was insufficient by just 1 haha I hate to post just for the sake of getting 10 but hey let me describe my game, it's called Learn Japanese. Basically it's a trivia game designed to help people memorize Japanese words. I feel typing the words will help people remember better.
It was a great learning experience, I feel more confident at tackling bigger projects now. I just want to say thanks to everybody for helping me out.
-- I can't Post Links or Pictures Either?! oh well after this post I should be able to...
-
02-04-2011, 06:58 PM #10228
Achievements:
- Registriert seit
- Jan 2011
- Ort
- iPhone 4-BootRom
- Beiträge
- 53
- Points
- 1.048
- Level
- 17
- My Mood
-
- Downloads
- 1
- Uploads
- 0
please go look at my post i need help bad
-
02-22-2011, 10:21 AM #10229QJ Gamer Green
- Registriert seit
- Mar 2009
- Beiträge
- 48
- Points
- 2.521
- Level
- 30
- Downloads
- 0
- Uploads
- 0
Hi!
I started programming Lua with Euphoria V8, but there is one thing with file reading I cannot get to work or it's a bug with Euphoria. Here is some code:
Am I doing something wrong? I am pretty sure this works with normal Lua.Spoiler for code:Geändert von batanen (02-22-2011 um 11:18 AM Uhr) Grund: Simplified example code / further testing results.
-
02-22-2011, 05:17 PM #10230Lua Coder

- Registriert seit
- Jan 2008
- Ort
- Iowa
- Beiträge
- 834
- Points
- 18.915
- Level
- 87
- My Mood
-
- Downloads
- 2
- Uploads
- 0
thats weird, just tried it and it worked for me:
it displays the text that i put in my folder/a.txt, and i dont get any errors at allCode:stringArray = {}; i = 1; file = io.open("myfile.ini", "r"); for line in file:lines() do stringArray[i] = line; i = i + 1; end file:close(); file2 = io.open(stringArray[1], "r") for line in file2:lines() do -- Then I get this error: "Attemp to index global 'file2' (a nil value) var = line end while true do screen:print(0,0,"var: "..var,Color.new(255,255,255)) if Controls.read():start() then System.quit() end screen:flip() end
EDIT
for some reason its adding a ♪ to the end of the line...
EDIT2
firgured out how to remove the ♪ from the line, just replace the stuff you have in the for loop with this:
the gsub() will look for ♪ (known as string.char(13) by the psp) and replace it with nothing. If you want to know how i figured that out just replace the string.char(13) with "folder/a.txt". That way you all that is left is the ♪, then use string.byte(stringArray[1]) in a print function to show the byte value of the ♪. Then using the gsub function again replace "folder/a.txt" with string.char(value). The string.char will turn a number into a character, and then you just replace it with nothingCode:stringArray[i] = line:gsub(string.char(13),"")
Geändert von cmbeke (02-22-2011 um 07:14 PM Uhr)


LinkBack URL
About LinkBacks
Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum