Jump to content

Force bot to take a taxi


mich125

Recommended Posts

So i need bot to take a taxi, here is my code

    <QuestsSorted Action="While" NameClass="wManager.Wow.Helpers.Usefuls.ContinentId == 530 &amp;&amp; ObjectManager.Me.Position.DistanceTo2D(new Vector3(45.09895f, 2741.531f, 85.17036f)) &gt; 500" />
    <QuestsSorted Action="RunCode" NameClass="var position = new Vector3(3078.104, 3602.156, 144.0669);&#xD;&#xA;int npcEntryId = 18938;&#xD;&#xA;&#xD;&#xA;if (!ObjectManager.Me.IsOnTaxi)&#xD;&#xA;{&#xD;&#xA;    if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(position, npcEntryId))&#xD;&#xA;    {&#xD;&#xA;        Usefuls.SelectGossipOption(GossipOptionsType.taxi);&#xD;&#xA;        Lua.RunMacroText(&quot;/click TaxiButton1&quot;);&#xD;&#xA;    }&#xD;&#xA;}" />
    <QuestsSorted Action="Wait" NameClass="288000" />
    <QuestsSorted Action="EndWhile" NameClass="" />

What bot does:

1. Bot interacts with flightmaster properly

1. He uses the macro /click TaxiButton1

But in game it shows "There is no direct path to that destination".

Route looks like this in game

7nYoL9B.png

IF i manually mouseover my destination, route will be shown on map then, and macro that bot uses will work.

Link to comment
Share on other sites

  • 3 months later...

Hello, try this code 

Lua.LuaDoString(string.Format("if TaxiButton{0} then TaxiNodeOnButtonEnter(TaxiButton{0}); end", 1));
Thread.Sleep(Usefuls.Latency + 100);
Lua.LuaDoString(string.Format("if TaxiButton{0} then TaxiButton{0}:Click(); else TakeTaxiNode({0}); end", 1));

(replace 1 by you button id)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...