/// <summary>
/// Update an existing script in an task Inventory
/// </summary>
/// <param name="data">A byte[] array containing the encoded scripts contents</param>
/// <param name="itemID">the itemID of the script</param>
/// <param name="taskID">UUID of the prim containting the script</param>
/// <param name="mono">if true, sets the script content to run on the mono interpreter</param>
/// <param name="running">if true, sets the script to running</param>
/// <param name="callback"></param>
public void RequestUpdateScriptTask(byte[] data, UUID itemID, UUID taskID, bool mono, bool running, ScriptUpdatedCallback callback)
{
Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("UpdateScriptTask");
if (url != null)
{
UpdateScriptTaskUpdateMessage msg = new UpdateScriptTaskUpdateMessage();
msg.ItemID = itemID;
msg.TaskID = taskID;
msg.ScriptRunning = running;
msg.Target = mono ? "mono" : "lsl2";
CapsClient request = new CapsClient(url);
request.OnComplete += new CapsClient.CompleteCallback(UpdateScriptAgentInventoryResponse);
request.UserData = new object[2] { new KeyValuePair<ScriptUpdatedCallback, byte[]>(callback, data), itemID };
request.BeginGetResponse(msg.Serialize(), OSDFormat.Xml, Client.Settings.CAPS_TIMEOUT);
}
else
{
throw new Exception("UpdateScriptTask capability is not currently available");
}
}