Beispiel #1
0
    public static void CollectItem()
    {
        bool TemItem = false, TemEspaço = false;

        // Previni erros
        if (Tools.CurrentWindow != Tools.Windows.Jogo)
        {
            return;
        }

        // Check if you have any items in the coordinates
        for (byte i = 1; i <= Lists.Map.Temp_Item.GetUpperBound(0); i++)
        {
            if (Lists.Map.Temp_Item[i].X == Eu.X && Lists.Map.Temp_Item[i].Y == Eu.Y)
            {
                TemItem = true;
            }
        }

        // Verifica se tem algum espaço vazio no Inventory
        for (byte i = 1; i <= Jogo.Max_Inventory; i++)
        {
            if (Inventory[i].Item_Num == 0)
            {
                TemEspaço = true;
            }
        }

        // Somente se necessário
        if (!TemItem)
        {
            return;
        }
        if (!TemEspaço)
        {
            return;
        }
        if (Environment.TickCount <= Eu.Coletar_Time + 250)
        {
            return;
        }
        if (Panels.Locate("Chat").Geral.Visible)
        {
            return;
        }

        // Coleta o item
        Sending.CollectItem();
        Eu.Coletar_Time = Environment.TickCount;
    }