# Documentation for *TaskRequester* ## Overview Tha TaskRequester class helps manage drone [TaskRequests](LuaFunctionDoc_TaskRequest.md.html).
## Parent classes * [BaseBuilding](LuaFunctionDoc_BaseBuilding.md.html) * [CObject](LuaFunctionDoc_CObject.md.html) * ColorizableObject * FXObject * Holder * InitDone * [Object](LuaFunctionDoc_Object.md.html) * PropertyObject * SyncObject * WaypointsObj ## AddDemandRequest Creates a [TaskRequest](LuaFunctionDoc_TaskRequest.md.html) with the given properties, and adds it to the task_requests table so it is visible to DroneControl objects. The building needs to re-connect to DroneControl objects if the state of the task_requests table changes. Alternatively, requests may be created before connecting, in the CreateTaskRequests callback for example. This function creates a demand request and automatically adds the flags designating it as such.

bool **AddDemandRequest**(string resource, int amount[, int flags, int max_units]) string resource : Resource id for this request. For resource request this is the string id of any resource defined in the Resources Lua table. int amount : The amount of resource this request represents. int flags : Optional. The flags of the request. The flags rfPostInQueue and rfDemand are automatically added to demand requests created with this function. int max_units : Optional. The max number of drones that can do this request simultaneously. _returns_ TaskRequest result : The created request. ## AddSupplyRequest Creates a [TaskRequest](LuaFunctionDoc_TaskRequest.md.html) with the given properties, and adds it to the task_requests table so it is visible to DroneControl objects. The building needs to re-connect to DroneControl objects if the state of the task_requests table changes. Alternatively, requests may be created before connecting, in the CreateTaskRequests callback for example. This function creates a supply request and automatically adds the flags designating it as such.

bool **AddSupplyRequest**(string resource, int amount[, int flags, int max_units]) string resource : Resource id for this request. For resource request this is the string id of any resource defined in the Resources Lua table. int amount : The amount of resource this request represents. int flags : Optional. The flags of the request. The flags rfPostInQueue and rfSupply are automatically added to demand requests created with this function. int max_units : Optional. The max number of drones that can do this request simultaneously. _returns_ TaskRequest result : The created request. ## AddWorkRequest Creates a [TaskRequest](LuaFunctionDoc_TaskRequest.md.html) with the given properties, and adds it to the task_requests table so it is visible to DroneControl objects. The building needs to re-connect to DroneControl objects if the state of the task_requests table changes. Alternatively, requests may be created before connecting, in the CreateTaskRequests callback for example. This function creates a work request and automatically adds the flags designating it as such.

TaskRequest **AddWorkRequest**(string resource, int amount[, int flags, int max_units]) string resource : Resource id for this request. For a work request this can be any string, such as "clean", "repair", etc. int amount : The amount of work the drone has to do to finish this request. Drones do about 5000 work per second, defined by DroneResourceUnits.repair. int flags : Optional. The flags of the request. The flags rfPostInQueue and rfWork are automatically added to work requests created with this function. int max_units : Optional. The max number of drones that can do this request simultaneously. _returns_ TaskRequest result : The created request. ## CreateResourceRequests TaskRequester callback called in the object's game init thread. Useful for initializing the object's [TaskRequests](LuaFunctionDoc_TaskRequest.md.html).

void **CreateResourceRequests**() (insert footer.md.html here)