Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

check distance

Featured Replies

  • Author

Unforunately, i couldnt use it. Situatoion is more complicated. I really hope for your help. Can you help me with my shitcode, please? I dont know how to implement comments. Im going to use Quester for my plan, thanks and sorry for bad English.

 

 public class Ninja
    {
        //how can I check it?
        bool isVanishReady = true;
        //how can I check it?
        bool isCombat;
        //how can I check it?
        bool amIOpening;

        int chestId = 42;

        void LookingForTheChest()
        {
            if (isCombat)
            {
                //use vanish. How can send to game some bind like "shift + V"?
                //sleep 2000
            }

           if (isCombat == false && isVanishReady && IsAnyoneNearMe() == false && amIOpening == false)
            {
                LootTheChest();
            }
        }

       void LootTheChest()
        {

            //lets check chest, maybe it looted already
            //if no chest i need to go to the next step

        }


        bool IsAnyoneNearMe()
        {
            //get mobs around
            List<WoWUnit> mobsNearMe = ObjectManager.GetWoWUnitHostile();

            //anyone near me? 
           foreach(WoWUnit u in mobsNearMe)
            {
                if (ObjectManager.Me.Position.DistanceTo2D(u.Position) < 30)
                {
                    return true;
                }
            }

            // ok, fine, there are no mobs near me, lets check where is patrol
            foreach (WoWUnit u in mobsNearMe)
            {
                //how to check by id? im using  DisplayID, dont know what is it, but i hope you will help 
                if (u.DisplayId == 2017 && ObjectManager.Me.Position.DistanceTo2D(u.Position) < 100  )
                {
                    return true;
                }
            }

            //so cool, patrol are so far and no one near me, time to loot the chest
            return false;
        }
    }

 

  • Author

Thanks, what about the rest? There is no documentation, I dont know where can I find some info or tutorials for scripting.

    public class Ninja
    {
        private Spell _vanish = new Spell("Vanish");

        int chestId = 42;

        void LookingForTheChest()
        {
            if (ObjectManager.Me.InCombat && Lua.LuaDoString<bool>("IsShiftKeyDown()"))
            {
                //use vanish. How can send to game some bind like "shift + V"?
                //sleep 2000
                Thread.Sleep(2000);

                // Cast vanish
                this._vanish.Launch();
            }

            if (ObjectManager.Me.InCombat == false && _vanish.IsSpellUsable && IsAnyoneNearMe() == false && ObjectManager.Me.IsCast == false)
            {
                LootTheChest();
            }
        }

        void LootTheChest()
        {

            //lets check chest, maybe it looted already
            //if no chest i need to go to the next step

        }


        bool IsAnyoneNearMe()
        {
            //get mobs around
            List<WoWUnit> mobsNearMe = ObjectManager.GetWoWUnitHostile();

            //anyone near me? 
            foreach (WoWUnit u in mobsNearMe)
            {
                if (ObjectManager.Me.Position.DistanceTo2D(u.Position) < 30)
                {
                    return true;
                }
            }

            // ok, fine, there are no mobs near me, lets check where is patrol
            foreach (WoWUnit u in mobsNearMe)
            {
                //how to check by id? im using  DisplayID, dont know what is it, but i hope you will help 
                if (u.DisplayId == 2017 && ObjectManager.Me.Position.DistanceTo2D(u.Position) < 100)
                {
                    return true;
                }
            }

            //so cool, patrol are so far and no one near me, time to loot the chest
            return false;
        }
    }

 

Edited by iMod

  • Author

Oh bro, I appreciate it, thanks. Going to check it soon and it remains to find out  LootTheChest function.

Just now, sowelu said:

Also, how can it be looped? I need to call LookingForTheChest function every100 ms.

If you want too loop through something "While(condition)" could be used.

  • Author

I have very noobish question. Where should i insert this code? Quester> action> runCode ?

private Spell _vanish = new Spell("Vanish");

error

 

int chestId = 42;

but ok

 

 

11 hours ago, sowelu said:

I have very noobish question. Where should i insert this code? Quester> action> runCode ?


private Spell _vanish = new Spell("Vanish");

error

 


int chestId = 42;

but ok

 

 

Oh you are working with quester. The vanish thing should be a part of your fight class.

  • Author

Another stupid q, i have downloaded FightClass.cs sample, but wrobot>general settings > fight class have .xml format. How can I use sample. Also, I have downloaded plugin sample, and it works. I was able to write a log, lol. Which difference and advantage in these approaches?

2 hours ago, sowelu said:

Another stupid q, i have downloaded FightClass.cs sample, but wrobot>general settings > fight class have .xml format. How can I use sample. Also, I have downloaded plugin sample, and it works. I was able to write a log, lol. Which difference and advantage in these approaches?

XML is for ppl who have no clue about programming und C#(.cs) is for the advanced ppl. With XML you are forced to the functions droidz implemented and with C# you can create your own functions and stuff like that.

  • Author

I have found the cheast, how can I loot it? 

 List<WoWGameObject> objs = new List<WoWGameObject>();
 objs = ObjectManager.GetWoWGameObjectByyId(123456);
 WoWGameObject chest = objs[0];

 

12 hours ago, sowelu said:

Found solution


Interact.InteractGameObject(chest.GetBaseAddress);

 

You should not using the index because if there is no chest you will get a out of range exception.

// Search for a chest
List<WoWGameObject> chest = ObjectManager.GetWoWGameObjectByyId(123456).FirstOrDefault();

// Found?
if(chest != null)
{
  // Open
  Interact.InteractGameObject(chest.GetBaseAddress);
}

 

Edited by iMod

  • Author

Can I somehow receive some data from another instance of bot like value of variable in plugin? It would be cool to send a message to another instance.

3 hours ago, sowelu said:

Can I somehow receive some data from another instance of bot like value of variable in plugin? It would be cool to send a message to another instance.

Not as far i know. I would create a small tcp/ip server and client to communicate to each other.
Just take a look at google and search for "C# client server" or "C# chat application" this should bring you up some ideas.

Edited by iMod

  • Author

Thanks for the help, I have done main part. Now it would be cool learn rogue to sneak through dungeons.

1. Can I record path and force character to move  by C#  ?

2. How to use distract on the ground?

3 How to open trade, put items, and push it :smile:

12 hours ago, sowelu said:

Can I somehow receive some data from another instance of bot like value of variable in plugin? It would be cool to send a message to another instance.

If you run the instances of WRobot on the same pc, you can checkout my CacheManager here.

1 hour ago, sowelu said:

1. Can I record path and force character to move  by C#  ?

Yes, i recommend to use the "Quester" product and add a quest with "FollowPath" in "Quests Editor" window. It also supports C#.

1 hour ago, sowelu said:

2. How to use distract on the ground?

I think, you know how to calculate the position, so you could use this:

        //replace "new Vector3()" with your desired position
        SpellManager.CastSpellByIDAndPosition(1725, new Vector3()); 

 

1 hour ago, sowelu said:

3 How to open trade, put items, and push it

To open trade with current target:

        Lua.LuaDoString("RunMacroText('/trade');");

 

Put items to the trade window(another solution, forgot the exact reason why it was in some ways better then the WRobot's method):

    /// <summary>
    /// Interact with all listed item names.
    /// </summary>
    /// <param name="items">Item list</param>
    /// <remarks>Bug at links with "-"</remarks>
    public static void InteractItems(List<string> items)
    {
        if (!items.Any())
            return;
        var execute = "for b=0,4 do " +
                      "if GetBagName(b) then " +
                      "for s=1, GetContainerNumSlots(b) do " +
                      "local itemLink = GetContainerItemLink(b, s) " +
                      "if itemLink then " +
                      "local _, stackCount = GetContainerItemInfo(b, s)\t" +
                      "if string.find(itemLink, \""+ items.FirstOrDefault() + "\")";
        if (items.Count > 1)
        {
            execute = items.Where(obj => items.FirstOrDefault() != obj).Aggregate(execute, (current, obj) => current + "or string.find(itemLink, \"" + obj + "\") ");
        }
        execute = execute + "then UseContainerItem(b, s)\tend\tend\tend end end";
        Lua.LuaDoString(execute);
    }

 

To press the trade button:

        Lua.LuaDoString("RunMacroText('/click TradeFrameTradeButton');");

Take also a look at https://wrobot.eu/forums/topic/6826-frame-stack-on-wow-tbc-243/ or type "/fstack" in Wow if you have wotlk or above, to get other related frame stuff.

 

And If you mention a new topic, just open a new thread ;)

 

Edited by reapler

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.