This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| minionlib [2018/06/21 09:53] – fxfire | minionlib [2021/04/30 18:13] (current) – ace | ||
|---|---|---|---|
| Line 88: | Line 88: | ||
| *Queues and Fires the Event with 1-n arguments. Eventname and arguments need to be strings. | *Queues and Fires the Event with 1-n arguments. Eventname and arguments need to be strings. | ||
| *Use RegisterEventHandler(" | *Use RegisterEventHandler(" | ||
| + | *Requires at least 1 argument, even if it's a blank string. (ex. QueueEvent(" | ||
| Line 219: | Line 220: | ||
| + | |||
| + | ==Structure== | ||
| + | |||
| + | The minion is layered into 3 distinct parts, components, members, and submembers. | ||
| + | |||
| + | All components must have a header and (optionally) members, which are displayed when the header is clicked (and the menu is open).\\ | ||
| + | All component headers require the following properties: **//bool// '' | ||
| + | All component headers optionally contain the following properties: **// | ||
| + | |||
| + | Members are displayed below their component containers, and they represent the rows that appear directly below the header.\\ | ||
| + | Members may optionally contain submembers.\\ | ||
| + | All members require the following properties: **// | ||
| + | All members optionally contain the following properties: **// | ||
| + | |||
| + | Submembers are displayed to the right and grow vertically downward. | ||
| + | Submembers will be sorted in alphabetical order by name if the **'' | ||
| + | All submembers require the following properties: **// | ||
| + | All submembers optionally contain the following properties: **// | ||
| + | |||
| + | ==API== | ||
| + | |||
| + | ***'' | ||
| + | ***'' | ||
| + | ***'' | ||
| + | |||
| + | |||
| + | ===HTTPRequest=== | ||
| + | Use this function to do any kind of asynchronous http calls. Example: | ||
| + | |||
| + | <code lua> | ||
| + | function SendHttpRequest() | ||
| + | local function success(str, | ||
| + | d(" | ||
| + | d(" | ||
| + | d(" | ||
| + | |||
| + | local data = json.decode(str) | ||
| + | if data then | ||
| + | | ||
| + | | ||
| + | end | ||
| + | | ||
| + | local function HeadersTable(header) | ||
| + | if type(header) == " | ||
| + | header = string.match(header," | ||
| + | local tbl = {} | ||
| + | for w in header: | ||
| + | local k,v = string.match(w," | ||
| + | | ||
| + | end | ||
| + | table.print(tbl) | ||
| + | return tbl | ||
| + | end | ||
| + | end | ||
| + | | ||
| + | header = HeadersTable(header) -- if you want to convert the header string to a table | ||
| + | end | ||
| + | |||
| + | local function failed(error, | ||
| + | d(" | ||
| + | d(" | ||
| + | d(" | ||
| + | end | ||
| + | |||
| + | local params = { | ||
| + | host = " | ||
| + | path = "/ | ||
| + | port = 443, | ||
| + | method = " | ||
| + | https = true, | ||
| + | onsuccess = success, | ||
| + | onfailure = failed, | ||
| + | getheaders = true, --true will return the headers, if you dont need it you can leave this at nil | ||
| + | body = "", | ||
| + | headers = {}, --optional, if not required for your call can be nil or "" | ||
| + | } | ||
| + | |||
| + | | ||
| + | end | ||
| + | </ | ||