コード例 #1
0
ファイル: Cavebot.cs プロジェクト: uvbs/bot-2016
 void Cavebot_LootRemoved(Modules.Cavebot.Loot Loot)
 {
     foreach (DataGridViewRow row in datagridviewLooting.Rows)
     {
         if (ushort.Parse(row.Cells[0].Value.ToString()) == Loot.ID &&
             uint.Parse(row.Cells[1].Value.ToString()) == Loot.Cap)
         {
             datagridviewLooting.Rows.Remove(row);
             break;
         }
     }
 }
コード例 #2
0
ファイル: Cavebot.cs プロジェクト: uvbs/bot-2016
        private void btnLootingAdd_Click(object sender, EventArgs e)
        {
            if (comboboxLootingDestination.Text == string.Empty)
            {
                return;
            }
            bool found = false;

            foreach (Modules.Cavebot.Loot l in this.Client.Modules.Cavebot.GetLoot())
            {
                if (l.ID == (ushort)numericLootingItemID.Value)
                {
                    found = true; break;
                }
            }
            if (found)
            {
                return;
            }

            Modules.Cavebot.Loot.Destinations destination = Modules.Cavebot.Loot.Destinations.Ground;
            byte index = 0;

            switch (comboboxLootingDestination.Text.ToLower())
            {
            case "ground":
                destination = Modules.Cavebot.Loot.Destinations.Ground;
                break;

            default:
                destination = Modules.Cavebot.Loot.Destinations.EmptyContainer;
                index       = byte.Parse(comboboxLootingDestination.Text[1].ToString());
                break;
            }

            Modules.Cavebot.Loot newLoot = new Modules.Cavebot.Loot((ushort)numericLootingItemID.Value,
                                                                    string.Empty, (ushort)numericLootingMinCapacity.Value, destination, index);
            this.Client.Modules.Cavebot.AddLoot(newLoot);
        }
コード例 #3
0
ファイル: Cavebot.cs プロジェクト: KyLuaa/bot
        private void btnLootingAdd_Click(object sender, EventArgs e)
        {
            if (comboboxLootingDestination.Text == string.Empty) return;
            bool found = false;
            foreach (Modules.Cavebot.Loot l in this.Client.Modules.Cavebot.GetLoot())
            {
                if (l.ID == (ushort)numericLootingItemID.Value) { found = true; break; }
            }
            if (found) return;

            Modules.Cavebot.Loot.Destinations destination = Modules.Cavebot.Loot.Destinations.Ground;
            byte index = 0;
            switch (comboboxLootingDestination.Text.ToLower())
            {
                case "ground":
                    destination = Modules.Cavebot.Loot.Destinations.Ground;
                    break;
                default:
                    destination = Modules.Cavebot.Loot.Destinations.EmptyContainer;
                    index = byte.Parse(comboboxLootingDestination.Text[1].ToString());
                    break;
            }

            Modules.Cavebot.Loot newLoot = new Modules.Cavebot.Loot((ushort)numericLootingItemID.Value,
                string.Empty, (ushort)numericLootingMinCapacity.Value, destination, index);
            this.Client.Modules.Cavebot.AddLoot(newLoot);
        }
コード例 #4
0
ファイル: Cavebot.cs プロジェクト: uvbs/bot-2016
 void Cavebot_LootAdded(Modules.Cavebot.Loot Loot)
 {
     datagridviewLooting.Rows.Add(Loot.ID, Loot.Cap, Loot.Destination);
 }