This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
taskmanager [2017/01/09 06:26] – [Creating a custom task type] mmoalt | taskmanager [2017/05/18 06:06] (current) – mmoalt | ||
---|---|---|---|
Line 132: | Line 132: | ||
Default: 0 (Disabled) | Default: 0 (Disabled) | ||
+ | **Reset cooldown: | ||
+ | Reset the currently active cooldown. Making the task available for running again.\\ | ||
+ | This button only appears if the task is currently on cooldown. | ||
**Radius: | **Radius: | ||
Line 191: | Line 194: | ||
path = false; -- Path to btree location | path = false; -- Path to btree location | ||
displayname = nil; -- Name visible in dropdowns (name by default) | displayname = nil; -- Name visible in dropdowns (name by default) | ||
+ | requireduration = false; -- Task type requires a duration | ||
+ | minduration = 0; -- Minimum duration for the task type. For tasks that need to have a certain duration. | ||
} | } | ||
| | ||
Line 210: | Line 215: | ||
**Controller functions: | **Controller functions: | ||
- | **:CanStart_TM(taskProperties, | + | **:CanTaskStart_TM(taskProperties, |
Return false to prevent starting the task. | Return false to prevent starting the task. | ||
- | **:CanRun_TM(taskProperties, | + | **:CanTaskRun_TM(taskProperties, |
Return false to end the task. | Return false to end the task. | ||
Line 226: | Line 231: | ||
**Events: | **Events: | ||
The controller supports custom events. You can call them from anywhere in your code.\\ | The controller supports custom events. You can call them from anywhere in your code.\\ | ||
+ | You can create an event handler in your controller by naming your function OnYourCustomEvent_TM. | ||
+ | Example:\\ | ||
+ | function my_controller.OnAttack_TM(instance, | ||
+ | | ||
+ | end | ||
+ | |||
+ | Then call it in your script with:\\ | ||
+ | activetask: | ||
+ | |||
Default events:\\ | Default events:\\ | ||
- | **.OnStart(instance)**\\ | + | **.OnStart_TM(instance)**\\ |
- | **.OnStop(instance)**\\ | + | **.OnStop_TM(instance)**\\ |
- | **.OnReset(instance)**\\ | + | **.OnReset_TM(instance)**\\ |
- | GW2 Events: | + | GW2 Events:\\ |
- | **.OnDeath(instance)**\\ | + | **.OnDeath_TM(instance)**\\ |
- | **.OnDowned(instance)**\\ | + | **.OnDowned_TM(instance)**\\ |
---- | ---- | ||
+ | All tasks that are currently running has a " | ||
+ | You can use this to check if your task/btree is running in the taskmanager. | ||
+ | |||
+ | ---- | ||
==== Adding profiles ==== | ==== Adding profiles ==== | ||
Load from file:\\ | Load from file:\\ | ||
Line 346: | Line 364: | ||
ml_task_mgr.GetPlayerPos = function to get the current player position | ml_task_mgr.GetPlayerPos = function to get the current player position | ||
ml_task_mgr.GetMapID = function to get the current map id | ml_task_mgr.GetMapID = function to get the current map id | ||
+ | ml_task_mgr.DrawBotProperties = function to draw bot specific task properties (optional) | ||
ml_task_mgr.GetMapName = function to get map name (optional) | ml_task_mgr.GetMapName = function to get map name (optional) | ||
ml_task_mgr.ValidProfileName = function to check profile name validity (optional) | ml_task_mgr.ValidProfileName = function to check profile name validity (optional) |