Seite 184 von 342 ErsteErste ... 84 134 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 234 284 ... LetzteLetzte
Zeige Ergebnis 5.491 bis 5.520 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; Ok, I guess i might have to test it out to see if i can notice a difference....

  
  1. #5491
    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

    Ok, I guess i might have to test it out to see if i can notice a difference.



  2. #5492
    Your Fate is Grim...
    Points: 11.640, Level: 70
    Level completed: 98%, Points required for next Level: 10
    Overall activity: 0%

    Registriert seit
    Oct 2005
    Beiträge
    2.269
    Points
    11.640
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Why would you free than load an image? Im sure you can load an image into another one....
    Code:
    image = Image.load("blah.png")
    
    image = Image.load("blah2.png")
    
    while true do
         screen:blit(0,0,image)
         screen.waitVblankStart()
         screen.flip()
    end
    Im too lazy to test that out.

    that would just overwrite the first definition. not sure if thats what you wanted though.
    --------------------------------------------------------------------------------------

  3. #5493
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

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

    Standard

    Gah - you guys are idiots... That snippet was for TP, he said nil frees an image, true, but i said reload, meaning just overwrite it with another image's data as ive done in the snippet. AS for loading from memory, there wont be any noticeable difference, since your still loading an image off the memory stick into RAM, than into an image class if you wish... To be honest, take snakesp that comes with luaplayer, change all image loading routines with a load from memory routine, and see if there is a difference.

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


  4. #5494
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    I got a question!

    Im editing TP's browser snippet, and I want to make it so that if you click on a directory with an "index.lua" OR "index.LUA" in it, it runs that file.

    this is what i have so far.....


    Code:
    	if pad:cross() and bfold == true and fl[s].directory == true then
    	System.currentDirectory("./APPS/"..fl[s].name)
    	dofile("index.LUA")
    	System.currentDirectory("./../..")
    end
    first off,

    fl=System.listDirectory()
    and

    fl[s].name = the file/directory that you are curretly on
    and

    nf=table.getn(fl)

    I hope that helps, Thanks in advance
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  5. #5495
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    now i got a new question
    with this bullet fireing method
    Zitat Zitat von code
    bullet = Image.createEmpty(4,4)
    bullet:clear(red)

    oldpad = Controls.read()
    currentBullet = 0
    direction = "left"

    Player = {}
    Player[1] = { x = 180, y = 117 }

    BulletInfo = {}
    for a = 1,5 do
    BulletInfo[a] = { pic = bullet , firing = false, direction = "left", x = Player[1].x + 32,
    y = Player[1].y + 16 }
    end

    function bulletSetup()
    if currentBullet < 5 then
    currentBullet = currentBullet + 1
    else
    currentBullet = 1
    end

    if direction == "left" then
    BulletInfo[currentBullet].x = Player[1].x
    BulletInfo[currentBullet].y = Player[1].y + 16
    end

    BulletInfo[currentBullet].direction = direction
    BulletInfo[currentBullet].firing = true
    end

    function bulletFire()
    for i = 1,5 do
    if BulletInfo[i].firing == true then
    if BulletInfo[i].direction == "left" then BulletInfo[i].x = BulletInfo[i].x - 10 end
    screen:blit(BulletInfo[i].x,BulletInfo[i].y,BulletInfo[i].pic)
    end
    if BulletInfo[i].x < 0 or BulletInfo[i].x > 480 or BulletInfo[i].y < 0 or BulletInfo[i].y > 272 then
    BulletInfo[i].firing = false
    end
    end
    end
    then the collision
    Zitat Zitat von collision code
    function collisionCheck2()
    if BulletInfo[i].y == ufo1.y then
    ufo1.x = 0
    ufo1.y = 120
    end
    end
    it says
    error
    attempt to index feild '?' (a nil value)
    for the bolded line

    what is the y coordinant of the bullet???
    Geändert von HeaD_ShOt (02-02-2007 um 12:58 PM Uhr)

  6. #5496
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    I get a bad blit error on line 123, and I need help fixing it

    thanks in advance

    Code:
    dofile("animLib.lua")
    
    white=Color.new(255,255,255)
    
    Background=Image.load("training.png")
    
    spritesheet=Image.load("naruto8ad.png")
    spritesheet1=Image.load("naruto8ad1.png")
    Punch1=Image.load("punchrt1.png")
    Punch2=Image.load("punchrt2.png")
    Punch3=Image.load("punchrt3.png")
    Sasuke=Image.load("sasukeleft.png")
    
    r1=Image.createEmpty(30,38)
    r2=Image.createEmpty(30,38)
    r3=Image.createEmpty(30,38)
    r4=Image.createEmpty(30,38)
    l1=Image.createEmpty(30,38)
    l2=Image.createEmpty(30,38)
    l3=Image.createEmpty(30,38)
    l4=Image.createEmpty(30,38)
    l1:blit(0,0,spritesheet1,430,103,30,38)
    l2:blit(0,0,spritesheet1,432,155,30,38)
    l3:blit(0,0,spritesheet1,399,155,30,38)
    l4:blit(0,0,spritesheet1,366,155,30,38)
    r1:blit(0,0,spritesheet,52,104,30,38)
    r2:blit(0,0,spritesheet,49,155,30,38)
    r3:blit(0,0,spritesheet,83,155,30,38)
    r4:blit(0,0,spritesheet,116,155,30,38)
    
    
    r={r1,r2,r3,r4}
    l={l1,l2,l3,l4}
    rt={rt1,rt2,rt3}
    
    Player={x=0,y=200,w=30,h=38,d=r,s=1,animt=0,img=r1,oldimg=l1,}
    Sasuke={x=400,y=200,w=32,h=38,img=Sasuke}
    
    PlayerHeight=38
    PlayerWidth=32
    
    
    function collision(ob1,ob2)
    if (ob1.x + ob1.w > ob2.x) and (ob1.x < ob2.x + ob2.w) then
    ob1.x=ob1.img
    end
    end
    
    function anim(ob)
    	ob.animt = ob.animt + 1
    	if ob.animt > 30 then
    		ob.animt = 1
    	end
    	if ob.animt < 6 then
    		ob.img = ob.d[1]
    	end
    	if ob.animt > 5 then
    		ob.img = ob.d[2]
    	end
    	if ob.animt > 10 then
    		ob.img = ob.d[3]
    	end
    	if ob.animt > 15 then
    		ob.img = ob.d[4]
    	end
    	
    end		
    
    function movePlayer()
    pad=Controls.read()
    if pad:right() then 
    		Player.d=r
    		anim(Player)
    		Player.x=Player.x+Player.s
    else
    Player.img=Player.d[1]
    		end		
    	if pad:left() then
    		Player.d=l
    		anim(Player)
    		Player.x=Player.x-Player.s
    		end
    	if pad:cross() then
    		Player.oldimg = Player.img
    		if Player.d == r then Player.img=block elseif Player.d == l then 
    
    Player.img = block1 end
    		defending=true
    		end
    		if defending and not pad:cross() then
    		defending=false Player.img=Player.oldimg
    		end
    	if pad:down() then
    		Player.oldimg = Player.img
    		if Player.d == r then Player.img=crouch elseif Player.d == l then 
    
    Player.img=crouch1 end		
    		crouching=true
    		end
    		if crouching and not pad:down() then
    		crouching=false Player.img=Player.oldimg
    		end
    end
    
    
    oldpad=Controls.read()
    block1=Image.load("block1.png")
    block=Image.load("block.png")
    crouch=Image.load("crouch.png")
    crouch1=Image.load("crouch1.png")
    crouching=false
    defending=false
    punching=false
    
    while true do	
    
    movePlayer()
    
    --check collision for Sasuke
    if collision(Player,Sasuke) then
    	Sasuke.img=Sasuke.img	
    	screen:print(100,100,"It works",white)
    end
    	
    --paste player to screen
    screen:blit(0,0,Background,true)
    screen:blit(Player.x,Player.y,Player.img)
    screen:blit(400,200,Sasuke.img)
    
    	screen.flip()
    	screen.waitVblankStart()
    	oldpad=pad
    end

  7. #5497
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Hey blackshark, add me on MSN or AIM and I can help you with whatever you're trying to do with my filebrowser snippet.

    Also, SG, you said REload. But when you UNload an image (making it need REloading) it has been set to nil and dropped from ram. I know that you can change an images value and stuff, your interpretation of reload was just different from mine.

    Also [email protected] bullet snippet. You want a real bullet system to use?

    Also kinghiei, here's your problem:

    You're defining Sasuke = Image.load("sasukeleft.pn g")

    And then redefining it as a table with its original value inside:

    Sasuke = {blahblah,img = Sasuke}

    Either change the name of the imageload or the table. You cant use the image of Sasuke any more since you redefined Sasuke as a table.

    E.G. Sasukeimg = Image.load("sasukeleft.pn g")
    Sasuke = {blahblah,img = Sasukeimg}

  8. #5498
    QJ Gamer Gold
    Points: 11.942, Level: 71
    Level completed: 73%, Points required for next Level: 108
    Overall activity: 0%

    Registriert seit
    Nov 2006
    Ort
    ...
    Beiträge
    2.080
    Points
    11.942
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    I still got the bad blit error

  9. #5499
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TaticalPenguin
    Also [email protected] bullet snippet. You want a real bullet system to use?
    yes,
    i want a real bullet system

  10. #5500
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    kinghiei, your missing the clip part of the blit function:
    screen:blit(0, 0, Background, 0, 0, Background.width(), Background.height(), true)

  11. #5501
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

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

    Standard

    A 'real' bullet system is game specific.

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


  12. #5502
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Yea, it usually is, but if the evilmana one will do what he needs so will the one I sent him.

  13. #5503
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von TacticalPinguin
    Hey blackshark, add me on MSN or AIM and I can help you with whatever you're trying to do with my filebrowser snippet.
    I do not have either, sorry.
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  14. #5504
    QJ Gamer Blue
    Points: 5.034, Level: 45
    Level completed: 43%, Points required for next Level: 116
    Overall activity: 0%

    Registriert seit
    Nov 2005
    Beiträge
    243
    Points
    5.034
    Level
    45
    Downloads
    0
    Uploads
    0

    Standard

    can i ask everyone what they think of this:
    http://www.sendspace.com/file/e44t0q
    its a game i just started, just tried to add a walking animation witch didn't work as well as i had hoped so its kind of low on fps and moving looks lame IMO.

  15. #5505
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    i tried using os.exit() to exit to the xmb
    but all it does is cause a freeze...

  16. #5506
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

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

    Standard

    eyece - Check out my game, Be Thou' for the People - it is a FMA Beat em up and has all animations in, except alchemic animations.

    http://JordanSg57.googlepages.com/Be...rThePeople.rar

    WAlking animation, kicking animation, jumping animation, and enemies.

    Maybe take a look? Or if you really want tohelp me, do the enemies AI ;) Ive done everything except that, and thats the only thing stopping me from completeing hte game.

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


  17. #5507
    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

    Zitat Zitat von eyece
    can i ask everyone what they think of this:
    http://www.sendspace.com/file/e44t0q
    its a game i just started, just tried to add a walking animation witch didn't work as well as i had hoped so its kind of low on fps and moving looks lame IMO.
    its pretty cool. i'm not sure what moving the legs actually does, but I think it's a good idea to actually use physics concepts in a game like you do.

    good luck with it.

  18. #5508
    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 HeaD_ShOt
    i tried using os.exit() to exit to the xmb
    but all it does is cause a freeze...
    use System.Quit()
    but u must have cools Luaplayer mod

    -= Double Post =-

    can anyone explain why this:

    Code:
    print("about " .. System.getFreeMemory() / 1024 / 1024 .. " megabytes free memory available")
    doesnt work....

    but when i use this:
    Code:
    System.getFreeMemory() / 1024 / 1024 * 16,37152777777777778
    then it works ok... o_O
    Geändert von myschoo (02-03-2007 um 06:49 AM Uhr) Grund: Automerged Doublepost

  19. #5509
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    Try something like:

    memfree = System.getFreeMemory()/1024/1024
    print("About "..math.floor(memfree+0.5 ).." megabytes of free memory")

    The math.floor(memfree+0.5) part rounds it to the nearest number. It's about, not exactly.

  20. #5510
    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

    did that person ever change their name so you could be penguin again?

  21. #5511
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    i have a question
    is there any way to have mutiple locations of x
    like enemy.x = enemy.x and everything between enemy.x + 15
    ?

  22. #5512
    QJ Gamer Green
    Points: 13.310, Level: 75
    Level completed: 15%, Points required for next Level: 340
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Ort
    Here
    Beiträge
    2.715
    Points
    13.310
    Level
    75
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von HeaD_ShOt
    i have a question
    is there any way to have mutiple locations of x
    like enemy.x = enemy.x and everything between enemy.x + 15
    ?
    um..no.
    but you could use tables instead.
    Code:
    enemy[1].x = enemy[2].x
    or
    enemy.1.x = enemy.2.x (tables inside tables lol)
    [CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]

  23. #5513
    QJ Gamer Silver
    Points: 7.371, Level: 57
    Level completed: 11%, Points required for next Level: 179
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    貴方
    Beiträge
    1.159
    Points
    7.371
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    so u cant do
    like
    enemy.x through enemy.x + 15
    in lua

  24. #5514
    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

    Hey guys in my code this wont work:
    Code:
    netget("p1")
    
    
    while true do
    	netrecv()
    	buffer = netvalue("p1")
    		if buffer == "0" then 
    			screen:print(0,0,buffer,red)
    screen.waitVblankStart(); 
    screen.flip()
    			
    		end
    end
    But when I modded the netlib example and did this it worked in the example:
    Code:
    netget("p1")
    
    
    while true do
    	netrecv()
    	buffer = netvalue("p1")
    		if buffer == "0" then 
    			print(buffer)
    			break
    		end
    The first one is from my game dosent work thx for all help.

  25. #5515
    QJ Gamer Blue
    Points: 7.014, Level: 55
    Level completed: 32%, Points required for next Level: 136
    Overall activity: 0%

    Registriert seit
    Jan 2007
    Ort
    U.S.
    Beiträge
    405
    Points
    7.014
    Level
    55
    Downloads
    0
    Uploads
    0

    Standard

    Does anyone know of a way to do something if a certain button is being pressed and it hasn't been pressed for a certain amount of time? For example, I want to use the l trigger to go back one "page" in my new app, Todo Espanol. However, I don't want it to go back so quickly that it just flies through. I want it to go back just one page, and be able to press it again to go back again (no oldpad stuff). Thanks for any help.

  26. #5516
    QJ Gamer Blue
    Points: 4.210, Level: 41
    Level completed: 30%, Points required for next Level: 140
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Sydney, Australia
    Beiträge
    117
    Points
    4.210
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    Tryin my hand at making a simple program in LUA.
    Need to know two things:
    1. Is it possible to copy a file and then paste it in another folder using LUA ?
    2. I heard speak of LUA being able to write to flash1 (I'm not interested in flash0, too risky). Is this possible ? And if so, how ? :)

  27. #5517
    QJ Gamer Silver
    Points: 7.278, Level: 56
    Level completed: 64%, Points required for next Level: 72
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    Pimp'en in the US F#
    Beiträge
    1.254
    Points
    7.278
    Level
    56
    Downloads
    0
    Uploads
    0

    Standard

    you MIGHT be able to write to flash1 (not flash0) MIGHT...not too sure...but you CAN read flash1 and flash0 easily.
    as for copying and pasteing to a file, I don't know, good question though.
    The Wentire Worls in two Sectors....
    When did I get dev statz?
    Spoiler for my PSP homebrewReleases:
    Ace of Space V1|PvP Pong Online|PvP Pong v3 | 3.03 BlackShark Custom Firmware
    (PvP Pong DL'ed well over 2403 times combined! get yours now!)
    Spoiler for Great Quotes:

    "No Snowflake in an Avalanche ever feels responsible....." - Fortune Cookie.

  28. #5518
    QJ Gamer Gold
    Points: 11.629, Level: 70
    Level completed: 95%, Points required for next Level: 21
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Beiträge
    1.633
    Points
    11.629
    Level
    70
    Downloads
    0
    Uploads
    0

    Standard

    To copy and paste a file try somethin like:

    copyingfile = io.open("fileyouwannacopy .ext","r")
    copyingtofile = io.open("nameoffileuwanna copyitto.ext","w")
    for line in copyingfile:lines() do
    copyingtofile:write(line. ."\n")
    end

    The copyingtofile doesnt have to exist, itll create it.

  29. #5519
    QJ Gamer Blue
    Points: 4.210, Level: 41
    Level completed: 30%, Points required for next Level: 140
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    Sydney, Australia
    Beiträge
    117
    Points
    4.210
    Level
    41
    Downloads
    0
    Uploads
    0

    Standard

    I get an error with that code:
    error: modified.lua:85: attempt to index global 'copyingfile' (a nil value)

    Zitat Zitat von Code
    function backup()
    System.currentDirectory(" c:\directory")
    copyingfile = io.open("file.ext","r")
    for line in copyingfile:lines() do
    System.currentDirectory(" c:\directory2")
    copyingtofile = io.open("file.ext","w")
    copyingtofile:write(line. ."\n")
    end
    end
    Any insights TP ?

  30. #5520
    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

    To copy and paste wouldn't you copy the file then make a new file and paste?


 

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 09:01 PM Uhr.

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