Seite 200 von 342 ErsteErste ... 100 150 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 250 300 ... LetzteLetzte
Zeige Ergebnis 5.971 bis 6.000 von 10238

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 ...

  
  1. #5971
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    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

    Standard

    Zitat Zitat von Merick
    I don't really know anything about using the irda, but are you sure that you've got the sensor lined up properly with whatever device you're trying to read from?
    yes im positive.....idk why its not working



  2. #5972
    Developer
    Points: 4.205, Level: 41
    Level completed: 28%, Points required for next Level: 145
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    San Diego
    Beiträge
    177
    Points
    4.205
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von the undead
    y doesnt this work?....it doesnt write to the file, or print it
    here is my code
    Code:
    irsignal = nil
    System.irdaInit()
    
    while true do
    pad = Controls.read()
    screen:clear()
    if irsignal == nil then
    irsignal = System.irdaRead()
    end
    if irsignal ~= nil then
    screen:print(10, 10, irsignal)
    end
    if pad:cross() then
    copiedfile = io.open("remote.txt", "w")
    copiedfile:write(irsignal)
    copiedfile:close()
    end
    screen.flip()
    end
    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.

    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

  3. #5973
    QJ Gamer Blue
    Points: 4.918, Level: 44
    Level completed: 84%, Points required for next Level: 32
    Overall activity: 0%

    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

    Standard

    ok ill try it, tanks
    -= Double Post =-
    it worked but it says remote.txt is a corrupt file
    -= Double Post =-
    nvm i fixedit by myself
    Geändert von the undead (03-06-2007 um 09:18 PM Uhr) Grund: Automerged Doublepost

  4. #5974
    Points: 3.458, Level: 36
    Level completed: 72%, Points required for next Level: 42
    Overall activity: 16,0%

    Registriert seit
    Jan 2007
    Beiträge
    6
    Points
    3.458
    Level
    36
    Downloads
    0
    Uploads
    0

    Standard

    thx, but i already tried this
    file = io.open("test.txt","r")
    filecopy = file:read("*a")
    file:close()

    copiedfile = io.open("./psp/test.txt", "w")
    copiedfile:write(filecopy )
    copiedfile:close()
    when i do that, i get an error
    attempt to index global 'copiedfile' (a niv value)
    any idea?

  5. #5975
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    attempt to index global 'copiedfile' (a niv value)
    it means that
    "./psp/test.txt"
    doesnt exist...

    try something like:
    "ms0:/PSP/GAME/test.txt"
    or whatever..

  6. #5976
    QJ Gamer Green
    Points: 6.446, Level: 52
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    beside my PC
    Beiträge
    520
    Points
    6.446
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    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 . . .

  7. #5977
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ai3gtmc
    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 . . .
    yeah theres little mistake...

    Code:
    if menustatus => 4 then
    menustatus = 1
    end
    should be

    Code:
    if menustatus >= 4 then
    menustatus = 1
    end

  8. #5978
    SHOOP DA WHOOP
    Points: 12.310, Level: 72
    Level completed: 65%, Points required for next Level: 140
    Overall activity: 99,7%

    Registriert seit
    Aug 2005
    Ort
    Wii forums
    Beiträge
    7.407
    Points
    12.310
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    is there any way to read an rss feed through lua?

  9. #5979
    Points: 3.782, Level: 38
    Level completed: 88%, Points required for next Level: 18
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    32
    Points
    3.782
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    I'm using that code for copieing files al well, but is it not possible to write to flash0 or somthing??I use
    copiedfile = io.open("flash1:/vsh/resource/doc.ext", "w")
    copiedfile:write(filecopy )
    copiedfile:close()
    and all a get is a nil val...

  10. #5980
    QJ Gamer Bronze
    Points: 9.316, Level: 64
    Level completed: 89%, Points required for next Level: 34
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Denmark
    Beiträge
    664
    Points
    9.316
    Level
    64
    Downloads
    0
    Uploads
    0

    Standard

    If SystemUsbDiskModeActivate () activates usb in lua, how would you deactivate it?
    My PSP Projects:
    ___________________
    None.

  11. #5981
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    gameo:

    System.UsbDiskModeDeactiv ate()
    lucifer v:

    im not sure if you can write to flash with lua

  12. #5982
    Points: 3.782, Level: 38
    Level completed: 88%, Points required for next Level: 18
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    32
    Points
    3.782
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    but you can read from it?

  13. #5983
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    so, i tested it and... you CAN write to flash1:/ but not into flash0:/

  14. #5984
    SHOOP DA WHOOP
    Points: 12.310, Level: 72
    Level completed: 65%, Points required for next Level: 140
    Overall activity: 99,7%

    Registriert seit
    Aug 2005
    Ort
    Wii forums
    Beiträge
    7.407
    Points
    12.310
    Level
    72
    Downloads
    0
    Uploads
    0

    Standard

    is there any way to access an rss feed with netlib or lua, just read the contents of it

  15. #5985
    Points: 3.782, Level: 38
    Level completed: 88%, Points required for next Level: 18
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    32
    Points
    3.782
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von myschoo
    so, i tested it and... you CAN write to flash1:/ but not into flash0:/
    thx for testing, but its the flash0 that i need.Is it possible that in the future...?

  16. #5986
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    i think the problem is not in the LUA itself, but in the LUA Player which is blocking access into flash0 writing

  17. #5987
    Points: 3.782, Level: 38
    Level completed: 88%, Points required for next Level: 18
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    32
    Points
    3.782
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    ahnn owkey, thx for your help;)
    maby whit a upgrade in furture, let's hope

  18. #5988
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    i don't know if they will though, too many people will brick their psp's lol

  19. #5989
    I'm Baaaack!
    Points: 17.067, Level: 83
    Level completed: 44%, Points required for next Level: 283
    Overall activity: 52,0%

    Registriert seit
    May 2006
    Ort
    Nowhere
    Beiträge
    2.186
    Points
    17.067
    Level
    83
    Downloads
    0
    Uploads
    0

    Standard

    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.

  20. #5990
    QJ Gamer Blue
    Points: 4.369, Level: 42
    Level completed: 10%, Points required for next Level: 181
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    246
    Points
    4.369
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    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?

  21. #5991
    QJ Gamer Blue
    Points: 4.561, Level: 43
    Level completed: 6%, Points required for next Level: 189
    Overall activity: 0%

    Registriert seit
    May 2006
    Beiträge
    224
    Points
    4.561
    Level
    43
    Downloads
    0
    Uploads
    0

    Standard

    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.

  22. #5992
    lol
    Points: 20.859, Level: 91
    Level completed: 2%, Points required for next Level: 491
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Whittier, CA
    Beiträge
    5.791
    Points
    20.859
    Level
    91
    Downloads
    0
    Uploads
    0

    Standard

    Your computer has more RAM and CPU than a PSP.

  23. #5993
    QJ Gamer Blue
    Points: 5.303, Level: 46
    Level completed: 77%, Points required for next Level: 47
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Beiträge
    219
    Points
    5.303
    Level
    46
    Downloads
    0
    Uploads
    0

    Standard

    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

  24. #5994
    QJ Gamer Green
    Points: 6.453, Level: 52
    Level completed: 52%, Points required for next Level: 97
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    BEHIND YOU!!
    Beiträge
    1.061
    Points
    6.453
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von emericaska8r
    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.
    Its because of the constantly repeating loops in your program. An example of how to fix this would be
    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
    This is all in your main loop.
    Zitat Zitat von lucifer_v
    thx for testing, but its the flash0 that i need.Is it possible that in the future...?
    If you excel in C++ then you could change it write now by changing the source code of luaplayer.

    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]

  25. #5995
    QJ Gamer Green
    Points: 6.446, Level: 52
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    beside my PC
    Beiträge
    520
    Points
    6.446
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von myschoo
    yeah theres little mistake...

    Code:
    if menustatus => 4 then
    menustatus = 1
    end
    should be

    Code:
    if menustatus >= 4 then
    menustatus = 1
    end

    i got it to work but where i the selector?

  26. #5996
    .info
    Points: 15.395, Level: 80
    Level completed: 9%, Points required for next Level: 455
    Overall activity: 0%

    Registriert seit
    Jun 2006
    Ort
    ACT, Australia
    Beiträge
    1.674
    Points
    15.395
    Level
    80
    Downloads
    0
    Uploads
    0

    Standard

    Using sysext lib, is it possible to actually LAUNCH a UMD, or just browse?

    http://www.yongobongo.com
    PSN - yongobongo

  27. #5997
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von ai3gtmc
    i got it to work but where i the selector?
    dude, i suggest you to make your own menu, its quiet easy... ;)

  28. #5998
    QJ Gamer Green
    Points: 6.446, Level: 52
    Level completed: 48%, Points required for next Level: 104
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    beside my PC
    Beiträge
    520
    Points
    6.446
    Level
    52
    Downloads
    0
    Uploads
    0

    Standard

    help me please

    im porting my The Good News Bible to LUA:Jump:

    help me

  29. #5999
    Points: 3.782, Level: 38
    Level completed: 88%, Points required for next Level: 18
    Overall activity: 0%

    Registriert seit
    Dec 2006
    Beiträge
    32
    Points
    3.782
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    If you excel in C++ then you could change it write now by changing the source code of luaplayer.
    but I don't
    can someone send it please?

  30. #6000
    Points: 8.718, Level: 62
    Level completed: 90%, Points required for next Level: 32
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Beiträge
    484
    Points
    8.718
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard Netget question

    I looked at SBA and Drag mini's source and where it has this part:
    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
    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?


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 07:53 AM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .