Jump to content

Sakonung

WRobot user
  • Posts

    55
  • Joined

  • Last visited

Posts posted by Sakonung

  1. Да, та же проблема. Явно какой-то детект идёт, но я пока не знаю какой. В последний раз, такое было, когда они вынесли в отдельный детектр CastByName, CastBySpell и добавили туда RunMacroPlugin. 

    Сейчас явно другое, так как отбаны идут тех, что выключены и иногда не могу понять, что именно смотрят.

  2. Мужики, кто ботит на сирусе. Подскажите, как у вас с банами? У меня баны идут даже на аккаунты, что выключены. Хотелось бы узнать, это я один такой или сирус решили бороться с ботами максимально? 

  3. I think you just don't delete the desires NPC. Anyway, you can try this. 

    1. Open your grind profile using the profile creator
    2. After that, open in your profile windows NPC 
    3. Add your NPC in profile, using profile creator's tools.
    4. Choice type of vendors like Vendors/Repair
    5. When it done. Save you profle.
    6. Open window with global setting and turn on option "Use only NPC of the profile". 
    7. Start your profile and check, solve your problem or not. 

    It should help you. 

  4. Hello, in general, the essence is. That I am trying to write some plugin, which should freeze the bot when players appear nearby (it is important to not take a pause, namely stop bot, don't move). The problem is that even if I use the option with the waiting cycle of Thread.sleep (1000);
    The bot still ignores this and moves along the route to collect. 

    I tried to use different methods, but it does not help. Is it possible somehow, during the Gatherer profile, stop the bot without pause?

    @Droidz I need help, because only you know, how Wrobot working... How I understood, Gatherer have high priority and if bot is not pause, it's moving along the route. Maybe is there way to stop this?  

  5. Hello, I'm trying do a simple plugin, which will auto buying food/water, because in my server (RU) don't work plugins, that already there are. So, can someone check my code and say, where did I mistakes? Because VS got me too many errors.

    I have to say, so I'm not C# programmer, I'm most of specalization on JS, and because of that, I can do many errors, I'm trying used for solve their ChatGPT, but it don't helping so much, so I need people's help. 

    My code:

     

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using wManager.Wow.Helpers;
    using wManager.Wow.ObjectManager;
    using wManager.Plugin;
    using robotManager.Helpful;
    using robotManager.Products;
    using wManager.Wow.Enums;

    public class FoodWaterPlugin : IPlugin
    {
        private readonly List<ItemInfo> foodItems = new List<ItemInfo>
        {
            new ItemInfo(4540, 1, 5),
            new ItemInfo(4541, 5, 15),
            new ItemInfo(4542, 10, 20),
            new ItemInfo(4544, 15, 25),
            new ItemInfo(4601, 20, 30),
            new ItemInfo(8950, 25, 35),
            new ItemInfo(8076, 30, 40),
            new ItemInfo(4599, 35, 45),
            new ItemInfo(2287, 40, 50),
            new ItemInfo(8952, 45, 55),
            new ItemInfo(2679, 50, 60),
            new ItemInfo(2680, 55, 65),
            new ItemInfo(2681, 60, 70),
            new ItemInfo(2682, 65, 75),
            new ItemInfo(2684, 70, 75),
            new ItemInfo(2687, 75, 80),
            new ItemInfo(2683, 80, 80),
            new ItemInfo(2681, 55, 60),
            new ItemInfo(2685, 60, 65),
            new ItemInfo(3727, 65, 70),
            new ItemInfo(3726, 70, 75),
            new ItemInfo(3728, 75, 80),
            new ItemInfo(4594, 80, 80)
        };

        private readonly List<ItemInfo> waterItems = new List<ItemInfo>
        {
            new ItemInfo(159, 1, 5),
            new ItemInfo(1179, 5, 15),
            new ItemInfo(1205, 15, 25),
            new ItemInfo(1708, 25, 35),
            new ItemInfo(1645, 35, 45),
            new ItemInfo(8766, 45, 55),
            new ItemInfo(28399, 55, 65),
            new ItemInfo(33044, 65, 75),
            new ItemInfo(27860, 75, 80),
            new ItemInfo(33445, 80, 80),
            new ItemInfo(3356, 10, 20),
            new ItemInfo(2287, 20, 30),
            new ItemInfo(27422, 30, 40),
            new ItemInfo(33176, 40, 50),
            new ItemInfo(33177, 50, 60),
            new ItemInfo(33178, 60, 70),
            new ItemInfo(33179, 70, 80),
            new ItemInfo(33180, 80, 80),
            new ItemInfo(40731, 80, 80),
            new ItemInfo(19999, 40, 50),
            new ItemInfo(5469, 15, 25),
            new ItemInfo(13923, 30, 40),
            new ItemInfo(13443, 60, 70)
        };

        public void Initialize()
        {
            Logging.Write("[FoodWaterPlugin] Initialized.");
            EventsLua.AttachEventLua("UNIT_SPELLCAST_SUCCEEDED", (s, e) => OnSpellCastSucceeded(s, e));
            CheckAndBuyFoodWater();
        }

        public void Dispose()
        {
            Logging.Write("[FoodWaterPlugin] Disposed.");
            EventsLua.DetachEventLua("UNIT_SPELLCAST_SUCCEEDED", (s, e) => OnSpellCastSucceeded(s, e));
        }

        public void Settings()
        {
        }

        private void OnSpellCastSucceeded(string luaEvent, List<string> args)
        {
            if (args[0] == "player")
            {
                CheckAndBuyFoodWater();
            }
        }

        private void CheckAndBuyFoodWater()
        {
            if (ObjectManager.Me.IsDead || ObjectManager.Me.InCombatFlagOnly)
                return;

            int foodCount = GetItemCount(GetBestFood());
            int waterCount = GetItemCount(GetBestWater());

            if (foodCount < 5 || waterCount < 5)
            {
                GoToVendorAndBuy();
            }
        }

        private uint GetBestFood()
        {
            int playerLevel = ObjectManager.Me.Level;
            return foodItems.Where(item => item.MinLevel <= playerLevel && item.MaxLevel >= playerLevel)
                            .OrderByDescending(item => item.MinLevel)
                            .Select(item => item.Entry)
                            .FirstOrDefault();
        }

        private uint GetBestWater()
        {
            int playerLevel = ObjectManager.Me.Level;
            return waterItems.Where(item => item.MinLevel <= playerLevel && item.MaxLevel >= playerLevel)
                             .OrderByDescending(item => item.MinLevel)
                             .Select(item => item.Entry)
                             .FirstOrDefault();
        }

        private int GetItemCount(uint itemId)
        {
            return ItemsManager.GetItemCountByIdLUA((int)itemId);
        }

        private void GoToVendorAndBuy()
        {
            // Ищем ближайшего вендора
            WoWUnit vendor = ObjectManager.GetNearestWoWUnit(ObjectManager.GetWoWUnitVendor()).FirstOrDefault();
            if (vendor != null)
            {
                // Идем к вендору и покупаем
                MovementManager.Go(PathFinder.FindPath(vendor.Position));
                vendor.Target();
                Interact.InteractGameObject(vendor.GetBaseAddress);
                Lua.LuaDoString($"BuyItem({GetBestFood()}, 20)");
                Lua.LuaDoString($"BuyItem({GetBestWater()}, 20)");
                AddToDoNotSell(GetBestFood().ToString());
                AddToDoNotSell(GetBestWater().ToString());
            }
        }

        private void AddToDoNotSell(string itemId)
        {
            if (!ItemsManager.GetDoNotSellList().Contains(itemId))
            {
                ItemsManager.GetDoNotSellList().Add(itemId);
            }
        }

        private void RemoveFromDoNotSell(string itemId)
        {
            if (ItemsManager.GetDoNotSellList().Contains(itemId))
            {
                ItemsManager.GetDoNotSellList().Remove(itemId);
            }
        }

        private class ItemInfo
        {
            public uint Entry { get; }
            public int MinLevel { get; }
            public int MaxLevel { get; }

            public ItemInfo(uint entry, int minLevel, int maxLevel)
            {
                Entry = entry;
                MinLevel = minLevel;
                MaxLevel = maxLevel;
            }
        }
    }



    I'm trying do a little database with item, which bot have to buy, when they're gone, also add to plugin check my lvl and check lvl item, swap then when he's had bigger lvl, also add food/drinks to don't sell list and delete then they become low lvl. 

    I hope for your help, if you help me with this, I upload this plugin for everyone, who have same problems and they can't use HMP or Wholesome vendor... 

    @Droidz

×
×
  • Create New...