Jump to content

Help with checking Hearthstone location


Krazzee

Recommended Posts

Hello all,

 

I am developing a quester for 3.3.5a WotLK, and am looking to set a hearthstone location at the innkeeper in Brill once the player is outside of Deathknell. I need assistance with having the bot check the player's current bind location, and if it is not set to Gallow's End Tavern, and is instead say set to the starter of Deathknell, then it will then run the steps to bind at the inn. I need this because I currently have it working to go to and speak to the npc and push the buttons to successfully bind, but every single time the bot is started it repeats the action of running back to the inn and binding with the innkeeper which is maddeningly annoying, as I am unsure of how to get wrobot to check the player's current bind location.

Here's my theory and code I'm currently using in the QuestOrderEditor, but I am unable to make it work--I think due to my inability to properly have wrobot use an If statement:

[0] If > bindLocation != "Gallow's End Tavern'
[1] RunCode > wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(2269.51f, 244.944f, 34.25697f), 5688, 1, false);
[2] RunMacroLua > /click StaticPopup1Button1
[3]EndIf >

Do I need to have it run bindLocation as a RunMacroLua? as a RunCode? I am terribly confused and I believe this is what is causing the issue. So any clarification regarding how to pass the parameters to the bot and how to setup the steps is what I truly need.

I know how to use "/dump bindLocation" or "/print bindLocation" to have it return the name of the inn I'm set to, or in the case of a starter area it returns 'Tirisfal Glades'. But how do I feed that information to the bot in the form of a workable If statement? I need it to do the following:

1.) Run a successful if statement which checks player's current bindLocation

2.) If it != Gallow's End Tavern, then it runs the code I have which successfully binds it at the inn

3.) It ends the if statement

I am absolutely stumped as to how to have the bot pass and read this information properly. Do I do it as a RunCode? A RunMacroLua? What would be the proper code I need?

Any assistance would be sincerely appreciated, and thank you for your time! :)

Link to comment
Share on other sites

Hey Krazzee!

Don't count on my 100%, but all I could find myself was that there's no such API and that the LuaCode won't work.

I am working on Questing Profiles too and, to be honest, I just don't use the Hearthstone at all.

Greetings.

 

 

Link to comment
Share on other sites

Hello :)

Thank you for your answer, I had found those posts and a few others and have been scouring the forums but have not found anything of any worth yet from them sadly. I have finally just developed a workaround which has a player turn in a quest to the innkeeper, then if they are within a certain range (less than 5 meters from the Innkeeper), it successfully sets their bind location and then goes on their way, and it doesn't repeat the step every time I restart the bot. Problem is, if the player happens to go within 5 meters of the innkeeper again at any point, it will then repeat the same exact steps and rebind itself. Not world-ending, but it is a lesser quality solution than I want in my quester if I can help it. Here is my successful workaround atm for having it run to and bind at the innkeeper, in case anyone is interested or needs something similar.

    <QuestsSorted Action="TurnIn" NameClass="ARoguesDeal" />
    <QuestsSorted Action="If" NameClass="ObjectManager.Me.Position.DistanceTo2D(new Vector3(2269.51f, 244.944f, 34.25697f)) &lt; 5" />
    <QuestsSorted Action="RunCode" NameClass="wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(2269.51f, 244.944f, 34.25697f), 5688, 1, false);" />
    <QuestsSorted Action="RunMacroLua" NameClass="/click StaticPopup1Button1" />
    <QuestsSorted Action="GoToStep" NameClass="56" />
    <QuestsSorted Action="EndIf" NameClass="" />

But this solution feels more like a bandage than an actual solution or fix to my issue--I want to release a very high quality quester, and while I can use this workaround I'm rather stubborn and want to figure this out :P I feel I'm close in getting Wrobot to do what I need it to do, my main issue is that I am unsure of how to pass the data of the bindLocation of "Gallow's End Tavern" or "Tirisfal Glades" from WoW to Wrobot, or have Wrobot pull the information that is stored in bindLocation from WoW, then have it check if it is equal to the parameter I set, and then it decides whether to run the steps to bind or not. My main question I suppose is, can WRobot do the following:

1.) Can WRobot query and retrieve the bindLocation of the player (Basically, is there a way to have Wrobot read the bindLocation string that is stored? I'd imagine it should be able to as it reads all other manner of variables and strings from WoW, I just don't know how to pass that argument onto Wrobot from WoW)

2.) Can WRobot then consider if the bindLocation string is or is not equal to the string parameter that I have set of "Gallow's End Tavern", and if it is not equal to it then it runs the steps?

3.) How can I get WRobot to read something as a string in code? If I can pass the value of bindLocation to WRobot, do I need any ConvertTo's or anything to have it parse "Gallow's End Tavern" as a string? Do I need an extra set of Quotation marks or parenthesis?

4.) Where would the value of bindLocation be stored for WRobot to pull it? Like if you are trying to set something based on player class, it's stored in "ObjectManager.Me.WoWClass", and player race is stored in "ObjectManager.Me.PlayerRace". Does that mean bindLocation is "ObjectManager.Me.bindLocation"?

So basically I'm asking where would bindLocation be? Would it be in "ObjectManager.Me.bindLocation"? or in "WManager.Player.bindLocation"? Or something similar? Perhaps Droidz might know? Here's what I've been trying:

    <QuestsSorted Action="TurnIn" NameClass="ARoguesDeal" />
    <QuestsSorted Action="If" NameClass="ObjectManager.Me.bindLocation != Gallow's End Tavern" />
    <QuestsSorted Action="RunCode" NameClass="wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(2269.51f, 244.944f, 34.25697f), 5688, 1, false);" />
    <QuestsSorted Action="RunMacroLua" NameClass="/click StaticPopup1Button1" />
    <QuestsSorted Action="GoToStep" NameClass="56" />
    <QuestsSorted Action="EndIf" NameClass="" />

If you have any documentation or any information on how WRobot processes and completes 'If' statements and/or where WRobot retrieves and reads values like PlayerClass and such, I believe I can make this work. I'm close, I just am missing something and I believe it's due to my lack of knowledge in how WRobot 'If' statements and WRobot variable storage/retrieval work. Thank you for your help :)

Link to comment
Share on other sites

Hey again.

That's the thing. Afaik we (I, atleast) can't be sure about whatever the hearthstone is or is not bound to a certain location - Without making it harder for the user. (Multilanguage, using the Profile at any level, etc...)
You caring about quality is very nice, keep up that good trait. :)

As you see in the post from Zan, you can read it with

<QuestsSorted Action="If" NameClass="Lua.LuaDoString<string>("bindlocation = GetBindLocation(); return bindlocation;") == "Trade District"" />

but that will just work with you localization.

So, yes, you can read it and WRobot can do the steps after this, but not without strictly making it for a specific localization.

To 4.) There is no such thing as a ObjectManager.Me.BindLocation.
You can use some kind of assembly explorer and look into WRobot\Bin\wManager.dll

There you can find all there is. Maybe you'll find something helpful. That's as close as to a documentation as you can get.

Sorry for not having a straight answer.
Greetings.

Link to comment
Share on other sites

Thank you Nudl, you are a gentleman(or gentlewoman) and a scholar! :) I can only hope to release things approaching the quality of what you have created and distributed for free for members of the WRobot community.

I truly do appreciate you assisting me with this. I have tried to use Zan's code, but have been unable to make it work--so I had assumed his code was not correct/unusable. If I copy it as is from Zan's code into the if statement of the XML, it gives an error and is unreadable/unloadable by WRobot, I'm assuming due to incorrect escaping of the Apostrophe of "Gallow's End Tavern", as well as any Escape Sequences for the other operators in the code. If I put it in via the Easy Quest Editor so it correctly marks the apostrophes and escapes the special characters properly , it just stays at initializing and will not perform the steps. I'll paste the two segments of code below, perhaps you can tell me what I'm doing wrong?

Here's the code as it is if I copy+paste Zan's code into it, without proper Escape Sequences for the special characters in XML:

<QuestsSorted>
    <QuestsSorted Action="If" NameClass="Lua.LuaDoString<string>("bindlocation = GetBindLocation(); return bindlocation;") == "Gallow's End Tavern"" />
    <QuestsSorted Action="RunCode" NameClass="wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(2269.51f, 244.944f, 34.25697f), 5688, 1, false);" />
    <QuestsSorted Action="RunMacroLua" NameClass="/click StaticPopup1Button1" />
    <QuestsSorted Action="EndIf" NameClass="" />
  </QuestsSorted>

 

I am assuming that doesn't work as you can't have Apostrophe's and whatnot in XML or it will cause a huge error, so that is likely why that doesn't work. However, when I copy the if statement into the Easy Quests Editor, it is at least viewable and readable, but WRobot just stays at 'Initializing' and never moves on to the actual if statement. Here's the same section of code as taken from the XML created by the Easy Quests Editor:

<QuestsSorted>
    <QuestsSorted Action="If" NameClass="Lua.LuaDoString&lt;string&gt;(&quot;bindlocation = GetBindLocation(); return bindlocation;&quot;) == &quot;Gallow's End Tavern&quot;" />
    <QuestsSorted Action="RunCode" NameClass="wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(2269.51f, 244.944f, 34.25697f), 5688, 1, false);" />
    <QuestsSorted Action="RunMacroLua" NameClass="/click StaticPopup1Button1" />
    <QuestsSorted Action="EndIf" NameClass="" />
  </QuestsSorted>

 

However, this ALSO doesn't work. It doesn't throw an error/exception like the first example does, it just merely stays at 'Initializing' and never actually performs the steps inside the If statement. I notice it doesn't use  &#39; or &apos; to escape the Apostrophe for the String in XML, could that be the issue? I've been messing around with it but just cannot get it to work, so I'm rather stumped, what am I missing? I'm assuming it's something small or simple that I have overlooked, and I welcome any assistance so I can at least get the code Zan posted up and running if nothing else.

I'm also taking up your suggestion of browsing through wManager.dll with a Assembly Explorer. This is quite beyond my normal scope of programming knowledge, but though it is almost incomprehensible to me at the moment, I'm hoping with time the internals of the wManager.dll will begin to make more sense. If nothing else it'll be a helluva project attempting to understand and document what I can. I'll start with known things like ObjectManager.Me.WoWClass and such as a reference point and expand from there. Even if I can't find bindLocation, I'm sure I'll find many things which will be of great use in my future programming with WRobot. I look forward to your knowledgeable reply :)

Link to comment
Share on other sites

Hey, after testing it myself, wondering why it doesn't work, I took a closer look:

It's Gallows' End Tavern, not Gallow's End Tavern.

So, it does work. :D
Keep in mind that such little things will always happen.

Really appreciating your eloquence, by the way.

Link to comment
Share on other sites

Hello :)

I just tested myself and you are absolutely correct, I was assuming it had to have been Gallow's End Tavern and never apparently sat and actually read the true name, to which you are indeed correct it is Gallows' End Tavern. You have no idea how hard I laughed at my mistake this morning when I woke up and read your reply then tested it--I suppose it's like the old saying: "When you make an assumption, you make an ass out of you and -umption." This will absolutely help more than you know, as of now my Undead 1-12 quester is basically complete :) A bit of quest tuning and some testing and it might be up to scratch for a beta release. 

Thank you very much for all of your assistance nudl, you have helped me to bring my quester to fruition and I can't thank you enough. And thank you for the compliment :) I'm sure I'll be bothering you again for an issue in the future :P Now to level up some other classes and program in the level 10 class quests and I think it'll be totally finished. Consider this solved.

(Here's the successful code I'm now using if anyone needs it for anything similar)

    <QuestsSorted Action="TurnIn" NameClass="ARoguesDeal" />
    <QuestsSorted Action="If" NameClass="Lua.LuaDoString&lt;string&gt;(&quot;bindlocation = GetBindLocation(); return bindlocation;&quot;) != &quot;Gallows' End Tavern&quot;" />
    <QuestsSorted Action="RunCode" NameClass="wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new Vector3(2269.51f, 244.944f, 34.25697f), 5688, 1, false);" />
    <QuestsSorted Action="RunMacroLua" NameClass="/click StaticPopup1Button1" />
    <QuestsSorted Action="GoToStep" NameClass="56" />
    <QuestsSorted Action="EndIf" NameClass="" />

 

Edited by Krazzee
Solved.
Link to comment
Share on other sites

  • 11 months later...
  • 1 month later...

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...