CoderPuppy / cc-emu

Terminal CC Emulator
MIT License
3 stars 0 forks source link

BIOS Error #3

Closed Selim042 closed 8 years ago

Selim042 commented 8 years ago

bios.lua:496: bad argument #1 to 'load' (function expected, got nil) Occurs on boot if startup contains os.loadAPI. Attempting to run startup after error occurs returns:

API . is already being loaded
bios.lua:496: bad argument #1 to 'load' (function expected, got nil)

If it makes a difference, I am using the rpi-gpio branch.

CoderPuppy commented 8 years ago

09d0df2 should have fixed this, but I'll reopen this pending confirmation that it works.

Selim042 commented 8 years ago

Still got bios.lua:496: bad argument #1 to 'load' (function expected, got nil)

CoderPuppy commented 8 years ago

I'd forgotten to push the changes to rpi-gpio, it should work now. If that wasn't on rpi-gpio then what CC version are you using?

Selim042 commented 8 years ago

Well, that doesn't make a difference as I just downloaded the modified file and copied it myself. The changed file was used and did not work. Using the latest files from alekso56/ComputercraftLua

CoderPuppy commented 8 years ago

What code are you running?

Selim042 commented 8 years ago
local file = fs.list("/apis/")
for k,v in pairs(file) do
  os.loadAPI("/apis/"..v)
end

EDIT: Nevermind, I think I found the issue. Give me a minute.

CoderPuppy commented 8 years ago

Could you post libs/fs.lua?

Selim042 commented 8 years ago

I didn't find the issue :( fs.lua: http://pastebin.com/qnXiszKH

CoderPuppy commented 8 years ago

Could you figure out what file it's trying to load (add a print in the loop)?

Selim042 commented 8 years ago

. fs.list still returns both . and .. for some reason.

CoderPuppy commented 8 years ago

Could you post emu.lua? I have a hunch that you have an old emu.lua that has fs builtin instead of loading libs/fs.lua.

Selim042 commented 8 years ago

I did just re-download the entire branch when I realized that it was still returning ., but here it is: http://pastebin.com/rBQt920W

CoderPuppy commented 8 years ago

Ok, my hunch was wrong. Could you run fs.list('/apis') in lua and post the output?

Also could just make sure you're running this version, not some other copy you might have, because this shouldn't happen at all (at least not with a somewhat recent version).

Selim042 commented 8 years ago
{
  ".",
  "..",
  "cleverbot",
}

I just redownloaded the branch.

CoderPuppy commented 8 years ago

That shouldn't happen.

Selim042 commented 8 years ago

WTF. Went to record my screen showing that the lines that should prevent it are in fs.lua, went to run fs.list, didn't show it anymore. No clue as to why, launched it the same way I normally do, same directory, etc. Nothing changed, but it works properly now.