Jump to content




Api Error Bug Please Help



  • You cannot reply to this topic
4 replies to this topic

#1 Lewisk3

  • Members
  • 150 posts

Posted 26 October 2013 - 03:20 PM

Heres my api code:
function Install()
shell.run("rom/apis/win/install")
end


Heres what i put to start it
WCE.Install()

And heres the error i get:

WCE:2: attempt to index ? (a nil value)

Please help!

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 26 October 2013 - 03:25 PM

Not a bug. Moved to Ask a Pro.

APIs do not have access to the shell "API", as they aren't programs. Try using os.run instead.

#3 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 26 October 2013 - 04:15 PM

Or pass the shell API:
-- the API
function Install(shell)
    shell.run("rom/apis/win/install")
end
-- the program
WCE.Install(shell)


#4 Lewisk3

  • Members
  • 150 posts

Posted 28 October 2013 - 04:25 PM

ok i will try that thanks also i have another problem

function del(file)
if fs.isDir("RecycleBin") then
else
fs.makeDir("RecycleBin")
end
if fs.exists(file) then
fs.copy(file,"RecycleBin/"..file)
fs.delete(file)
else
error("No Such File")
end
end

Its says Copy Failed

whats the problem with this code?

#5 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 28 October 2013 - 04:35 PM

That's because the second argument given to fs.copy is the destination folder, not the full path of the new file. By the way, use fs.move. It's the same as copying and deleting something.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users