Before your start using ECS you must register to it in your own script. But don't forget that ECS has to be already running when you try to register. If both your script and ECS are installed at the same time, your script will have to wait a few seconds before registering.
In any case you need to call this script : plugin.sk.ecs.register
It's called with one parameter. The parameter is an array and must filled as follow:
|00||Global variable to check to see if your plugin is enabled||string|
|01||Script to call when the ECS key is pressed||string|
|02||Restrict ECS Keyboard Shortcut to objects with this local variable set to TRUE||string|
|03||Restrict ECS Keyboard Shortcut to this RACE||var/race|
|04||Restrict ECS Keyboard Shortcut to this Object Class||var/class|
|05||Optional News System item count||null/number|
|06||Optional News System Name||null/string|
Indexes 02, 03, 04, 05, 06 can be null
the script will return [TRUE] if the plugin is registered correctly.
I will use Pirate Guild as an example here:
$setup = Array Alloc=7 $setup = 'anarkis.pirate.plugin' // ECS will check this global variable. $setup = 'anarkis.pirate.comm' // The ECS shortcut will call this script only... $setup = anarkis.pirate // ... if this local var is found ... $setup - Pirates // ... and this is pirate owned object ... $setup - null // ... we dont care about object class. $setup - 15 // The News System will store the 15 latest news $setup - 'Pirate Guild BBS' // title for the news system window's title $result = call script 'plugin.sk.ecs.register' setup = $setup
Done! Your plugin is registered to ECS ! And it was the hardest part.
When your script or plugin is uninstalled it has to unsubscribe from the ECS library using plugin.sk.ecs.unregister.
It needs only one parameter:
It will remove your script from ECS. The news system will be cleared and the hot-key disabled for this script.
$result = call script 'plugin.sk.ecs.unregister' plugin.id = 'anarkis.pirate.plugin'