### Loading Configuration with LP_GET_VALUE Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Demonstrates how to fetch configuration data from cloud storage using LP_GET_VALUE and decode it. This method is shown as a basic example and might not be the most efficient. ```luau local scriptSettings = { Aimbot = { Enabled = true, Mode = "Mouse", FOV = { Enabled = true, Size = 45, Color = { R = 0, G = 0, B = 0 } }, Smoothing = { .... whatever } } } local success, response = LP_GET_VALUE("cloudConfig-legit") if not success then warn("Failed to get config!") else print("Loading config!") -- Terrible way of loading configs but this is just an example scriptSettings = game:GetService("HttpService"):JSONDecode(response) end ``` -------------------------------- ### LPH_OBFUSCATED Correct Usage Example Source: https://docs.luaprot.net/luaprot/macro-documentation Provides a comprehensive example of using LPH_OBFUSCATED for conditional execution and demonstrates its behavior during obfuscation. ```lua if LPH_OBFUSCATED then validateWhitelist() -- This code will only run during obfuscation. else skipWhitelist() -- This code will only run when the script is not obfuscated. -- Additionally, there will be no traces of this code in the obfuscated code. end return LPH_OBFUSCATED and runWithoutDebugging() or runWithDebugging() ``` -------------------------------- ### LPH_OBFUSCATED Obfuscated Output Example Source: https://docs.luaprot.net/luaprot/macro-documentation Illustrates the resulting code after LuaProt obfuscates a script using the LPH_OBFUSCATED macro. ```lua do validateWhitelist() end return runWithoutDebugging() -- skipWhitelist() and runWithDebugging() are not present in the obfuscated code. -- LPH_OBFUSCATED is replaced with true, and the conditions are optimized away. ``` -------------------------------- ### Incorrect LP_VMIFY Usage Example Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Shows an incorrect way to use LP_VMIFY by not calling the virtualized function. LP_VMIFY only virtualizes the function and does not execute it. ```luau LP_VMIFY(function() print("Hello, world!") end) -- LP_VMIFY does NOT call the function! ``` -------------------------------- ### Key Check Library Example Source: https://docs.luaprot.net/luaprot/macro-documentation/key-check-library.md Demonstrates how to initialize the library, set the script ID, and check a key. It also shows how to handle valid and invalid key responses, and access returned data like execution counts, notes, and expiration times. This snippet can be used before the main luaprot loader to perform pre-checks. ```lua local sdk = loadstring(game:HttpGet("https://sdk.luaprot.net/"))() -- set the script id sdk.scriptId = "53587481141279449402" -- checking key local result = sdk:checkKey("d97b328732f76c31a55ba92d") if result.status == "VALID" then -- key is valid, do something with the returned data! print(result.data.keyExecutions) -- total key executions if key was found print(result.data.scriptExecutions) -- total script executions print(result.data.note) -- key note if it exists print(result.data.expire) -- expiration in seconds from the current time print(result.data.premium) -- if advertisement key or no key, this will return false print(result.data.discordId) -- discord id if linked print(result.data.discordUsername) -- discord username if discord is linked and data was found -- alternatively we can load the script; but you also can use the normal loader sdk:loadScript() else -- key check failed warn( ("[%s] :: %s"):format(result.status, result.message) ) end ``` -------------------------------- ### Incorrect LP_INIT Usage Examples Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Illustrates incorrect usage of LP_INIT, including calling the function directly after initialization or using upvalues. LP_INIT expects a single constant function and does not support upvalues or return values. ```luau LP_INIT(function() print("Hello, world!") end)() -- You should NOT call this ``` ```luau local myFunction = function() print("Hello, world!") end LP_INIT(myFunction) -- LP_INIT accepts a single constant function as argument ``` ```luau local myUpvalue = "Hello, world!" LP_INIT(function() print(myUpvalue) end) -- LP_INIT does not support upvalues ``` ```luau local initMacro = LP_INIT(function() print("Hello, world!") end) -- LP_INIT does not return anything ``` -------------------------------- ### Fetch Keys Response Example Source: https://docs.luaprot.net/luaprot/api-documentation/keys.md This JSON object represents a successful response when fetching keys. It includes details about the keys found, pagination information, and the total count. ```json { "success": true, "message": "Successfully fetched keys.", "keys": [ { "hubId": "40511091490620200512", "hubName": "Main Hub", "advertiseId": null, "discordId": "123456789012345678", "key": "73978994376e1f3e307914c4", "expire": 1764835962, "note": "Customer note", "created": 1764749562, "activated": true, "hwid": "589401805431295092384985734", "hwidResetCount": 0, "lastHwidReset": 0, "executionCount": 0, "lastExecution": 0, "blacklisted": false, "blacklistReason": null, "limitedScripts": ["45006455740750038081"], "discordData": { "id": "123456789012345678", "username": "wompus_dompus", "avatar": null, "global_name": "Wompus", "modified": 1759761781, "created": 1759761781 } } ], "limitPerPage": 25, "totalPages": 1, "totalKeys": 1 } ``` -------------------------------- ### Get Value with LP_GET_VALUE Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Fetches a storage value associated with a key or HWID, used for retrieving cloud configurations or saved statistics. ```luau local kills = LP_GET_VALUE("player_kills_123") print("Player kills: " .. tostring(kills)) ``` -------------------------------- ### Incorrect LP_BLACKLIST Usage Examples Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Demonstrates incorrect ways to use LP_BLACKLIST, such as concatenating strings or passing non-constant string arguments. The macro strictly requires a single constant string. ```luau LP_BLACKLIST("Hello, world" .. "!") -- LP_BLACKLIST accepts 1 single constant string ``` ```luau local blacklistReason = "Hello, world!" LP_BLACKLIST(blacklistReason) -- LP_BLACKLIST accepts 1 single constant string ``` ```luau LP_BLACKLIST(1234567890) -- LP_BLACKLIST accepts 1 single constant string ``` -------------------------------- ### LPH_LINE Obfuscated Output Example Source: https://docs.luaprot.net/luaprot/macro-documentation Shows how the LPH_LINE macro is replaced with actual line numbers in the compiled and obfuscated code. ```lua 1 | local firstLine = 1 2 | print("Current Line ", 2) 3 | error("Error on line: 3") ``` -------------------------------- ### Making a Simple Secure Request with LP_SECURE_REQUEST Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md This snippet shows a basic GET request to a URL using LP_SECURE_REQUEST and prints the response body. LP_SECURE_REQUEST requires a table with at least a 'Url' parameter. ```luau print(LP_SECURE_REQUEST({Url = "https://luaprot.net/"}).Body) ``` -------------------------------- ### Hub Not Found Response (404) for Get Blacklists Source: https://docs.luaprot.net/luaprot/api-documentation/blacklists.md This JSON indicates that the requested hub was not found or is not accessible by the authenticated account. ```json { "success": false, "message": "Hub not found or linked to your account." } ``` -------------------------------- ### Get Hubs Source: https://docs.luaprot.net/luaprot/api-documentation/hubs.md Retrieves a list of hubs and their associated script metadata linked to the authenticated account. ```APIDOC ## GET /api/v1/hubs/get ### Description Retrieves a list of hubs and their associated script metadata linked to the authenticated account. ### Method GET ### Endpoint /api/v1/hubs/get ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the result of the operation. - **hubs** (array) - A list of hub objects, each containing hub and script details. - **id** (string) - The unique identifier for the hub. - **name** (string) - The name of the hub. - **enabled** (integer) - Indicates if the hub is enabled (1) or disabled (0). - **hwidResetGap** (null) - Placeholder for hardware ID reset gap information. - **created** (integer) - Timestamp for when the hub was created. - **scripts** (array) - A list of script objects associated with the hub. - **id** (string) - The unique identifier for the script. - **hubId** (string) - The ID of the hub this script belongs to. - **name** (string) - The name of the script. - **enabled** (integer) - Indicates if the script is enabled (1) or disabled (0). - **freeforall** (boolean) - Indicates if the script is in free-for-all mode. - **executionWebhook** (null) - Placeholder for execution webhook URL. - **alertWebhook** (null) - Placeholder for alert webhook URL. - **hwidLock** (boolean) - Indicates if hardware ID locking is enabled for the script. - **maxSessionsPerKey** (integer) - Maximum number of sessions allowed per key. - **version** (integer) - The version of the script. - **lockPlaceIds** (array) - A list of place IDs that are locked for this script. - **pMode** (integer) - The platform mode for the script. - **created** (integer) - Timestamp for when the script was created. - **notifyStyle** (string) - The notification style for the script. ### Response Example { "success": true, "message": "Hubs have been retrieved.", "hubs": [ { "id": "40511091490620200512", "name": "Main Hub", "enabled": 1, "hwidResetGap": null, "created": 1764749562, "scripts": [ { "id": "45006455740750038081", "hubId": "40511091490620200512", "name": "Main Script", "enabled": 1, "freeforall": false, "executionWebhook": null, "alertWebhook": null, "hwidLock": true, "maxSessionsPerKey": 0, "version": 4, "lockPlaceIds": [], "pMode": 0, "created": 1764749562, "notifyStyle": "v1" } ] } ] } ``` -------------------------------- ### Get Values with LP_GET_VALUE Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md LP_GET_VALUE retrieves a stored value using its storage ID. It returns a success status and the response. ```luau LP_GET_VALUE("myStorageId") -- Will fetch whatever is connected to their key, connected to the storage id "myStorageId" ``` ```luau local success, response = LP_GET_VALUE("myStorageId") if not success then -- example error here if "myStorageId" does not exist "Value not found." warn("Failed to get value from storage!", response) end ``` -------------------------------- ### Get Blacklists Source: https://docs.luaprot.net/luaprot/api-documentation/blacklists.md Fetches local or key blacklist entries from a specified hub. It supports an optional HWID query for partial matches. ```APIDOC ## GET /api/v1/hubs/:hubId/blacklists/get ### Description Fetches local or key blacklist entries from a specified hub. It supports an optional HWID query for partial matches. ### Method GET ### Endpoint /api/v1/hubs/:hubId/blacklists/get ### Parameters #### Path Parameters - **hubId** (string) - Required - Hub ID to fetch blacklists from. #### Query Parameters - **hwid** (string) - Optional - HWID search. Partial matches are accepted. ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result of the operation. - **blacklists** (array) - A list of blacklist entries. Each entry can contain: - **id** (string) - The unique identifier for the blacklist entry. - **entryId** (string) - The identifier for the specific blacklist entry. - **type** (string) - The type of blacklist ('Global', 'Key', 'Local'). - **hwid** (string) - The hardware ID associated with the blacklist entry. - **reason** (string) - The reason for the blacklist entry. - **key** (string | null) - The key associated with the blacklist entry, if applicable. - **discordId** (string) - The Discord ID associated with the blacklist entry. - **created** (integer) - The timestamp when the blacklist entry was created. #### Response Example (200) ```json { "success": true, "message": "Successfully fetched blacklists.", "blacklists": [ { "id": "global:f43fh34ui43huer3", "entryId": "f43fh34ui43huer3", "type": "Global", "hwid": "589401805431295092384985734", "reason": "Global blacklist reason", "key": null, "discordId": "123456789012345678", "created": 1769473337 }, { "id": "key:84c370d09e13438149d705c4", "entryId": "84c370d09e13438149d705c4", "type": "Key", "hwid": "589401805431295092384985734", "reason": "Local key reason", "key": "73978994376e1f3e307914c4", "discordId": "123456789012345678", "created": 1769473337 } ] } ``` #### Error Response (404) - **success** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the error. #### Response Example (404) ```json { "success": false, "message": "Hub not found or linked to your account." } ``` ``` -------------------------------- ### Declare Global Macro Shim Source: https://docs.luaprot.net/luaprot/macro-documentation Macros must be declared as globals. This example shows a function shim that returns its arguments. ```lua function LPH_MACRO_NAME(...) return ... end ``` -------------------------------- ### LPH_LINE Correct Usage Example Source: https://docs.luaprot.net/luaprot/macro-documentation Demonstrates the correct usage of the LPH_LINE macro for reporting line numbers in variable assignments, print statements, and error messages. ```lua 1 | local firstLine = LPH_LINE 2 | print("Current Line ", LPH_LINE) 3 | error("Error on line: " .. LPH_LINE) ``` -------------------------------- ### Get Sessions Source: https://docs.luaprot.net/luaprot/api-documentation/sessions.md Fetches active script sessions based on provided query parameters. It can filter by Discord ID, key, or hub ID. ```APIDOC ## GET /api/v1/sessions/get ### Description Fetches active script sessions. You can filter by `discordId`, `key`, or `hubId`. If `hubId` is provided, it takes precedence over `key`. ### Method GET ### Endpoint /api/v1/sessions/get ### Parameters #### Query Parameters - **discordId** (string) - Optional - Discord ID to look for. - **key** (string) - Optional - Key to look for. - **hubId** (string) - Optional - Hub ID to fetch all active sessions for all scripts in the hub. ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome of the request. - **sessions** (array) - An array of session objects, each containing: - **id** (string) - The unique identifier for the session. - **robloxUsername** (string) - The Roblox username associated with the session. - **robloxJobId** (string) - The Roblox job ID for the session. - **robloxUniverseId** (string) - The Roblox universe ID for the session. - **created** (integer) - The timestamp when the session was created. #### Error Response (400) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the error (e.g., "Key could not be found."). #### Error Response (404) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the error (e.g., "Hub not found or linked to your account."). ### Request Example ```json { "discordId": "1234567890", "key": "session_key_123" } ``` ### Response Example (200) ```json { "success": true, "message": "Successfully fetched sessions.", "sessions": [ { "id": "97963719390038484793", "robloxUsername": "LuaProtOnTop", "robloxJobId": "5580cdf5-19cf-40ce-9fd9-fb6d3ca0098a", "robloxUniverseId": "9432747410", "created": 1768140224 } ] } ``` ### Response Example (400) ```json { "success": false, "message": "Key could not be found." } ``` ### Response Example (404) ```json { "success": false, "message": "Hub not found or linked to your account." } ``` ``` -------------------------------- ### Custom Loader Function Example Source: https://docs.luaprot.net/luaprot/macro-documentation/custom-loading-ui.md Define the LP_CUSTOM_LOADER function to handle different loading steps. This function is called by LuaProt during the loading process. Ensure the 'custom' notification style is used. ```luau LP_CUSTOM_LOADER = function(stepOrTime) if stepOrTime == 1 then print("Attempting to authenticate..") elseif stepOrTime == 2 then print("Connecting to LuaProt servers..") else print("Successfully authenticated in " .. stepOrTime .. "s!") end end loadstring(...)() -- LuaProt Loadstring ``` -------------------------------- ### Get Session Info Source: https://docs.luaprot.net/luaprot/api-documentation/sessions.md Retrieves detailed information about a specific session using its unique ID. This includes session details, associated key information, and Discord data if available. ```APIDOC ## GET /api/v1/sessions/:sessionId/info ### Description Retrieves detailed information about a specific session using its unique ID. ### Method GET ### Endpoint /api/v1/sessions/:sessionId/info ### Parameters #### Path Parameters - **sessionId** (string) - Required - Session ID to look for. ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome of the request. - **session** (object) - Contains details about the session. - **id** (string) - The unique identifier for the session. - **key** (string) - The session key. - **robloxUsername** (string) - The Roblox username associated with the session. - **robloxJobId** (string) - The Roblox job ID. - **robloxUniverseId** (string) - The Roblox universe ID. - **created** (integer) - The timestamp when the session was created. - **key** (object) - Contains details about the associated key. - **hubId** (string) - The hub ID associated with the key. - **discordId** (string) - The Discord ID associated with the key. - **key** (string) - The key itself. - **expire** (integer) - The expiration timestamp of the key. - **note** (string) - A customer note associated with the key. - **created** (integer) - The timestamp when the key was created. - **activated** (boolean) - Indicates if the key is activated. - **hwid** (string) - The hardware ID associated with the key. - **hwidResetCount** (integer) - The number of times the hardware ID has been reset. - **lastHwidReset** (integer) - The timestamp of the last hardware ID reset. - **executionCount** (integer) - The number of times the key has been executed. - **lastExecution** (integer) - The timestamp of the last execution. - **blacklisted** (boolean) - Indicates if the key is blacklisted. - **blacklistReason** (string) - The reason for blacklisting, if applicable. - **limitedScripts** (any) - Information about limited scripts, if any. - **discordData** (object) - Contains Discord user data. - **id** (string) - The Discord user ID. - **username** (string) - The Discord username. - **avatar** (string) - The Discord avatar URL. - **global_name** (string) - The Discord global name. - **modified** (integer) - The timestamp when the Discord data was last modified. - **created** (integer) - The timestamp when the Discord data was created. #### Response Example ```json { "success": true, "message": "Successfully fetched session info.", "session": { "id": "97963719390038484793", "key": "73978994376e1f3e307914c4", "robloxUsername": "LuaProtOnTop", "robloxJobId": "5580cdf5-19cf-40ce-9fd9-fb6d3ca0098a", "robloxUniverseId": "9432747410", "created": 1768140224 }, "key": { "hubId": "40511091490620200512", "discordId": "123456789098765432", "key": "73978994376e1f3e307914c4", "expire": 1764749562, "note": "Customer note", "created": 1764749562, "activated": true, "hwid": "589401805431295092384985734", "hwidResetCount": 0, "lastHwidReset": 0, "executionCount": 0, "lastExecution": 0, "blacklisted": false, "blacklistReason": null, "limitedScripts": null, "discordData": { "id": "123456789098765432", "username": "wompus_dompus", "avatar": null, "global_name": "Wompus", "modified": 1759761781, "created": 1759761781 } } } ``` #### Error Responses - **400 Bad Request** - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the error, e.g., "Invalid session.". - **Response Example**: ```json { "success": false, "message": "Invalid session." } ``` - **403 Forbidden** - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the error, e.g., "Session not found or unauthorized to manage.". - **Response Example**: ```json { "success": false, "message": "Session not found or unauthorized to manage." } ``` ``` -------------------------------- ### GET /api/v1/status/get Source: https://docs.luaprot.net/luaprot/api-documentation/api-status.md Retrieves the current status of the API. This endpoint provides information about the API's operational state, version, and the validity of the associated account token. ```APIDOC ## GET /api/v1/status/get ### Description Retrieves the current status of the API. This endpoint provides information about the API's operational state, version, and the validity of the associated account token. ### Method GET ### Endpoint /api/v1/status/get ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **message** (string) - A message describing the outcome of the request. - **status** (string) - The operational status of the API (e.g., "OK"). - **version** (string) - The version of the API. - **active** (boolean) - Indicates if the API is currently active. - **warnings** (array) - A list of any warnings related to the API. - **validToken** (boolean) - Indicates if the account token is valid. ### Response Example ```json { "success": true, "message": "Status has been fetched successfully.", "status": "OK", "version": "v1", "active": true, "warnings": [], "validToken": true } ``` ``` -------------------------------- ### Get Hubs API Response Source: https://docs.luaprot.net/luaprot/api-documentation/hubs.md This JSON structure represents a successful response from the GET Hubs API endpoint, detailing hub and script information. ```json { "success": true, "message": "Hubs have been retrieved.", "hubs": [ { "id": "40511091490620200512", "name": "Main Hub", "enabled": 1, "hwidResetGap": null, "created": 1764749562, "scripts": [ { "id": "45006455740750038081", "hubId": "40511091490620200512", "name": "Main Script", "enabled": 1, "freeforall": false, "executionWebhook": null, "alertWebhook": null, "hwidLock": true, "maxSessionsPerKey": 0, "version": 4, "lockPlaceIds": [], "pMode": 0, "created": 1764749562, "notifyStyle": "v1" } ] } ] } ``` -------------------------------- ### Initialize with LP_INIT Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Runs a closure before the main authentication logic, useful for anticheat bypasses. Multiple LP_INIT calls are allowed and will all execute. ```luau LP_INIT(function() print("Hello, world!") end) -- You should NOT call this ``` ```luau LP_INIT(function() print("Hello, world! 1") end) LP_INIT(function() print("Hello, world! 2") end) -- You are allowed to have multiple in your file, they will all run ``` -------------------------------- ### Initialize and Show Key System GUI Source: https://docs.luaprot.net/luaprot/macro-documentation/key-system-gui.md Loads the Key System GUI script and displays it. Set the scriptId to your LuauProt script ID. The keyURL can be set to nil to hide the button if not needed. The scriptName is displayed to the user. ```luau local keySystem = loadstring(game:HttpGet("https://sdk.luaprot.net/key-ui.lua"))() keySystem.scriptId = "00000000000000000000" keySystem.keyURL = nil -- Not required, will hide the button keySystem.scriptName = "Testing Script" keySystem.validCallback = nil -- Not required, will load the script from luaprot if nil keySystem:show() ``` -------------------------------- ### Connect to LP_DASHBOARD with String and Callback Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md LP_DASHBOARD:Connect requires both a string identifier and a callback function. The callback receives data from the dashboard. ```luau LP_DASHBOARD:Connect("mySlider", function(data) print("Slider value from dashboard:", data) end) ``` ```luau LP_DASHBOARD:Connect("myTextInput", function(data) print(data) end) ``` ```luau local myCallback = function() print("Hello, world!") end LP_DASHBOARD:Connect("myButton", myCallback) ``` ```luau local myConnection = LP_DASHBOARD:Connect("myTextInput", function(data) print(data) end) task.wait(10) myConnection:Disconnect() -- Disconnects the connection ``` -------------------------------- ### Display Runtime Variables Source: https://docs.luaprot.net/luaprot/macro-documentation/macros-and-runtime-variables.md Demonstrates how to access and print various runtime variables to the console. Ensure these variables are not overwritten, as it can cause a game crash. ```luau print("You have run " .. LP_SCRIPT_NAME) print("Current version: " .. LP_SCRIPT_VERSION) print("Welcome " .. LP_DISCORD) print("Your discord ID is " .. LP_DISCORD_ID) print("You have " .. LP_EXECUTIONS .. " executions") print("The script has " .. LP_SCRIPT_EXECUTIONS .. " executions in total") print("Your keynote is " .. LP_KEYNOTE) print("Your key has " .. LP_TIMELEFT .. " seconds remaining") print("Your HWID is " .. LP_FINGERPRINT) print("Your session id is " .. LP_SESSION_ID) print("There are " .. LP_SESSION_COUNT .. " people using the script") if LP_PREMIUM then print("You're a premium user!") else print("You are not premium.") end ``` -------------------------------- ### Incorrect Macro Usage: Reserved Identifier Source: https://docs.luaprot.net/luaprot/macro-documentation Identifiers starting with 'LPH' are reserved for internal/macro usage and cannot be used for local variables. ```lua local LPH_NAME = ... ``` -------------------------------- ### Add Key Response (Success) Source: https://docs.luaprot.net/luaprot/api-documentation/keys.md A successful key creation returns a JSON object with success status, a message, and the details of the newly created key. ```json { "success": true, "message": "Key has been created successfully.", "key": { "hubId": "40511091490620200512", "discordId": "123456789012345678", "key": "73978994376e1f3e307914c4", "expire": 1764835962, "note": "Customer note", "created": 1764749562, "hwidResetCount": 0, "lastHwidReset": 0, "executionCount": 0, "lastExecution": 0, "blacklisted": false, "blacklistReason": null, "limitedScripts": ["45006455740750038081"], "discordData": { "id": "123456789012345678", "username": "wompus_dompus", "avatar": null, "global_name": "Wompus", "modified": 1759761781, "created": 1759761781 } } } ``` -------------------------------- ### Combining Custom Loader with LP_INIT Source: https://docs.luaprot.net/luaprot/macro-documentation/custom-loading-ui.md Initialize LuaProt and define the custom loader function within the LP_INIT callback. This ensures the custom loader is set up correctly during LuaProt's initialization phase. ```luau LP_INIT(function() getgenv().LP_CUSTOM_LOADER = function(stepOrTime) if stepOrTime == 1 then print("Attempting to authenticate..") elseif stepOrTime == 2 then print("Connecting to LuaProt servers..") else print("Successfully authenticated in " .. stepOrTime .. "s!") end end end) ``` -------------------------------- ### Connect to Dashboard with LP_DASHBOARD:Connect Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Connects to a user dashboard component, enabling handling of toggles like autofarm settings. It requires a component name and a callback function. ```luau LP_DASHBOARD:Connect("autofarm", function(enabled) if enabled then print("Autofarm enabled!") else print("Autofarm disabled!") end end) ``` -------------------------------- ### Key Info Response (Success) Source: https://docs.luaprot.net/luaprot/api-documentation/keys.md A successful response when fetching key information, detailing the key's properties, associated hub, and user data. ```json { "success": true, "message": "Successfully fetched key info.", "key": { "hubId": "40511091490620200512", "advertiseId": "78078400606734922815", "discordId": "123456789098765432", "key": "73978994376e1f3e307914c4", "expire": 1764749562, "note": "Customer note", "created": 1764749562, "activated": false, "hwid": "589401805431295092384985734", "hwidResetCount": 0, "lastHwidReset": 0, "executionCount": 0, "lastExecution": 0, "blacklisted": false, "blacklistReason": null, "limitedScripts": ["45006455740750038081"], "discordData": { "id": "12345678909876543", "username": "wompus_dompus", "avatar": null, "global_name": "Wompus", "modified": 1759761781, "created": 1759761781 } } } ``` -------------------------------- ### Incorrect Usage of LP_GET_VALUE Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Illustrates incorrect ways to use LP_GET_VALUE. It should return two values (success and response), and requires a string argument for the storage ID. ```luau local response = LP_GET_VALUE("myStoredValue") print(response) -- This will print a boolean, LP_GET_VALUE returns 2 values, success (a boolean) and response (the value from storage or an error) ``` ```luau LP_GET_VALUE(123) -- LP_GET_VALUE requires a string (storage id) as first argument ``` -------------------------------- ### Getting Current Line Number with LPH_LINE Source: https://docs.luaprot.net/luaprot/macro-documentation/luraph-macros.md LPH_LINE is a constant integer macro that is replaced with the current line number during compilation. It is useful for debugging and error reporting. ```java const int LPH_LINE ``` ```java 1 | local firstLine = LPH_LINE 2 | print("Current Line ", LPH_LINE) 3 | error("Error on line: " .. LPH_LINE) ``` ```java 1 | local firstLine = 1 2 | print("Current Line ", 2) 3 | error("Error on line: 3") ``` ```java LPH_LINE() -- LPH_LINE is a number value, not a function. ``` -------------------------------- ### Configure Key URL and Validation Callback Source: https://docs.luaprot.net/luaprot/macro-documentation/key-system-gui.md Sets a custom URL for key validation and defines a callback function to execute upon successful key entry. The callback receives the valid key as an argument. ```luau keySystem.keyURL = "https://luaprot.net/ad/abcdefg" keySystem.validCallback = function(key) print("You entered a valid key: " .. key) end ``` -------------------------------- ### Create Storage Success Response (201) Source: https://docs.luaprot.net/luaprot/api-documentation/storage.md A successful response when a storage entry is created. ```json { "success": true, "message": "Storage entry created.", "entry": { "id": "", "key": "73978994376e1f3e307914c4", "isFreeForAll": false, "hwid": "589401805431295092384985734", "valueId": "coins", "sizeBytes": 5, "dataType": "number", "preview": "25000" } } ``` -------------------------------- ### Get Hub Blacklists Response (200) Source: https://docs.luaprot.net/luaprot/api-documentation/blacklists.md This JSON structure represents a successful response when fetching blacklists for a specific hub. It includes details for both global and key-based blacklist entries. ```json { "success": true, "message": "Successfully fetched blacklists.", "blacklists": [ { "id": "global:f43fh34ui43huer3", "entryId": "f43fh34ui43huer3", "type": "Global", "hwid": "589401805431295092384985734", "reason": "Global blacklist reason", "key": null, "discordId": "123456789012345678", "created": 1769473337 }, { "id": "key:84c370d09e13438149d705c4", "entryId": "84c370d09e13438149d705c4", "type": "Key", "hwid": "589401805431295092384985734", "reason": "Local key reason", "key": "73978994376e1f3e307914c4", "discordId": "123456789012345678", "created": 1769473337 } ] } ``` -------------------------------- ### Incorrect LP_DASHBOARD:Connect Usage Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md LP_DASHBOARD:Connect must be called with both a string identifier and a callback function. Providing only one argument or incorrect types will result in an error. ```luau LP_DASHBOARD:Connect(function(data) print("Hello, world!") end) -- LP_DASHBOARD:Connect requires both string and a callback as argument ``` ```luau LP_DASHBOARD:Connect("myTextInput") -- LP_DASHBOARD:Connect requires both string and a callback as argument ``` -------------------------------- ### Use LP_VMIFY with a Function Constant Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md LP_VMIFY expects a single function constant as its argument. Ensure the provided argument is a function. ```luau local myFunction = function() print("Hello, world!") end LP_VMIFY(myFunction) -- LP_VMIFY expects a single function constant ``` -------------------------------- ### LP_DASHBOARD:Connect Source: https://docs.luaprot.net/luaprot/macro-documentation/macros.md Connects to a dashboard element, allowing for real-time data updates and event handling. It requires a string identifier for the element and a callback function. ```APIDOC ## LP_DASHBOARD:Connect ### Description Establishes a connection to a specified dashboard element to receive data updates or event notifications. Returns a connection object that can be used to disconnect. ### Usage ```luau -- Connecting to a slider and receiving its data LP_DASHBOARD:Connect("mySlider", function(data) print("Slider value from dashboard:", data) end) -- Connecting to a text input field LP_DASHBOARD:Connect("myTextInput", function(data) print(data) end) -- Connecting to a button with a predefined callback local myCallback = function() print("Hello, world!") end LP_DASHBOARD:Connect("myButton", myCallback) -- Disconnecting a connection local myConnection = LP_DASHBOARD:Connect("myTextInput", function(data) print(data) end) task.wait(10) myConnection:Disconnect() -- Disconnects the connection ``` ### Parameters * `elementName` (string) - Required - The identifier of the dashboard element. * `callback` (function) - Required - The function to be called when data is received or an event occurs. ### Returns * `Connection` - An object with a `Disconnect()` method to remove the listener. ``` -------------------------------- ### Create Storage Source: https://docs.luaprot.net/luaprot/api-documentation/storage.md Creates a new storage entry with the provided details. Supports string, number, or boolean data types. ```APIDOC ## POST /api/v2/storage ### Description Creates a new storage entry. ### Method POST ### Endpoint /api/v2/storage ### Parameters #### Request Body - **hubId** (string) - Required - The ID of the hub. - **key** (string) - Required - The key for the storage entry. - **hwid** (string) - Required - The hardware ID. - **valueId** (string) - Required - The ID of the value (4-128 characters). - **data** (string | number | boolean) - Required - The data to store. ### Request Example ```json { "hubId": "40511091490620200512", "key": "73978994376e1f3e307914c4", "hwid": "589401805431295092384985734", "valueId": "coins", "data": 25000 } ``` ### Response #### Success Response (201) - **success** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result. - **entry** (object) - Details of the created storage entry. - **id** (string) - The ID of the entry. - **key** (string) - The key of the entry. - **isFreeForAll** (boolean) - Whether the entry is free for all. - **hwid** (string) - The hardware ID. - **valueId** (string) - The ID of the value. - **sizeBytes** (number) - The size of the entry in bytes. - **dataType** (string) - The data type of the entry. - **preview** (string) - A preview of the data. #### Response Example (201) ```json { "success": true, "message": "Storage entry created.", "entry": { "id": "", "key": "73978994376e1f3e307914c4", "isFreeForAll": false, "hwid": "589401805431295092384985734", "valueId": "coins", "sizeBytes": 5, "dataType": "number", "preview": "25000" } } ``` #### Error Response (409) - **success** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the error. #### Response Example (409) ```json { "success": false, "message": "Storage entry already exists." } ``` ``` -------------------------------- ### Error Response: Missing Key or HWID Source: https://docs.luaprot.net/luaprot/api-documentation/storage.md This JSON object indicates an error when attempting to delete storage without providing a key or HWID. ```json { "success": false, "message": "Deleting storage requires a key or HWID." } ```