BattleNet.ClientlessBot.PickItems C# (CSharp) Method

PickItems() public method

public PickItems ( ) : void
return void
        public virtual void PickItems()
        {
            var picking_items = (from i in BotGameData.Items
                                 where i.Value.ground select i.Value);

            lock (m_itemListLock)
            {
                foreach (var i in picking_items)
                {
                    if(i.type != "mp5" && i.type != "hp5" && i.type != "gld" && i.type != "rvl" && i.quality > Item.QualityType.normal)
                        Console.WriteLine("{0}: {1}, {2}, Ethereal:{3}, {4}", i.name, i.type, i.quality, i.ethereal, i.sockets);
                }
                try
                {
                    foreach (var i in picking_items)
                    {
                        if (!Pickit.PickitMap.ContainsKey(i.type))
                            continue;
                        if (BotGameData.Belt.m_items.Count >= 16 && i.type == "rvl")
                            continue;
                        if (Pickit.PickitMap[i.type](i))
                        {
                            if(i.type != "gld" && i.type != "rvl")
                            {
                                Console.WriteLine("Picking up Item!");
                                Console.WriteLine("{0}: {1}, {2}, Ethereal:{3}, {4}", i.name, i.type, i.quality, i.ethereal, i.sockets);
                            }
                            SwitchSkill(0x36);
                            Thread.Sleep(200);
                            CastOnCoord((ushort)i.x, (ushort)i.y);
                            Thread.Sleep(400);
                            byte[] tempa = { 0x04, 0x00, 0x00, 0x00 };
                            SendPacket(0x16, tempa, BitConverter.GetBytes((Int32)i.id), GenericServer.nulls);
                            Thread.Sleep(500);
                            if (i.type != "rvl" && i.type != "gld")
                            {
                                using (StreamWriter sw = File.AppendText("log.txt"))
                                {
                                    sw.WriteLine("{6} [{5}] {0}: {1}, {2}, Ethereal:{3}, {4}", i.name, i.type, i.quality, i.ethereal, i.sockets == uint.MaxValue ? 0 : i.sockets, Account, DateTime.Today.ToShortTimeString());
                                }
                            }
                        }
                    }
                }
                catch
                {
                    Console.WriteLine("Failed to pickup items, something bad happened");
                }
            }
        }