Posted 06 March 2014 - 02:26 PM
This bug occurs in ComputerCraft version 1.58. It may also occur in previous versions.
The Shell API seems to completely disappear when used in an API.
Example:
This works fine.
Output:
But if one decides to turn this simple program into an API…
… and uses it like this (assuming the file above is called testapi)…
the output will be:
The Shell API seems to completely disappear when used in an API.
Example:
function testShell()
print(tostring(shell))
print(shell.resolve("afile"))
end
testShell()
This works fine.
Output:
table: 2e12568d
afile
But if one decides to turn this simple program into an API…
function testShell()
print(tostring(shell))
print(shell.resolve("afile"))
end
… and uses it like this (assuming the file above is called testapi)…
os.loadAPI("testapi")
testapi.testShell()
os.unloadAPI("testapi")
the output will be:
nil
testapi:3: attempt to index ? (a nil value)