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; Zitat von Merick I don't really know anything about using the irda, but are you sure that you've got the ...
-
03-06-2007, 07:34 PM #5971QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0
yes im positive.....idk why its not working
Zitat von Merick
-
03-06-2007, 08:20 PM #5972Developer

- Registriert seit
- Oct 2006
- Ort
- San Diego
- Beiträge
- 177
- Points
- 4.205
- Level
- 41
- Downloads
- 0
- Uploads
- 0
its because if there is no signal then it doesn't return null. I don't know what it returns but its not null. what you need to do is scan the port before the loop, use that as a base reference, then if the new read ~= base, print to screen. Also I beleive the info gets sent in pulses so you might want to put your write to file function in the print irsignal portion of you code. I tested this all out and it works, heres my code.
Zitat von the undead
Code:white = Color.new(255,255,255) function writesignal(s) file = io.open("remote.txt", "w") file:write(s," ") file:close() end System.irdaInit() base = System.irdaRead() while true do screen:clear() irsignal = System.irdaRead() if irsignal ~= base then screen:print(10, 10, irsignal, white) writesignal(irsignal) else screen:print(10, 10, "No Signal", white) end pad = Controls.read() if pad:cross() then end if pad:start() then while pad:start() do pad = Controls.read() end break end screen.waitVblankStart(1) screen.flip() end
-
03-06-2007, 08:28 PM #5973QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0
ok ill try it, tanks
-= Double Post =-
it worked but it says remote.txt is a corrupt file
-= Double Post =-
nvm i fixedit by myselfGeändert von the undead (03-06-2007 um 09:18 PM Uhr) Grund: Automerged Doublepost
-
03-07-2007, 04:27 AM #5974
- Registriert seit
- Jan 2007
- Beiträge
- 6
- Points
- 3.458
- Level
- 36
- Downloads
- 0
- Uploads
- 0
thx, but i already tried this
when i do that, i get an errorfile = io.open("test.txt","r")
filecopy = file:read("*a")
file:close()
copiedfile = io.open("./psp/test.txt", "w")
copiedfile:write(filecopy )
copiedfile:close()any idea?attempt to index global 'copiedfile' (a niv value)
-
03-07-2007, 04:39 AM #5975QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
it means thatattempt to index global 'copiedfile' (a niv value)
doesnt exist..."./psp/test.txt"
try something like:
or whatever.."ms0:/PSP/GAME/test.txt"[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
03-07-2007, 05:04 AM #5976QJ Gamer Green
- Registriert seit
- Jan 2007
- Ort
- beside my PC
- Beiträge
- 520
- Points
- 6.446
- Level
- 52
- Downloads
- 0
- Uploads
- 0
hi i copied the 2nd code for the sample menu from the bronx's thread but i get error:
C:\Documents and Settings\hidden\Desktop\l uaplayerwindows>luaplayer Index.lua
error: Index.lua:51: 'then' expected near '='
C:\Documents and Settings\hidden\Desktop\l uaplayerwindows>pause
Press any key to continue . . .
-
03-07-2007, 05:16 AM #5977QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
yeah theres little mistake...
Zitat von ai3gtmc
should beCode:if menustatus => 4 then menustatus = 1 end
Code:if menustatus >= 4 then menustatus = 1 end
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
03-07-2007, 05:27 AM #5978SHOOP DA WHOOP

- Registriert seit
- Aug 2005
- Ort
- Wii forums
- Beiträge
- 7.407
- Points
- 12.310
- Level
- 72
- Downloads
- 0
- Uploads
- 0
is there any way to read an rss feed through lua?
-
03-07-2007, 07:35 AM #5979
- Registriert seit
- Dec 2006
- Beiträge
- 32
- Points
- 3.782
- Level
- 38
- Downloads
- 0
- Uploads
- 0
I'm using that code for copieing files al well, but is it not possible to write to flash0 or somthing??I use
and all a get is a nil val...copiedfile = io.open("flash1:/vsh/resource/doc.ext", "w")
copiedfile:write(filecopy )
copiedfile:close()
-
03-07-2007, 07:55 AM #5980QJ Gamer Bronze
- Registriert seit
- Sep 2006
- Ort
- Denmark
- Beiträge
- 664
- Points
- 9.316
- Level
- 64
- Downloads
- 0
- Uploads
- 0
If SystemUsbDiskModeActivate () activates usb in lua, how would you deactivate it?
My PSP Projects:
___________________
None.
-
03-07-2007, 08:34 AM #5981QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
gameo:
lucifer v:System.UsbDiskModeDeactiv ate()
im not sure if you can write to flash with lua[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
03-07-2007, 09:35 AM #5982
- Registriert seit
- Dec 2006
- Beiträge
- 32
- Points
- 3.782
- Level
- 38
- Downloads
- 0
- Uploads
- 0
but you can read from it?
-
03-07-2007, 10:01 AM #5983QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
so, i tested it and... you CAN write to flash1:/ but not into flash0:/
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
03-07-2007, 10:27 AM #5984SHOOP DA WHOOP

- Registriert seit
- Aug 2005
- Ort
- Wii forums
- Beiträge
- 7.407
- Points
- 12.310
- Level
- 72
- Downloads
- 0
- Uploads
- 0
is there any way to access an rss feed with netlib or lua, just read the contents of it
-
03-07-2007, 10:39 AM #5985
- Registriert seit
- Dec 2006
- Beiträge
- 32
- Points
- 3.782
- Level
- 38
- Downloads
- 0
- Uploads
- 0
thx for testing, but its the flash0 that i need.Is it possible that in the future...?
Zitat von myschoo
-
03-07-2007, 11:36 AM #5986QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
i think the problem is not in the LUA itself, but in the LUA Player which is blocking access into flash0 writing
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
03-07-2007, 12:59 PM #5987
- Registriert seit
- Dec 2006
- Beiträge
- 32
- Points
- 3.782
- Level
- 38
- Downloads
- 0
- Uploads
- 0
ahnn owkey, thx for your help;)
maby whit a upgrade in furture, let's hope
-
03-07-2007, 05:12 PM #5988
i don't know if they will though, too many people will brick their psp's lol
-
03-07-2007, 05:24 PM #5989I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
I have a modified version of Lua that can write to the flash0. It's really easy to do. But if I released it, we would have hundreds of bricked PSPs. That's why it will probably never be implemented. I would learn C if you want to write to the flash0.

-
03-07-2007, 06:19 PM #5990
Yeah, I'd prefer that they not do it. Why make it easier for some jerk to create trojans to deliberately brick the psp's of unsuspecting hombrew users?
-
03-07-2007, 06:22 PM #5991
does anyone know why on the windows luaplayer, my music/sound effects play fine, yet on my PSP things will get messed up sometimes.
example, on my computer there is a coin sound when you press up or down in the menu, and on my PSP the coin sound will play like five times instead of once.
-
03-07-2007, 07:37 PM #5992lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Your computer has more RAM and CPU than a PSP.
-
03-07-2007, 10:38 PM #5993
Hey, i don't know if this question has been asked before but how much ram is there to allocate to sample loading,
As in how many megs of files can i load before i get
Code:Luaplayer's mikmod has a critical error: _mm_critical 0 _mm_errno 5 Sample load failed - out of memory
-
03-07-2007, 10:54 PM #5994QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- BEHIND YOU!!
- Beiträge
- 1.061
- Points
- 6.453
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Its because of the constantly repeating loops in your program. An example of how to fix this would be
Zitat von emericaska8r
This is all in your main loop.Code:pad = controls.read() oldpad = controls.read() if pad:up() and oldpad:up() != pad:up() then Insert your code to play the coin sound oldpad = pad end
If you excel in C++ then you could change it write now by changing the source code of luaplayer.
Zitat von lucifer_v
And mannymix I don't think it is possible to read an rss feed.Geändert von psp11 (03-07-2007 um 10:59 PM Uhr) Grund: Automerged Doublepost
[url=http://xs.to][img]http://xs313.xs.to/xs313/07106/wmnp8z.png[/img][/url]
What's a recovery.elf
[QUOTE=iball]
He's the one that fixes Santa's sleigh when it breaks down[/QUOTE]
[QUOTE=Deturbanator]why are we allowed to see the whole flesh and being of the boob but we MUST blur out the tit?[/QUOTE]
[PRE][B]sg57 i love you for turning on the light of homebrew when i was in the darkness of sony[/b][/pre]
-
03-08-2007, 01:06 AM #5995QJ Gamer Green
- Registriert seit
- Jan 2007
- Ort
- beside my PC
- Beiträge
- 520
- Points
- 6.446
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Zitat von myschoo
i got it to work but where i the selector?
-
03-08-2007, 02:44 AM #5996.info

- Registriert seit
- Jun 2006
- Ort
- ACT, Australia
- Beiträge
- 1.674
- Points
- 15.395
- Level
- 80
- Downloads
- 0
- Uploads
- 0
Using sysext lib, is it possible to actually LAUNCH a UMD, or just browse?
-
03-08-2007, 02:50 AM #5997QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
dude, i suggest you to make your own menu, its quiet easy... ;)
Zitat von ai3gtmc
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
03-08-2007, 03:25 AM #5998QJ Gamer Green
- Registriert seit
- Jan 2007
- Ort
- beside my PC
- Beiträge
- 520
- Points
- 6.446
- Level
- 52
- Downloads
- 0
- Uploads
- 0
help me please
im porting my The Good News Bible to LUA:Jump:
help me
-
03-08-2007, 08:19 AM #5999
- Registriert seit
- Dec 2006
- Beiträge
- 32
- Points
- 3.782
- Level
- 38
- Downloads
- 0
- Uploads
- 0
but I don'tIf you excel in C++ then you could change it write now by changing the source code of luaplayer.
can someone send it please?
-
03-08-2007, 09:39 AM #6000
- Registriert seit
- Sep 2006
- Beiträge
- 484
- Points
- 8.718
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Netget question
I looked at SBA and Drag mini's source and where it has this part:
But there is no netget how would it get the data. If I edit the example with no netget didn't work why would that work in those two games?Code:netrecv() buffer = netvalue("yourgame_room"..room_number) buffer2 = {} if buffer ~= "" then buffer2 = explode(buffer,":") if table.getn(buffer2) == 4 then cmph = tonumber(buffer2[1]) cgear = tonumber(buffer2[2]) cpos = tonumber(buffer2[3]) cvpos = tonumber(buffer2[4]) end end


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