Difference between revisions of "Plugins"
From Zenbot Wiki
Views
Actions
Namespaces
Variants
Tools
| Line 2: | Line 2: | ||
==== Content ==== | ==== Content ==== | ||
A plugin is defined as a folder, or | A plugin is defined as a folder, or [encrypted] archive that contains the following: | ||
===== | ===== header.lua <code>[required]</code> ===== | ||
- id | |||
the unique identifier for this plugin | |||
- name | - name | ||
this will get displayed in | this will get displayed in menu | ||
- description | |||
this will get displayed in menu as tooltip | |||
- description | |||
this will get displayed in | |||
- icon [optional] | - icon [optional] | ||
this will get displayed in menu | this will get displayed in menu | ||
| Line 19: | Line 16: | ||
- required | - required | ||
plugin needs those libraries to work and will not load if one or more is missing/not available | plugin needs those libraries to work and will not load if one or more is missing/not available | ||
example: { " | example: { "SomeOrbwalkerLib", "SomeHealthPredictionLib" } | ||
- optional | - optional | ||
plugin integrates those libraries but will load regardless if they are missing/not available | plugin integrates those libraries but will load regardless if they are missing/not available | ||
example: { "? | example: { "? SomeEvadeLib" } | ||
- conflicts | - conflicts | ||
plugin cannot work if one or more of those is loaded, plugin will not load if they are loaded | plugin cannot work if one or more of those is loaded, plugin will not load if they are loaded | ||
example: { "! | example: { "! SomeAatroxPlugin" } | ||
- library [optional] | - library [optional] | ||
boolean to indicate if submodules should be loadable outside of this plugin | boolean to indicate if submodules should be loadable outside of this plugin | ||
- load [optional] | - load [optional] | ||
(lambda) function returning a boolean that indicates if the plugin should show up ingame | (lambda) function returning a boolean that indicates if the plugin should show up ingame | ||
function() return | function() return player.charName == "Aatrox" end | ||
`player.charName == 'Aatrox'` | |||
- encrypt [optional] | |||
table containing every single file to be added to the encrypted file | |||
- | encrypt = { -- main.lua and header.lua can be omitted | ||
- | "menu", -- //scripts//yourfolder//menu.lua | ||
- | "logic", -- //scripts//yourfolder//logic.lua | ||
"sprite.png" -- //scripts//yourfolder//sprite.png | |||
} | |||
strip [optional] | |||
boolean to indicate if debug information should be omitted, increases security but removes any error information | |||
===== thumbnail.png <code>[optional]</code> ===== | ===== thumbnail.png <code>[optional]</code> ===== | ||
- this will get displayed in loader/menu | - this will get displayed in loader/menu | ||
===== main.lua <code>[required]</code> ===== | ===== main.lua <code>[required]</code> ===== | ||
| Line 50: | Line 46: | ||
==== Example ==== | ==== Example ==== | ||
header.lua: | |||
<pre> | <pre> | ||
return { | return { | ||
id = " | id = "my_plugin_id", | ||
name = "My Plugin", | name = "My Plugin", | ||
dependencies = { | dependencies = { | ||
" | "some_ts_lib_id", -- required | ||
"? | "? some_pred_lib_id", -- optional | ||
"! | "! some_other_plugin" -- conflicts | ||
}, | }, | ||
load = `()=> | load = `()=> player.charName == "Aatrox"` | ||
} | } | ||
</pre> | </pre> | ||
=== Loading/Importing === | === Loading/Importing === | ||
==== Importing Plugins ==== | ==== Importing Plugins ==== | ||
Libraries and internals can be loaded by using module api | Libraries and internals can be loaded by using module api | ||
local | local mylib = module.lib("mylib") | ||
or | or | ||
local mymenu = module.load(header.id, "menu") | |||
local | local mylib_maybe = module.seek("mylib") | ||
or | or | ||
local orb = module.internal("orb") | |||
Revision as of 15:42, 1 April 2023
Definition
Content
A plugin is defined as a folder, or [encrypted] archive that contains the following:
header.lua [required]
- id
the unique identifier for this plugin
- name
this will get displayed in menu
- description
this will get displayed in menu as tooltip
- icon [optional]
this will get displayed in menu
- dependencies [optional]
- required
plugin needs those libraries to work and will not load if one or more is missing/not available
example: { "SomeOrbwalkerLib", "SomeHealthPredictionLib" }
- optional
plugin integrates those libraries but will load regardless if they are missing/not available
example: { "? SomeEvadeLib" }
- conflicts
plugin cannot work if one or more of those is loaded, plugin will not load if they are loaded
example: { "! SomeAatroxPlugin" }
- library [optional]
boolean to indicate if submodules should be loadable outside of this plugin
- load [optional]
(lambda) function returning a boolean that indicates if the plugin should show up ingame
function() return player.charName == "Aatrox" end
`player.charName == 'Aatrox'`
- encrypt [optional]
table containing every single file to be added to the encrypted file
encrypt = { -- main.lua and header.lua can be omitted
"menu", -- //scripts//yourfolder//menu.lua
"logic", -- //scripts//yourfolder//logic.lua
"sprite.png" -- //scripts//yourfolder//sprite.png
}
strip [optional]
boolean to indicate if debug information should be omitted, increases security but removes any error information
thumbnail.png [optional]
- this will get displayed in loader/menu
main.lua [required]
- this is the entry to your plugin
Example
header.lua:
return {
id = "my_plugin_id",
name = "My Plugin",
dependencies = {
"some_ts_lib_id", -- required
"? some_pred_lib_id", -- optional
"! some_other_plugin" -- conflicts
},
load = `()=> player.charName == "Aatrox"`
}
Loading/Importing
Importing Plugins
Libraries and internals can be loaded by using module api
local mylib = module.lib("mylib")
or
local mymenu = module.load(header.id, "menu")
local mylib_maybe = module.seek("mylib")
or
local orb = module.internal("orb")