예제 #1
0
        private void sellBagTarget_Callback(bool loc, Assistant.Serial serial, Assistant.Point3D pt, ushort itemid)
        {
            Assistant.Item sellBag = Assistant.World.FindItem(serial);

            if (sellBag == null)
            {
                return;
            }

            if (sellBag != null && sellBag.Serial.IsItem && sellBag.IsContainer && sellBag.RootContainer == Assistant.World.Player)
            {
                if (showagentmessageCheckBox.Checked)
                {
                    Misc.SendMessage("Container set to: " + sellBag.ToString(), false);
                }
                SellAgent.AddLog("Container set to: " + sellBag.ToString());
                SellAgent.SellBag = (int)sellBag.Serial.Value;
            }
            else
            {
                if (showagentmessageCheckBox.Checked)
                {
                    Misc.SendMessage("Invalid container, set backpack", false);
                }
                SellAgent.AddLog("Invalid container, set backpack");
                SellAgent.SellBag = (int)World.Player.Backpack.Serial.Value;
            }

            this.Invoke((MethodInvoker) delegate {
                RazorEnhanced.Settings.SellAgent.ListUpdate(sellListSelect.Text, serial, true);
                RazorEnhanced.SellAgent.RefreshLists();
            });
        }
예제 #2
0
        private void GridView_DragDrop(object sender, DragEventArgs e)
        {
            DataGridView grid        = (DataGridView)sender;
            Point        clientPoint = grid.PointToClient(new Point(e.X, e.Y));

            rowIndexOfItemUnderMouseToDrop = grid.HitTest(clientPoint.X, clientPoint.Y).RowIndex;

            if (rowIndexOfItemUnderMouseToDrop == -1)
            {
                return;
            }

            if (e.Effect == DragDropEffects.Move)
            {
                DataGridViewRow rowToMove = e.Data.GetData(typeof(DataGridViewRow)) as DataGridViewRow;

                if (rowIndexOfItemUnderMouseToDrop >= (grid.RowCount - 1))                 // Blocca il drag fuori dalle celle salvate
                {
                    return;
                }

                if (rowIndexFromMouseDown >= (grid.RowCount - 1))                 // Blocca il drag di una cella non salvata
                {
                    return;
                }

                grid.Rows.RemoveAt(rowIndexFromMouseDown);
                grid.Rows.Insert(rowIndexOfItemUnderMouseToDrop, rowToMove);
                switch (grid.Name)
                {
                case "autolootdataGridView":
                    AutoLoot.CopyTable();
                    break;

                case "scavengerdataGridView":
                    Scavenger.CopyTable();
                    break;

                case "organizerdataGridView":
                    Organizer.CopyTable();
                    break;

                case "vendorbuydataGridView":
                    BuyAgent.CopyTable();
                    break;

                case "vendorsellGridView":
                    SellAgent.CopyTable();
                    break;

                case "restockdataGridView":
                    Restock.CopyTable();
                    break;

                case "graphfilterdatagrid":
                    RazorEnhanced.Filters.CopyGraphTable();
                    break;
                }
            }
        }
예제 #3
0
        private void sellListSelect_SelectedIndexChanged(object sender, EventArgs e)
        {
            SellAgent.UpdateListParam(sellListSelect.Text);

            if (sellListSelect.Focused && sellListSelect.Text != String.Empty)
            {
                Settings.SellAgent.ListUpdate(sellListSelect.Text, RazorEnhanced.SellAgent.SellBag, true);
                SellAgent.AddLog("Sell Agent list changed to: " + sellListSelect.Text);
            }

            SellAgent.InitGrid();
        }
예제 #4
0
        private void GridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView grid = (DataGridView)sender;

            if (!grid.Focused)
            {
                return;
            }

            if (e.ColumnIndex == 0)             // Checkbox cambiate di stato genera save
            {
                switch (grid.Name)
                {
                case "autolootdataGridView":
                    AutoLoot.CopyTable();
                    break;

                case "scavengerdataGridView":
                    Scavenger.CopyTable();
                    break;

                case "organizerdataGridView":
                    Organizer.CopyTable();
                    break;

                case "vendorbuydataGridView":
                    BuyAgent.CopyTable();
                    break;

                case "vendorsellGridView":
                    SellAgent.CopyTable();
                    break;

                case "restockdataGridView":
                    Restock.CopyTable();
                    break;

                case "graphfilterdatagrid":
                    RazorEnhanced.Filters.CopyGraphTable();
                    break;

                case "journalfilterdatagrid":
                    RazorEnhanced.Filters.CopyJournalFilterTable();
                    break;
                }
            }
        }
예제 #5
0
        private void sellEnableCheck_CheckedChanged(object sender, EventArgs e)
        {
            if (World.Player == null)              // offline
            {
                if (sellEnableCheckBox.Checked)
                {
                    sellEnableCheckBox.Checked = false;
                    SellAgent.AddLog("You are not logged in game!");
                }
                return;
            }

            if (sellListSelect.Text == String.Empty)             // Nessuna lista
            {
                if (sellEnableCheckBox.Checked)
                {
                    sellEnableCheckBox.Checked = false;
                    SellAgent.AddLog("Item list not selected!");
                }
                return;
            }

            if (sellEnableCheckBox.Checked)
            {
                Assistant.Item bag = Assistant.World.FindItem(SellAgent.SellBag);

                if (bag != null && (bag.RootContainer != World.Player || !bag.IsContainer))
                {
                    SellAgent.AddLog("Invalid or not accessible Container!");
                    if (showagentmessageCheckBox.Checked)
                    {
                        Misc.SendMessage("Invalid or not accessible Container!", false);
                    }
                    sellEnableCheckBox.Checked = false;
                }
                else
                {
                    sellListSelect.Enabled       = false;
                    sellAddListButton.Enabled    = false;
                    sellRemoveListButton.Enabled = false;
                    sellImportListButton.Enabled = false;
                    sellExportListButton.Enabled = false;
                    sellCloneListButton.Enabled  = false;
                    SellAgent.AddLog("Apply item list " + sellListSelect.SelectedItem.ToString() + " filter ok!");
                    if (showagentmessageCheckBox.Checked)
                    {
                        Misc.SendMessage("Apply item list " + sellListSelect.SelectedItem.ToString() + " filter ok!", false);
                    }
                    SellAgent.EnableSellFilter();
                }
            }
            else
            {
                sellListSelect.Enabled       = true;
                sellAddListButton.Enabled    = true;
                sellRemoveListButton.Enabled = true;
                sellImportListButton.Enabled = true;
                sellExportListButton.Enabled = true;
                sellCloneListButton.Enabled  = true;
                if (sellListSelect.Text != String.Empty)
                {
                    RazorEnhanced.SellAgent.AddLog("Remove item list " + sellListSelect.SelectedItem.ToString() + " filter ok!");
                    if (showagentmessageCheckBox.Checked)
                    {
                        RazorEnhanced.Misc.SendMessage("Remove item list " + sellListSelect.SelectedItem.ToString() + " filter ok!", false);
                    }
                }
            }
        }
예제 #6
0
        private void EnhancedAgentAddList_Click(object sender, EventArgs e)
        {
            bool   fail    = false;
            string newList = "";

            if (AgentListToAdd.Text == "")
            {
                fail = true;
            }

            if (!Regex.IsMatch(AgentListToAdd.Text, "^[a-zA-Z0-9_]+$"))
            {
                fail = true;
            }

            newList = AgentListToAdd.Text.ToLower();

            switch (m_agentid)
            {
            case 1:
                if (Settings.AutoLoot.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 2:
                if (Settings.Scavenger.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 3:
                if (Settings.Organizer.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 4:
                if (Settings.BuyAgent.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 5:
                if (Settings.SellAgent.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 6:
                if (Settings.Dress.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 7:
                if (Settings.Friend.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 8:
                if (Settings.Restock.ListExists(newList))
                {
                    fail = true;
                }
                break;

            case 9:
                if (RazorEnhanced.Shard.Exists(newList))
                {
                    fail = true;
                }
                break;
            }


            if (fail)
            {
                MessageBox.Show("Invalid list name!",
                                "Invalid list name!",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Exclamation,
                                MessageBoxDefaultButton.Button1);
                fail = true;
            }
            else
            {
                switch (m_agentid)
                {
                case 1:
                    AutoLoot.AddList(newList);
                    break;

                case 2:
                    Scavenger.AddList(newList);
                    break;

                case 3:
                    Organizer.AddList(newList);
                    break;

                case 4:
                    BuyAgent.AddList(newList);
                    break;

                case 5:
                    SellAgent.AddList(newList);
                    break;

                case 6:
                    Dress.AddList(newList);
                    HotKey.Init();
                    break;

                case 7:
                    Friend.AddList(newList);
                    break;

                case 8:
                    Restock.AddList(newList);
                    break;

                case 9:
                    RazorEnhanced.Shard.Insert(newList, "Not set", "Not Set", "0.0.0.0", "0", false, false);
                    break;
                }

                Close();
            }
        }