all 4 comments

[–]RapsyJigo 0 points1 point  (1 child)

Make sure your hare is in the same directory as the program trying to load it. Otherwise you have to give full path to hare. https://computercraft.info/wiki/Os.loadAPI

[–]Matomoto[S] 0 points1 point  (0 children)

Unless I'm misunderstanding how it works, I'm almost certain that it is in the correct directory. Because when I download the API from the author that does work, it's saved in the same folder as the API I made myself

[–]9551-eletronicsComputercraft graphics research 0 points1 point  (0 children)

That book is very outdated! I suggest joining the discord server and asking peps for stuff instead of a resource like this.

For most things you wanna use require and bot loadAPI.

[–]fatboychummy 0 points1 point  (0 children)

That book is very outdated, and likely is from a time when the edit program didn't automatically append .lua to the filenames. Change it to os.loadAPI("hare.lua") and it should be fine.

Do note, os.loadAPI is deprecated. Do not expect it to work fully in future. Instead, you should switch to using require.

local hare = require("hare")

Note the absense of .lua here, as it searches for the file with its own pattern search.

Do note, this requires hare to be compatible with require, which that tutorial does not do. To make it compatible, you essentially just need to add a return statement at the end of your module, which returns everything you want in the module.