Beispiel #1
0
 private void restockExportListB_Click(object sender, EventArgs e)
 {
     if (restockListSelect.Text != String.Empty)
     {
         ImportExport.ExportRestock(restockListSelect.Text);
     }
     else
     {
         Restock.AddLog("Item list not selected!");
     }
 }
Beispiel #2
0
 private void restockRemoveListB_Click(object sender, EventArgs e)
 {
     if (restockListSelect.Text != String.Empty)
     {
         DialogResult dialogResult = MessageBox.Show("Are you sure to delete this Restock list: " + restockListSelect.Text, "Delete Restock List?", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             Restock.AddLog("Restock list " + restockListSelect.Text + " removed!");
             Restock.RestockSource      = 0;
             Restock.RestockDestination = 0;
             Restock.RestockDelay       = 100;
             Restock.RemoveList(restockListSelect.Text);
         }
     }
 }
Beispiel #3
0
        internal void RestockSetSource()
        {
            if (showagentmessageCheckBox.Checked)
            {
                Misc.SendMessage("Select Restock source bag", false);
            }

            if (restockListSelect.Text != String.Empty)
            {
                Targeting.OneTimeTarget(new Targeting.TargetResponseCallback(RestockSourceContainerTarget_Callback));
            }
            else
            {
                Restock.AddLog("Item list not selected!");
            }
        }
Beispiel #4
0
        internal void RestockStartExec()
        {
            if (World.Player == null)              // offline
            {
                Restock.AddLog("You are not logged in game!");
                return;
            }

            if (restockListSelect.Text == String.Empty)             // Nessuna lista
            {
                Restock.AddLog("Item list not selected!");
                return;
            }

            Restock.Start();
            Restock.AddLog("Restock Engine Start...");
            if (showagentmessageCheckBox.Checked)
            {
                Misc.SendMessage("RESTOCK: Engine Start...", false);
            }
            RestockStartWork();
        }
Beispiel #5
0
        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();
            });
        }