Skip to content

Examples

Josh edited this page Sep 11, 2022 · 1 revision

Require libraries

Program

To add libraries to your programs, you will have to require SCM first.

local scm = require("./scm")

Then you can load your libraries as follows:

scm:load("testLibrary")

If a library is missing, SCM will try to install it.

Libraries

Furthermore, SCM can also check nested sub-libraries within the loaded library. To do that, you will have to add a comment before requiring the library. This has the advantage of the libraries still being usable without SCM, as a comment does not interfer with the logic of the script.

--@requires subLibrary
require("./libs/subLibrary")

Pastebin

You can also use libraries hosted on Pastebin. Just attach the Pastebin code at the end of the name, separated by an @.

--@requires subLibrary@z4VRj21Y
require("./libs/subLibrary")
Clone this wiki locally