Control Module - Tasks - Stores tasks for each force.
-- import the module from the control modules
local Tasks = require 'modules.control.tasks'
-- To create a new task all you need is the name of the force you want to add the task to
-- you can give a place to add it but this is optional
Tasks.new_task('player')
-- You can then update this task to what ever value that you want
-- the task id is returned by new_task, or within an update handler
-- if a player name is not given that it will assume '<server>'
Tasks.update_task(task_id,'My number one task!','Cooldude2606')
-- You can then remove the task and all data linked with it
Tasks.remove_task(task_id)
-- set_editing and is_editing may be used to block other or provide warnings
-- none of this is enforced by this module and so you must do so in your own module
Tasks.set_editing(task_id,'Cooldude2606',true)
| expcore.store | Allows storing of task ids |
| utils.global | Allows storing in the global table |
| utils.token | Allows non conflicting task ids |
| get_task(task_id) | Gets the task stored at this id |
| get_details(task_id) | Gets the task details stored at this id |
| get_force_tasks(force_name) | Gets the task ids for a force |
| is_editing(task_id, player_name) | Gets if a player is currently editing this task |
| add_handler(callback) | Adds a new handler for when a task is updated |
| new_task(force_name[, task_number][, player_name]) | Adds a new task for a force, with option to place it in a certain order |
| remove_task(task_id) | Removes a task and all data linked with it |
| update_task(task_id, task[, player_name='server']) | Updates a task message |
| set_editing(task_id, player_name[, state]) | Sets a player to be editing this task, used with is_editing |
Allows storing of task ids
Allows storing in the global table
Allows non conflicting task ids
Gets the task stored at this id
Parameters:Gets the task details stored at this id
Parameters:Gets the task ids for a force
Parameters:Gets if a player is currently editing this task
Parameters:Adds a new handler for when a task is updated
Parameters:Adds a new task for a force, with option to place it in a certain order
Parameters:Removes a task and all data linked with it
Parameters: