Open jkhoel opened 5 years ago
Example:
AtoTaskDispatcher("CAS", "IN SUPPORT OF TF SWORD, CONTACT JTAC WARLOC ON PURPLE12. EXPECTED TARGETS: LAVs AND INFANTRY", [1234,1234,0]
AtoDispatcher:createTask("CAS", "IN SUPPORT OF TF SWORD, CONTACT JTAC WARLOC ON PURPLE12. EXPECTED TARGETS: LAVs AND INFANTRY", [1234,1234,0])
Would probably be more correct in terms of LUA.
The function should return the task id or perhaps a task object for later reference:
AtoDispatcher:getTask(taskID) returns type, desc, coords
AtoDispatcher:updateTask(taskID, description, coords) returns the HTTPrequest code or nil
AtoDispatcher:deleteTask(taskID) returns the HTTPrequest code or nil
Definitely a good idea. No idea about writing a class, i'm just a hack. But this is definitely a reusable piece of code that would be a key component going forward.
I think it will be a good idea to write a wrapper that can be used in the various scripts whenever one wants to create a new mission on the ATO.
It should be something like this:
Where the Type would have to match a type in the list_missiontypes database list, Description would be a free line of text and Coordinates would be an optional array of XYZ coords.
The wrapper should then send the required formatted HTTP request to the API endpoint so that a new task will be created on the ATO for the next cycle