Jump to content

Droidz

Administrators
  • Posts

    12440
  • Joined

  • Last visited

Bug Report Comments posted by Droidz

  1. I have done a lot of research but don't understand why you have this error and how to fix it. Try to run on another computer (or on VM) with same internet providers (you can also try to change you IP if you can). If this doesn't works it is probably routeur problem. You can also try to use VPN or proxy.

  2. I won't back to old version of code (change was do 1 year ago).

    Current code:

            public static void BuyItem(string name, int number)
            {
                try
                {
                    Lua.LuaDoString($@"
    local n = '{name.Replace("'", @"\'")}'; 
    local q = {number}; 
    for i=1,100 do 
        local name, _, _, quantity = GetMerchantItemInfo(i) 
        if name and n==name then 
            if q > quantity then 
                q = quantity 
            end 
            BuyMerchantItem(i,q) 
        end 
    end");
                }
                catch (Exception e)
                {
                    Logging.WriteError("BuyItem(string name, int number): " + e);
                }
            }

    to get old code remove:

            if q > quantity then 
                q = quantity 
            end 

     

  3. hi,

    You need to call this method several time

                                    for (int i = 0; i < b.Quantity && b.NeedToBuy(); i++)
                                    {
                                        var qToBuy = b.Quantity - ItemsManager.GetItemCountByNameLUA(b.ItemName);
                                        if (qToBuy > MaxItemsQuantityToBuyByRequest)
                                            qToBuy = MaxItemsQuantityToBuyByRequest;
                                        Vendor.BuyItem(b.ItemName, qToBuy);
                                        Thread.Sleep(Usefuls.Latency + 400);
                                    }

     

  4. and code like:

    Engine lastEngine = null;
    robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState +=
        delegate(Engine engine, State state, CancelEventArgs cancelable)
        {
            try
            {
                if (engine == null || engine.States == null)
                    return;
    
                if (engine != lastEngine)
                {
                    if (engine.States.Any(s => s is Idle))
                    {
                        lastEngine = engine;
                        engine.AddState(new MyCustomState()); // or engine.States.Insert(X, new MyCustomState());
                        // cancelable.Cancel = true; ??
                    }
                }
            }
            catch { }
        };

     

×
×
  • Create New...