Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

roadrunner116

Members
  • Content Count

    4
  • Joined

  • Last visited

Posts posted by roadrunner116

  1. Sorry. Like i wrote in my other post, I was away for a week.

     

    Those three way are the ways I know. I would like to Terminate the script from inside my code, but os.sleep() just does nothing.

     

    This is the way I tried to close the Application.

    function buttonConfTerm(name, data, playerName)
      gui.flashButton(name,0.1,2)
      os.exit()
    end
    

    The button flashes and if I put in a print() it also prints my text. So the touch-event handling seems to work

  2. Sorry, I was away for a week.

     

    Thanks for your replys, now it works.

     

     

    Try cd / instead so if it is in root it will stay there, if it isn't it will go straight to root.

     

    Also avoid shell.run("rm ") because there is an API method to do it and, while yes it is miniscule, it improves performance of the script and is just good practice.

     

    Which method are you referring to?

  3. Hi,

    I'm trying to remove a folder and a file from my Update Script before downloading the new stuff. Somehow the way I'm trying I don't have the right permissions. What am I doing wrong.

    -- remove old
    local ok, err = pcall(shell.execute,"cd..")
    if not ok then
    	print("Problem: ",ok,err,computer.freeMemory())
    end
    
    local ok, err = pcall(shell.execute,"rm sg")
    if not ok then
    	print("Problem: ",ok,err,computer.freeMemory())
    end
    
    
    local ok, err = pcall(shell.execute,"rm autorun.lua")
    if not ok then
    	print("Problem: ",ok,err,computer.freeMemory())
    end
    

    Thanks!

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.