### Get Loaded Examples Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Retrieves all currently loaded examples. Each example object contains its name and script content. ```javascript sm.scrapcomputers.exampleManager.getExamples() ``` -------------------------------- ### sc.example.getExamples Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_example/index.html Retrieves all loaded examples from the sc.example namespace. Each example includes its name and script content. ```APIDOC ## sc.example.getExamples ### Description Retrieves all loaded examples. Each example is an object containing the example's name and its script content. ### Function Signature `sc.example.getExamples()` ### Returns * `Example[]` - An array of Example objects. Each Example object has the following fields: * `name` (string) - The name of the example. * `script` (string) - The script content of the example. ``` -------------------------------- ### Load Example by Name Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Fetches a specific example using its name. Returns the example object if found, otherwise returns nil. ```javascript sm.scrapcomputers.exampleManager.loadExample( name ) ``` -------------------------------- ### Add a New Example Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Adds a new example to the manager. Requires a name and the script content for the example. ```javascript sm.scrapcomputers.exampleManager.addExample( name, script ) ``` -------------------------------- ### Get Total Number of Examples Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Returns the total count of examples that are currently loaded in the system. ```javascript sm.scrapcomputers.exampleManager.getTotalExamples() ``` -------------------------------- ### Load Example by Name - Lua Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_example/index.html Loads a specific example by its name. Returns the example object if found, otherwise returns nil. Ensure the example name is a string. ```lua sc.example.loadExample( name ) ``` -------------------------------- ### getExamples Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Retrieves all currently loaded examples. ```APIDOC ## getExamples ### Description Gets the loaded examples. ### Method `sm.scrapcomputers.exampleManager.getExamples()` ### Endpoint N/A (Lua API) ### Parameters None ### Request Example ```lua sm.scrapcomputers.exampleManager.getExamples() ``` ### Response #### Success Response - **examples** (Example[]) - An array of Example objects. ### Response Example ```json { "examples": [ { "name": "example1", "script": "print('Hello World')" } ] } ``` ``` -------------------------------- ### Get Total Examples - Lua Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_example/index.html Retrieves the total count of examples currently loaded. Use this to check the number of available examples. ```lua sc.example.getTotalExamples() ``` -------------------------------- ### loadExample Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Retrieves a specific example by its name. ```APIDOC ## loadExample ### Description Gets a example from name. ### Method `sm.scrapcomputers.exampleManager.loadExample( name )` ### Endpoint N/A (Lua API) ### Parameters #### Arguments - **name** (string) - Required - The name of the example. ### Request Example ```lua sm.scrapcomputers.exampleManager.loadExample("myExample") ``` ### Response #### Success Response - **example** (Example?) - The discovered example, nil if not found. ### Response Example ```json { "example": { "name": "myExample", "script": "print('This is my example script')" } } ``` ``` -------------------------------- ### Reload All Examples Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Use this function to reload all available examples. This is useful after making changes to example files. ```javascript sm.scrapcomputers.exampleManager.reloadExamples() ``` -------------------------------- ### addExample Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Adds a new example to the manager. ```APIDOC ## addExample ### Description Adds a example. ### Method `sm.scrapcomputers.exampleManager.addExample( name, script )` ### Endpoint N/A (Lua API) ### Parameters #### Arguments - **name** (string) - Required - The name of the example. - **script** (string) - Required - The script of the example. ### Request Example ```lua sm.scrapcomputers.exampleManager.addExample("myExample", "print('This is my example script')") ``` ### Response None ``` -------------------------------- ### getTotalExamples Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Gets the total count of currently loaded examples. ```APIDOC ## getTotalExamples ### Description Gets the total number of examples currently loaded. ### Method `sm.scrapcomputers.exampleManager.getTotalExamples()` ### Endpoint N/A (Lua API) ### Parameters None ### Request Example ```lua sm.scrapcomputers.exampleManager.getTotalExamples() ``` ### Response #### Success Response - **total** (integer) - The total number of loaded examples. ### Response Example ```json { "total": 5 } ``` ``` -------------------------------- ### MIDIPlayer:start() Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/user-data/midiplayer/index.html Starts the MIDI playback. This function initiates the audio playback of the loaded MIDI file. ```APIDOC ## MIDIPlayer:start() ### Description Starts the player. ### Method `MIDIPlayer:start()` ### Parameters None ### Returns None ``` -------------------------------- ### NBSPlayer:start() Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/user-data/nbsplayer/index.html Initiates the playback of the NBS music from the current position. ```APIDOC ## NBSPlayer:start() ### Description Starts the NBS player. ### Method `NBSPlayer:start()` ### Parameters None ``` -------------------------------- ### reloadExamples Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/example-manager/index.html Reloads all the examples managed by the ExampleManager. ```APIDOC ## reloadExamples ### Description Reloads all the examples. ### Method `sm.scrapcomputers.exampleManager.reloadExamples()` ### Endpoint N/A (Lua API) ### Parameters None ### Request Example ```lua sm.scrapcomputers.exampleManager.reloadExamples() ``` ### Response None ``` -------------------------------- ### Custom Drawer Function Example Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/camera/index.html An example of a custom drawer function that mimics the behavior of depthFrame by creating a black and white image based on raycast hit information. ```lua local function DrawerFunction(hit, raycastResult, x, y) local color = sm.color.new(0, 0, 0) if hit then color = sm.color.new(1, 1, 1) * (1 - result.fraction) end return colorend ``` -------------------------------- ### Start MIDI Player Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/user-data/midiplayer/index.html Call this function to begin playback of the MIDI file. ```lua MIDIPlayer:start() ``` -------------------------------- ### Example Multi-Display Initializations Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/guides/how_to_use_multidisplays/index.html Illustrates how to initialize multi-display grids for specific dimensions (4x4, 5x3, and 2x8). After initialization, the display table can be used like a normal display. ```lua --- 4x4 local display = sc.multidisplay.new( sc.getDisplays(), 4, 4 ) ``` ```lua --- 5x3 local display = sc.multidisplay.new( sc.getDisplays(), 5, 3 ) ``` ```lua --- 2x8 local display = sc.multidisplay.new( sc.getDisplays(), 2, 8 ) ``` -------------------------------- ### Server-Side Initialization and Shared Table Setup Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/sharedtable/index.html Initializes shared tables on the server and creates a new shared table instance for client synchronization. Use `sm.scrapcomputers.sharedTable:init(self)` to set up the module and `sm.scrapcomputers.sharedTable:new(self, "self.cl.sharedTable")` to create a new shared table instance, specifying the client path for synchronization. ```lua function MyClass:server_onCreate() sm.scrapcomputers.sharedTable:init(self) self.sv = {} -- Shared tables automaticly sync variables at the root level, if you -- are modifing a data inside of a table (eg self.sv.sharedData.myTable.myValue), -- you will have to manually sync it with sm.scrapcomputers.sharedTable:forceSync self.sv.sharedTable = sm.scrapcomputers.sharedTable:new(self, "self.cl.sharedTable") self.sv.sharedTable.myCounter = 0 end ``` -------------------------------- ### Get Total Configurations Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/config/index.html Retrieves the total number of configurations available. This function is server-only. ```javascript sm.scrapcomputers.config.getTotalConfigurations() ``` -------------------------------- ### Get Raw Contents Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/user-data/computer-filesystem/index.html Retrieves the entire filesystem structure as a table. ```APIDOC ## getRawContents ### Description Gets the raw contents table of the filesystem. ### Method Filesystem:getRawContents() ### Returns * [ table ] The directory tree. ``` -------------------------------- ### getTotalConfigurations Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/config/index.html Gets the total number of configurations available. This function is server-only. ```APIDOC ## getTotalConfigurations ### Description Gets the total number of configurations. ### Method `sm.scrapcomputers.config.getTotalConfigurations()` ### Returns * `integer`: The amount of configurations. ``` -------------------------------- ### Get Computer Filesystem Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/computer-manager/index.html Fetches the shared filesystem object for a given computer ID. This allows addons to interact with the computer's files. ```lua sm.scrapcomputers.computerManager:getFilesystemOfComputer( id ) ``` -------------------------------- ### Get Current Path Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/user-data/computer-filesystem/index.html Retrieves the current working directory. ```APIDOC ## getCurrentPath ### Description Gets the current working directory. ### Method Filesystem:getCurrentPath() ### Returns * [ string ] The current path. ``` -------------------------------- ### PixelTable Structure Example Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/display/index.html Demonstrates the format of a PixelTable used for drawing on the display. It specifies the pixel's coordinates and color. ```lua { x = 1, -- The position of the pixel on the X-axis y = 1, -- The position of the pixel on the Y-axis color = sm.color.new("ff0000") -- The color of the pixel } ``` -------------------------------- ### TouchTable Structure Example Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/display/index.html Shows the format of a table containing touch data from multiple players interacting with the screen. Each player's data is indexed by their name. ```lua { ["Ben Bingo"] = { -- The touch data's index is the players name x = 37, -- The position of the touch x coordinate y = 42, -- The position of the touch y coordinate pressType = 2, -- The press type of the player 1: interaction | 2: tinker name = "Ben Bingo" -- The name of the player that interacted with the screen state = 3 -- The press state. 1: pressed | 2: drag | 3: released }, ["VeraDev"] = { x = 21, y = 69, pressType = 2, name = "VeraDev" state = 1 } } ``` -------------------------------- ### TouchData Structure Example Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/display/index.html Illustrates the format of touch data received from a player interacting with the screen. Includes coordinates, press type, player name, and press state. ```lua { x = 1, -- The position of the touch x coordinate y = 1, -- The position of the touch y coordinate pressType = 1, -- The press type of the player 1: interaction | 2: tinker name = "Ben Bingo" -- The name of the player that interacted with the screen state = 2 -- The press state. 1: pressed | 2: drag | 3: released } ``` -------------------------------- ### Get All Connected Lights Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all lights connected to the computer. This function is useful for controlling lighting systems. ```lua sc.getLights() ``` -------------------------------- ### Get Available Audio Parameters - Lua Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_audio/index.html Fetches all usable parameters for a given audio asset. This is useful for understanding what properties can be modified or controlled for a specific sound. ```lua sc.audio.getAvailableParams( name ) ``` -------------------------------- ### Get All Connected Power Sources Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all PowerSources connected to the computer. Use this to manage power distribution and monitor power levels. ```lua sc.getPowerSources() ``` -------------------------------- ### Get All Connected Displays - Lua Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves a list of all displays currently connected to the computer. Each item in the returned array is a Display object. ```lua sc.getDisplays() ``` -------------------------------- ### Define and Add an Environment Hook Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/environment-manager/index.html This example demonstrates how to define a new environment hook function and add it to the `environmentHooks` table. The hook can define new functions or modify existing ones within the `sc` table. ```lua -- A environment hook--@param self ShapeClasslocal function environmentHook( self ) return { -- Prints hello world helloWorld = function() print( "Hello World!" ) end, -- This wont overwrite the sc table! sc = { -- Gets all of myComponent and returns it getMyComponent = function () return sm.scrapcomputers.componentManager.getComponents( "SeatControllers", self.interactable, true ) end } } end -- Add the hook to the environment Hooks table.insert( sm.scrapcomputers.environmentManager.environmentHooks, environmentHook ) ``` -------------------------------- ### Get All Connected Cameras Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all cameras connected to the computer. Use this to access camera feeds or manage camera devices. ```lua sc.getCameras() ``` -------------------------------- ### Define Global Display Variable Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/guides/how_to_use_our_script_template/index.html Define global variables outside the main functions to access them from anywhere in your script. This example shows how to get the first display. ```lua local display = sc.getDisplays()[1] ``` -------------------------------- ### HologramObject Methods Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/user-data/hologram-object/index.html This section details the available methods for interacting with HologramObject instances, including getting and setting various properties and deleting the object. ```APIDOC ## HologramObject A HologramObject is an object from a hologram. AKA: An object that you're rendering on the hologram. ### Functions #### getId Gets the ID of the object. **Returns:** * `integer`: The ID of the object. #### getUUID Gets the UUID of the object. **Returns:** * `Uuid`: The UUID of the object. #### getPosition Gets the position of the object. **Returns:** * `Vec3`: The Position of the object. #### getRotation Gets the Rotation of the object. **Returns:** * `Quat`: The Rotation of the object. #### getScale Gets the Scale of the object. **Returns:** * `Vec3`: The Scale of the object. #### getColor Gets the Color of the object. **Returns:** * `Color`: The Color of the object. #### setUUID Sets the object's UUID to be the argument. **Arguments:** * `value` (`string`|`Uuid`): The new UUID. #### setPosition Sets the object's Position to be the argument. **Arguments:** * `value` (`Vec3`): The New Position. #### setRotation Sets the object's Rotation to be the argument. **Arguments:** * `value` (`Quat`): The New Rotation. #### setScale Sets the object's Scale to be the argument. **Arguments:** * `value` (`Vec3`): The New Scale. #### setColor Sets the object's Color to be the argument. **Arguments:** * `value` (`Color`): The New Color. #### delete Deletes the object. ``` -------------------------------- ### Get All Connected Drives - Lua Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves a list of all drives currently connected to the computer. Each item in the returned array is a Drive object. ```lua sc.getDrives() ``` -------------------------------- ### Get Configuration by ID Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/config/index.html Retrieves a specific configuration by its unique ID. This function is server-only and will throw an error if the configuration is not found. ```javascript sm.scrapcomputers.config.getConfig( id ) ``` -------------------------------- ### Get All Connected Radars Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all radars connected to the computer. Use this to get a list of available radar devices. ```lua sc.getRadars() ``` -------------------------------- ### Get All Audio Names Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/audio/index.html This function retrieves a list of all available audio assets within the game. It's useful for iterating through or accessing specific audio by name. ```lua sm.scrapcomputers.audio.getAudioNames() ``` -------------------------------- ### Get All Registered Computer IDs Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/computer-manager/index.html Fetches a list containing the unique IDs of all computers that are currently registered. This is useful for iterating through all active computers. ```lua sm.scrapcomputers.computerManager:getAllComputers() ``` -------------------------------- ### Get All Connected GPSs Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all GPS devices connected to the computer. Use this to get location data or manage GPS components. ```lua sc.getGPSs() ``` -------------------------------- ### Initialize sm.scrapcomputers.backend Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/sm.scrapcomputers/index.html Initializes the sm.scrapcomputers.backend table, used for special backend activities between components. ```lua sm.scrapcomputers.backend = {} ``` -------------------------------- ### Get Total Registered Computers Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/computer-manager/index.html Retrieves the total count of computers currently registered in the game world. This can be useful for monitoring or managing resources. ```lua sm.scrapcomputers.computerManager:getTotalComputers() ``` -------------------------------- ### sm.scrapcomputers.config.initConfig Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/config/index.html Initializes the Config system for ScrapComputers. This function is server-only and typically called automatically when the mod loads. ```APIDOC ## sm.scrapcomputers.config.initConfig ### Description Initializes the Config system for ScrapComputers. This function is server-only and typically called automatically when the mod loads. ### Function Signature `sm.scrapcomputers.config.initConfig()` ### Notes * `Server-Only` ``` -------------------------------- ### GravityController.getMultiplier Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/gravityController/index.html Gets the current gravity multiplier. ```APIDOC ## GravityController.getMultiplier ### Description Gets the current gravity multiplier. ### Method `GravityController.getMultiplier()` ### Returns * **number** - The current gravity multiplier. ``` -------------------------------- ### Virtualdisplay.getDimensions Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/user-data/virtualdisplay/index.html Gets the virtual display's dimensions. ```APIDOC ## Virtualdisplay.getDimensions ### Description Gets the virtual displays' dimensions. ### Returns * (integer) - The width. * (integer) - The height. ``` -------------------------------- ### Create New Configuration Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/config/index.html Creates a new configuration with specified parameters. Requires configuration initialization and is server-only. Ensure the ID format is unique to avoid conflicts. ```javascript sm.scrapcomputers.config.createConfig( id, name, description, hostOnly, options ) ``` -------------------------------- ### getDimensions Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/user-data/virtualdisplay/index.html Gets the virtual display's current dimensions. ```APIDOC ## getDimensions ### Description Gets the virtual display's dimensions. ### Method Virtualdisplay.getDimensions() ### Returns - **integer** - The width. - **integer** - The height. ``` -------------------------------- ### GravityController.getCreationMass Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/gravityController/index.html Gets the mass of the creation that the gravity controller is placed on. ```APIDOC ## GravityController.getCreationMass ### Description Gets the mass of the creation that the gravity controller is placed on. ### Method `GravityController.getCreationMass()` ### Returns * **number** - The creation mass. ``` -------------------------------- ### sm.scrapcomputers.config.createDefaultConfigs Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/config/index.html Creates default configurations for ScrapComputers. It can optionally return only the default configurations without addon-specific ones. ```APIDOC ## sm.scrapcomputers.config.createDefaultConfigs ### Description Creates default configurations for ScrapComputers. It can optionally return only the default configurations without addon-specific ones. ### Function Signature `sm.scrapcomputers.config.createDefaultConfigs( onlyDefaultConfigs )` ### Parameters #### Arguments * `onlyDefaultConfigs` (boolean?) - Optional - If true, it will only return default configs without the addon parts. Default is false ### Returns * `[Configuration[]]` - The generated configurations ``` -------------------------------- ### GravityController.getBodyMass Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/gravityController/index.html Gets the mass of the body that the gravity controller is placed on. ```APIDOC ## GravityController.getBodyMass ### Description Gets the mass of the body that the gravity controller is placed on. ### Method `GravityController.getBodyMass()` ### Returns * **number** - The body mass. ``` -------------------------------- ### Initialize sm.scrapcomputers.dataList Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/sm.scrapcomputers/index.html Initializes the sm.scrapcomputers.dataList table, which contains lists of various ScrapComputers components like Displays, Harddrives, and more. ```lua sm.scrapcomputers.dataList = { ["Displays"] = {}, ["Harddrives"] = {}, ["Holograms"] = {}, ["Terminals"] = {}, ["Radars"] = {}, ["InputRegisters"] = {}, ["OutputRegisters"] = {}, ["NetworkPorts"] = {}, ["Antennas"] = {}, ["Cameras"] = {}, ["Speakers"] = {}, ["Keyboards"] = {}, ["Motors"] = {}, ["Lasers"] = {}, ["GPSs"] = {}, ["SeatControllers"] = {}, ["NetworkInterfaces"] = {} } ``` -------------------------------- ### Create Directory Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/user-data/computer-filesystem/index.html Creates a new directory at the specified path. ```APIDOC ## createDirectory ### Description Creates a new directory at the given path. ### Method Filesystem:createDirectory( path ) ### Parameters #### Path Parameters * **path** (string) - Required - The path to create the directory. ``` -------------------------------- ### Create New Virtual Display Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_virtualdisplay/index.html Creates a new virtual display instance with specified dimensions. Use this to set up a virtual screen for rendering. ```Lua sc.virtualdisplay.new(displayWidth, displayHeight) ``` -------------------------------- ### Create File Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/user-data/computer-filesystem/index.html Creates a new file with specified content at a given path. ```APIDOC ## createFile ### Description Creates a new file with encoded content. ### Method Filesystem:createFile( path, content ) ### Parameters #### Path Parameters * **path** (string) - Required - Destination path. * **content** (string) - Required - File contents. ``` -------------------------------- ### Define sm.scrapcomputers.layoutFiles Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/sm.scrapcomputers/index.html Defines paths to various layout files used for GUI elements in ScrapComputers components. ```lua sm.scrapcomputers.layoutFiles = { Computer = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/Gui/Layout/Computer.layout", Terminal = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/Gui/Layout/Terminal.layout", Register = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/Gui/Layout/Register.layout", Configurator = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/Gui/Layout/Configurator.layout", Harddrive = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/Gui/Layout/Harddrive.layout", Keyboard = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/Gui/Layout/Keyboard.layout" } ``` -------------------------------- ### sc.getLights() Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all lights connected to the computer. This function returns an array of Light objects. ```APIDOC ## sc.getLights() ### Description Gets all connected lights from the computer. ### Returns * `[Light[]]` - An array of all connected light objects. ``` -------------------------------- ### Display.getPixel Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/display/index.html Gets the color of a pixel from the buffer that takeSnapshot updates at the coordinates specified. ```APIDOC ## Display.getPixel ### Description Gets the color of a pixel from the buffer that `takeSnapshot` updates at the coordinates specified. ### Method `Display.getPixel( x, y )` ### Parameters #### Arguments - **x** (integer) - The x-coordinate. - **y** (integer) - The y-coordinate. ### Returns - **Color** - The color of the pixel. ``` -------------------------------- ### Get All Loaded Languages Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/language-manager/index.html Retrieves a list of all languages currently loaded by the LanguageManager. ```APIDOC ## getLanguages ### Description Gets all loaded languages and returns them. ### Method `sm.scrapcomputers.languageManager.getLanguages()` ### Returns * `Language[]` - An array of Language objects, each containing translation data. ``` -------------------------------- ### Get Total Loaded Languages Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/language-manager/index.html Returns the total count of languages that have been loaded into the LanguageManager. ```lua sm.scrapcomputers.languageManager.getTotalLanguages() ``` -------------------------------- ### createConfig Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/config/index.html Creates a new configuration with specified details. Requires Configuration Initialization and is server-only. ```APIDOC ## createConfig ### Description Creates a new config. ### Method `sm.scrapcomputers.config.createConfig( id, name, description, hostOnly, options )` ### Parameters #### Arguments * `id` (string) - The id of the config. Reccommended to be in this format to not cause any conflicts: `[MOD_NAME].[COMPONENT_NAME].[CONFIG_NAME]` * `name` (string) - The name of the configuration. * `description` (string) - The description of the config. * `hostOnly` (boolean) - If it is only accessible by the host or not. * `options` (string[]) - The options the configuration has. ### Notes * Server-Only * Configuration Initalization Required ``` -------------------------------- ### Create Power Instance Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/power-manager/index.html Use this function to create a power instance for a component. If the component is already set as powered in 'toComponent', this is not needed. ```lua sm.scrapcomputers.powerManager.createPowerInstance( shapeId ) ``` -------------------------------- ### Get All Connected Keyboards Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all keyboards connected to the computer. Use this to manage input devices. ```lua sc.getKeyboards() ``` -------------------------------- ### Get Total Loaded Languages Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/language-manager/index.html Returns the total count of languages currently loaded by the LanguageManager. ```APIDOC ## getTotalLanguages ### Description Gets the total loaded languages and returns the amount. ### Method `sm.scrapcomputers.languageManager.getTotalLanguages()` ### Returns * `integer` - The total number of loaded languages. ``` -------------------------------- ### Get All Connected Lasers Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all lasers connected to the computer. Use this to manage laser devices or their operations. ```lua sc.getLasers() ``` -------------------------------- ### sc.midi.createPlayer Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_midi/index.html Creates a MIDI player instance that can play MIDI data through a specified speaker. ```APIDOC ## sc.midi.createPlayer ### Description Creates a MIDI player instance. ### Signature `sc.midi.createPlayer( data, speaker )` ### Parameters #### Arguments * `data` (table) - Required - MIDI data generated from the converter. * `speaker` (Speaker) - Required - The speaker to play it to. ### Returns * (MIDIPlayer) - A midi player instance. ``` -------------------------------- ### sc.multidisplay.new Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_multidisplay/index.html Creates a new multidisplay instance by combining multiple individual display components into a grid. ```APIDOC ## sc.multidisplay.new ### Description Creates a multidisplay from multiple displays. ### Signature `sc.multidisplay.new( displays, columns, rows )` ### Parameters #### Path Parameters - **displays** ([Display](docs/Lua API/components/display)[]) - Required - The displays to form a multidisplay instance. - **columns** (integer) - Required - The amount of displays in the horizontal direction. - **rows** (integer) - Required - The amount of displays in the vertical direction. ``` -------------------------------- ### Get All Connected Speakers Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all speakers connected to the computer. This function is useful for audio output management. ```lua sc.getSpeakers() ``` -------------------------------- ### createEnv Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/environment-manager/index.html Creates a new environment variables table and returns it, which can be used to set up a Lua environment for custom scripts. ```APIDOC ## createEnv `sm.scrapcomputers.environmentManager.createEnv( self, luaVM )` Creates a environment variables table and returns it. **Arguments:** * `self` [ **ShapeClass** ] - This should be the `self` keyword, aka your class. * `luaVM` [ **Computer.LuaVM?** ] - The LuaVM. Used for making [loadstring](/docs/Lua API/global_variables#loadstring) functional, if no VM is provided, that function will simply throw a error. **Returns:** * [ **LuaAPI** ] - The created environment variables. ``` -------------------------------- ### Get Antenna Name Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/antenna/index.html Retrieves the current name of the antenna. This is useful for identifying the antenna within the network. ```Lua Antenna.getName() ``` -------------------------------- ### createGuiFromLayout Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/gui/index.html Creates a GUI element from a specified layout file, supporting translations. It can optionally destroy the GUI when closed and accept custom settings. Use `setTextRaw` for direct text setting to bypass translation. ```APIDOC ## createGuiFromLayout ### Description Creates a GUI from a layout file with translation support. ### Method `sm.scrapcomputers.gui:createGuiFromLayout( layout, destroyOnClose, settings )` ### Parameters #### Arguments - **layout** (string) - Path to the layout file. - **destroyOnClose** (boolean?) - If true, the GUI is destroyed when closed. - **settings** (GuiSettings?) - GUI settings. ### Returns - **GuiInterface** - A translated GUI interface wrapper. ``` -------------------------------- ### Get Table Size Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/table/index.html Calculates the total number of elements in a table, supporting both array-like and dictionary-like structures. ```APIDOC ## sm.scrapcomptuers.table.getTableSize ### Description Calculates the total number of elements in a table, supporting both array-like and dictionary-like structures. ### Arguments * `tbl` (table) - The table to check. ### Returns * (integer) - The total number of elements in the table. ``` -------------------------------- ### Get All Loaded Languages Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/language-manager/index.html Retrieves all languages currently loaded by the LanguageManager. Each language object contains its translations. ```lua sm.scrapcomputers.languageManager.getLanguages() ``` -------------------------------- ### sc.getKeyboards() Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all keyboards connected to the computer. This function returns an array of Keyboard objects. ```APIDOC ## sc.getKeyboards() ### Description Gets all connected keyboards from the computer. ### Returns * `[Keyboard[]]` - An array of all connected keyboard objects. ``` -------------------------------- ### MIDI Player Creation Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/midi/index.html Creates a MIDI player instance that can be used to play MIDI data through a specified speaker. ```APIDOC ## sm.scrapcomputers.midi.createPlayer ### Description Creates a MIDI player instance. ### Method `sm.scrapcomputers.midi.createPlayer(data, speaker)` ### Parameters #### Arguments * **data** (table) - Required - MIDI data generated from the converter. * **speaker** ([Speaker](/docs/Lua API/components/speaker)) - Required - The speaker to play it to. ### Returns * ([MIDIPlayer](/docs/Addon API/user-data/midiplayer)) - A midi player instance. ``` -------------------------------- ### Get All Connected Motors Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all motors connected to the computer. This function is useful for controlling or querying motor states. ```lua sc.getMotors() ``` -------------------------------- ### Get All Connected Network Ports Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all network ports connected to the computer. This is useful for network management and diagnostics. ```lua sc.getNetworkPorts() ``` -------------------------------- ### Get All Connected Terminals Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all terminals connected to the computer. This function is useful for managing or accessing terminal interfaces. ```lua sc.getTerminals() ``` -------------------------------- ### Client-Side Initialization and Shared Table Tick Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/sharedtable/index.html Initializes the shared table module on the client and runs its tick. `sm.scrapcomputers.sharedTable:init(self)` should be called during initialization, and `sm.scrapcomputers.sharedTable:runTick(self)` in `client_onFixedUpdate`. ```lua -- CLIENT -- function MyClass:client_onCreate() sm.scrapcomputers.sharedTable:init(self) self.cl = {} end ``` ```lua function MyClass:client_onFixedUpdate() sm.scrapcomputers.sharedTable:runTick(self) print("Server Current counter", self.cl.sharedTable.myCounter) end ``` -------------------------------- ### Motor.getCurrentLength() Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/motor/index.html Gets the piston's current length. It's important to note that only one piston can be connected at a time. ```APIDOC ## Motor.getCurrentLength() ### Description Gets the piston's current length. Note that only 1 piston can be connected! ### Method GET ### Endpoint /motor/currentLength ### Returns * **number** - The current length. ``` -------------------------------- ### forceSyncFilesystem Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/computer-manager/index.html Forcefully syncs a computer's filesystem to its storage and clients. Use this if you need immediate synchronization before regular events occur. ```APIDOC ## forceSyncFilesystem ### Description Forcefully syncs a computer's filesystem to its storage and clients. Use this if you need immediate synchronization before regular events occur. ### Method Call ### Function Signature sm.scrapcomputers.computerManager:forceSyncFilesystem( id ) ### Parameters #### Arguments * **id** (integer) - Required - The computer ID. ``` -------------------------------- ### Initialize Multi-Display Grid Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/guides/how_to_use_multidisplays/index.html Use this formula to create a new multi-display object. Replace 'columns' and 'rows' with the desired dimensions of your display grid. ```lua local display = sc.multidisplay.new( sc.getDisplays(), columns, rows ) ``` -------------------------------- ### Get Item at Index Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/table/index.html Retrieves an item from a table at a specified index, irrespective of the table's internal indexing. ```APIDOC ## sm.scrapcomptuers.table.getItemAt ### Description Retrieves an item from a table at a specified index, irrespective of the table's internal indexing. ### Arguments * `tbl` (table) - The table to read. * `index` (integer) - The index to get the item from. ### Returns * (any) - The value at the specified index, if found. ``` -------------------------------- ### Register a Computer Instance Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/managers/computer-manager/index.html Registers a new computer instance with the ComputerManager. This function is used internally by ScrapComputers and is not intended for direct use by addons. ```lua sm.scrapcomputers.computerManager:registerComputer( classInstance ) ``` -------------------------------- ### Get Computer Power Consumption Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_power/index.html Retrieves the total power currently being consumed by the computer. This is useful for monitoring energy usage. ```lua sc.power.getConsumtion() ``` -------------------------------- ### Define sm.scrapcomputers.jsonFiles Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/sm.scrapcomputers/index.html Defines paths to various JSON files used for data and configuration in ScrapComputers. ```lua sm.scrapcomputers.jsonFiles = { ExamplesList = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/JSON/examples.json", HarddriveExamples = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/JSON/hdd_examples.json", AudioList = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/JSON/audio.json", BuiltInFonts = "$CONTENT_3660881a-a6b8-40e5-a348-27b368a742e9/JSON/fonts.json" } ``` -------------------------------- ### Print Informational Message to Console Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_console/index.html Use sc.console.log to display a generic informational message. It accepts a format string and subsequent arguments for dynamic content, similar to string.format. ```lua sc.console.log(format, ...) ``` -------------------------------- ### Get All Connected Radar Warning Receivers Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all RadarWarningReceivers connected to the computer. Use this to manage radar warning systems. ```lua sc.getRadarWarningReceivers() ``` -------------------------------- ### Get All Connected Seat Controllers Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all SeatControllers connected to the computer. This function is useful for managing vehicle or seat-related components. ```lua sc.getSeatControllers() ``` -------------------------------- ### show Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/display/index.html Shows the display. ```APIDOC ## show ### Description Shows the display. ### Signature `Display.show()` ``` -------------------------------- ### Get All Connected Holograms Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all holograms currently connected to the computer. Use this to interact with or query connected hologram devices. ```lua sc.getHolograms() ``` -------------------------------- ### sc.audio.getAudioNames Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_audio/index.html Retrieves a list of all available audio asset names in the game. ```APIDOC ## sc.audio.getAudioNames ### Description Gets every audio in existence in Scrap Mechanic and returns them as a string array. ### Returns: * `string[]` - An array containing all audio asset names. ``` -------------------------------- ### Get Power Component Name Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/power/powercomponent/index.html Retrieves the name of the power source. Use this function to identify the specific power component. ```lua PowerComponent.getName() ``` -------------------------------- ### sc.virtualdisplay.new Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_virtualdisplay/index.html Creates a new virtual display instance with specified dimensions. ```APIDOC ## sc.virtualdisplay.new ### Description Creates a new virtual display instance with the specified width and height. ### Method `sc.virtualdisplay.new(displayWidth, displayHeight)` ### Parameters #### Arguments * **displayWidth** (Integer) - The width of the virtual display. * **displayHeight** (Integer) - The height of the virtual display. ### Returns * **[VirtualDisplay](/docs/Lua API/user-data/virtualdisplay)** - The newly created virtual display instance. ``` -------------------------------- ### Get Latest Keystroke - Lua Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/keyboard/index.html Retrieves the most recent keystroke. Use this to capture single key presses or backspace actions. ```lua Keyboard.getLatestKeystroke() ``` -------------------------------- ### Clear All Memory in MTFastMemory Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/community-mods/MT Fast Logic/mtfastmemory/index.html Resets the memory block, removing all stored key-value pairs. Use this to start with a clean memory state. ```lua MTFastMemory:clearMemory() ``` -------------------------------- ### BitStream.new Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/bitstream/index.html Creates a new BitStream stream, optionally initializing it with pre-appended binary data. ```APIDOC ## BitStream.new ### Description Creates a new BitStream Stream. ### Method `sm.scrapcomputers.bitstream.new( data )` ### Parameters #### Arguments * `data` [ string? ] - Optional - Pre-appended binary data. ### Returns * [ `BitStream.Stream` ] - The bitstream itself. ``` -------------------------------- ### Get Multiple Values from MTFastMemory Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/community-mods/MT Fast Logic/mtfastmemory/index.html Retrieves values for an array of specified numerical keys. The returned array will contain the corresponding values. ```lua MTFastMemory:getValues(keys) ``` -------------------------------- ### Get Single Value from MTFastMemory Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/community-mods/MT Fast Logic/mtfastmemory/index.html Retrieves the numerical value stored at a specific numerical key. Returns 0 if the key does not exist. ```lua MTFastMemory:getValue(key) ``` -------------------------------- ### sm.scrapcomputers.config.getConfigByIndex Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/static-function-namespaces/config/index.html Retrieves a configuration by its index (not ID). This function is server-only and will error if the configuration is not found. ```APIDOC ## sm.scrapcomputers.config.getConfigByIndex ### Description Retrieves a configuration by its index (not ID). This function is server-only and will error if the configuration is not found. ### Function Signature `sm.scrapcomputers.config.getConfigByIndex( index )` ### Parameters #### Arguments * `index` (integer) - Required - The index to search ### Returns * `[Configuration]` - The configuration it has found. ### Notes * `Server-Only` ``` -------------------------------- ### Filesystem:enableEncryption Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/user-data/computer-filesystem/index.html Encrypts all filesystem contents using a provided password. Use with caution as it can break the computer. ```APIDOC ## Filesystem:enableEncryption ### Description Encrypts all filesystem contents using the provided password. You do not have to call [Filesystem:enterEncryptionPassword](#enterencryptionpassword) if you are encrypting the filesystem. This will BREAK the computer! ### Method Filesystem:enableEncryption ### Parameters #### Path Parameters - **password** (string) - Required - The password to encrypt the computer with. Passwords should be kept safe! If you need to use this function where the user can access it, please ask them to retype their password twice as there's no recovery option if you forget your password! ### Warning Due to the team wanting this update to be finished ASAP and that i (VeraDev) was not bothered enough to fix this, toggling encryption via this will NOT notify the computer causing unexpected behaviour! However hopefully in the Post-V3 update, we can fix this. (This is not a promise however) ``` -------------------------------- ### Get Receiving Power Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_power/index.html Retrieves the total power the computer is receiving from connected power sources. Returns the incoming power in kilowatts. ```lua sc.power.getReceivingPower() ``` -------------------------------- ### Get Register Value Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves the current value of a specified input register. The register name must correspond to an input register. ```lua sc.getReg( registerName ) ``` -------------------------------- ### sc.getDisplays Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves a list of all displays connected to the computer. ```APIDOC ## sc.getDisplays ### Description Gets all connected displays from the computer. ### Method `sc.getDisplays()` ### Returns * `Display[]` - An array of all connected displays. ``` -------------------------------- ### sm.scrapcomputers.sharedTable:init Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/sharedtable/index.html Initializes the SharedTable module for use within a class instance. ```APIDOC ## sm.scrapcomputers.sharedTable:init ### Description Initializes for shared tables to be used. ### Method `sm.scrapcomputers.sharedTable:init( classInstance )` ### Parameters #### Arguments * `classInstance` (ShapeClass) - The class instance (i.e., `self` for the class). ``` -------------------------------- ### Get All Connected Collision Detectors Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc/index.html Retrieves all CollisionDetectors connected to the computer. This function is useful for proximity sensing and collision avoidance systems. ```lua sc.getCollisionDetectors() ``` -------------------------------- ### sc.nbs.createPlayer Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_nbs/index.html Creates a new player for the NBS system, returning an NBSPlayer object. ```APIDOC ## sc.nbs.createPlayer ### Description Creates a new player for the NBS system. ### Method `sc.nbs.createPlayer( nbsData, speaker )` ### Parameters #### Arguments * `nbsData` (table) - Required - The NBS data. * `speaker` ([Speaker](/docs/Lua API/components/speaker)) - Required - The speaker to play it to. ### Returns * ([NBSPlayer](/docs/Lua API/user-data/nbsplayer)) - The nbs player. ``` -------------------------------- ### print Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/global_variables/index.html Prints text to the chat. It automatically converts any argument to a string, including tables, making their contents visible. ```APIDOC ## print ### Description Prints text to the chat. Will be always converted to a string so you can pass in anything. If it is a table, it will convert to be printable and you can see the contents inside. ### Method print ### Parameters #### Arguments - ... [ any[] ] - All arguments to send to the chat. ``` -------------------------------- ### createPlayer Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/nbs/index.html Creates a new NBS player instance that can play NBS music data through a given speaker. ```APIDOC ## createPlayer ### Description Creates a new player for the NBS. ### Method `sm.scrapcomputers.nbs.createPlayer( nbsData, speaker )` ### Parameters #### Arguments * `nbsData` (table) - Required - The NBS data. * `speaker` (Speaker) - Required - The speaker to play it to ### Returns * (NBSPlayer) - The nbs player ``` -------------------------------- ### Get Battery Charge Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/components/power/battery/index.html Use this function to retrieve the current stored charge within the battery. Returns a number representing the charge. ```lua Battery.getCharge() ``` -------------------------------- ### sc.console.info Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Lua API/static-functions-namespaces/sc_console/index.html Prints a generic message to the console. Arguments are passed into a string.format. ```APIDOC ## sc.console.info ### Description Prints a generic message to the console. Arguments are passed into a `string.format`. ### Method `sc.console.info(format, ...)` ### Parameters #### Arguments * `format` (string) - The message format to print. * `...` (any) - Values to pass into the format. ``` -------------------------------- ### Create New MD5 Stream Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/Addon API/modules/md5/index.html Use this function to create a new MD5 stream object. This is the starting point for more complex MD5 operations. ```lua sm.scrapcomputers.md5.new() ``` -------------------------------- ### Get All Memory Contents from MTFastMemory Source: https://github.com/scrapcomputers/scdocs/blob/main/docs/community-mods/MT Fast Logic/mtfastmemory/index.html Retrieves the entire current contents of the memory block as a table. This table represents all stored key-value pairs. ```lua MTFastMemory:getMemory() ```