LoadRemotePackage
The LoadRemotePackage function is designed to load a .ghost package file located on a remote server. A .ghost package file is a collection of .lua files that have been converted into a single .ghost package file. This function is extremely useful for large projects with multiple files that need to be loaded together.
To create a .ghost package file, please see the API in the File / HTTP docs.
Parameters
url: The URL of the remote server where the.ghostpackage file is located.data: A table containing the data to be sent in the request.headers: A table containing the HTTP headers to be included in the request.
Example Usage in Lua
Here is an example of how to use the LoadRemotePackage function in Lua:
local api = ...
local http_headers = {
["API-KEY"] = "foo",
["X-Some-Header"] = "bar",
}
local data_send = {
username = "John Doe",
password = "password",
authkey = "12345",
auth_key = "12345",
key = "exampleKey123",
spec = "protection",
class = "warrior"
}
-- Remote Package loading function
print('Loading remote package file.')
local url = "https://myCoolBot.com/file_request"
api.LoadRemotePackage(url, data_send, http_headers)