private void restockDragDelay_Leave(object sender, EventArgs e) { if (restockDragDelay.Text == String.Empty) { restockDragDelay.Text = "100"; } Restock.RestockDelay = Convert.ToInt32(restockDragDelay.Text); Settings.Restock.ListUpdate(restockListSelect.Text, Restock.RestockDelay, Restock.RestockSource, Restock.RestockDestination, true); Restock.RefreshLists(); }
private void RestockDestinationContainerTarget_Callback(bool loc, Assistant.Serial serial, Assistant.Point3D pt, ushort itemid) { Assistant.Item restockBag = Assistant.World.FindItem((Assistant.Serial)((uint)serial)); if (restockBag == null) { if (showagentmessageCheckBox.Checked) { Misc.SendMessage("Invalid Destination Container, set backpack", false); } Restock.AddLog("Invalid Destination Container, set backpack"); Restock.RestockDestination = (int)World.Player.Backpack.Serial.Value; return; } if (restockBag != null && restockBag.Serial.IsItem && restockBag.IsContainer) { if (showagentmessageCheckBox.Checked) { Misc.SendMessage("Destination Container set to: " + restockBag.ToString(), false); } Restock.AddLog("Destination Container set to: " + restockBag.ToString()); Restock.RestockDestination = (int)restockBag.Serial.Value; } else { if (showagentmessageCheckBox.Checked) { Misc.SendMessage("Invalid Destination Container, set backpack", false); } Restock.AddLog("Invalid Destination Container, set backpack"); Restock.RestockDestination = (int)World.Player.Backpack.Serial.Value; } this.Invoke((MethodInvoker) delegate { Settings.Restock.ListUpdate(restockListSelect.Text, Restock.RestockDelay, Restock.RestockSource, serial, true); Restock.RefreshLists(); }); }