Jump to content

Avvi

Members
  • Posts

    397
  • Joined

  • Last visited

Everything posted by Avvi

  1. The best I can offer: https://wrobot.eu/forums/topic/7329-avvis-c-tips-tricks-with-helpful-code-snippets/
  2. Added information about WRobot States.
  3. bool goToTown = false; public void Initialize(){ initializeToTownWatcher(); } private void initializeToTownWatcher() { robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) => { if (state != null && state.DisplayName == "To Town") { goToTown = true; Logging.Write("Going to Town State has been initiated."); } }; robotManager.Events.FiniteStateMachineEvents.OnAfterRunState += (engine, state) => { if (state != null && state.DisplayName == "To Town") { goToTown = false; Logging.Write("We have completed going To Town State."); } }; } I recommend doing it by watching for state change. I've not used Matenia's version, but if that doesn't work you can use my code and use the goToTown boolean.
  4. Hey Penumbra. I offer this functionality in my RoboAlert plugin. (pause when player nearby) and (ignore when going/leaving to town). https://wrobot.eu/files/file/1332-paidsale-roboalert-game-alerts-sound-email-phone-notification-on-whisper-rare-mob-teleport-logout-death-pause-etc/
  5. I'm going to self promote my plugin, because I feel that it is what gives me the confidence to bot safely on my accounts. I'm rather self-conscious regarding getting banned / looking too botty, so I created a plugin that can send phone notifications, send emails, and play sound files, pause bot when an event occurs. The plugin can watch for: Whisper Received Say message Received Character Died Character Logged Out Players nearby Enemy Nearby Character Teleported Continent Changed (or) Character moved very big distance This plugin works on all versions of WoW. Including Vanilla :D Great post, and good points @conne2 . Thanks for sharing!
  6. For me, I usually try to respond to whispers. However, automatic replies may seem bottish if it repeats them.
  7. I hope you don't mind, but I'm going to self promote my plugin, because I feel that it is what gives me the confidence to bot safely on my accounts. I'm rather self-conscious regarding getting banned / looking too botty, so I created a pluginthat can send phone notifications, send emails, and play sound files when an event occurs. The plugin can watch for: Whisper Received Say message Received Character Died Character Logged Out Players nearby Character Teleported Continent Changed (or) Character moved very big distance
  8. Hey there. Thanks for your comments. I will investigate to determine what's going wrong.
  9. Haven't used this yet, but I was reading through your code and wanted to say that I really like your Linkyfy method! Great work on this project.
  10. My recommendation is to take a look / decompile the WRobot code using dotPeek to figure out how Droidz does it. In his above snippet, he is omitting a lot - such as checking for when character is dead / character moved to different continent, etc.
  11. Do the logs show [Teleport Tester] PLAYER HAS TELEPORTED."
  12. Can you try the below? using wManager.Wow.ObjectManager; using wManager.Wow.Bot.Tasks; using System; using System.Collections.Generic; using System.Threading; using robotManager.Helpful; using robotManager.Products; using robotManager.Events; using wManager.Plugin; using wManager.Wow.Helpers; using System.Configuration; using System.ComponentModel; using System.IO; using System.Windows.Forms; using wManager.Wow.Enums; using System.Linq; public class Main : wManager.Plugin.IPlugin { public void Initialize() { pluginLoop(); } public void pluginLoop() { while (Products.IsStarted && _isLaunched) { if (!Products.InPause) { checkForTeleport() } } } public void checkForTeleport() { // how to wrobot check if your char is tp: if (wManager.Wow.Bot.States.StopBotIf.LastPos != null && wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAlive && wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo(wManager.Wow.Bot.States.StopBotIf.LastPos) >= 450) { Logging.Write("[Teleport Tester] PLAYER HAS TELEPORTED."); robotManager.Products.Products.ProductStop(); } } public void Dispose() { } public void Settings() { } }
  13. You may want to just try the below in its own method with a while loop (for testing). // how to wrobot check if your char is tp: if (wManager.Wow.Bot.States.StopBotIf.LastPos != null && wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAlive && wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo(wManager.Wow.Bot.States.StopBotIf.LastPos) >= 450) { // close bot... } That should probably work
  14. state comes from the FiniteStateMachine robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable To be honest, I have implemented what Droidz has , but in my RoboAlert plugin. I implemented it a little differently through looking at his code in dotPeek. One problem with the code snippet Droidz provided is that it's missing the continent change. The above code might not catch that.
  15. To test Teleporting, you can use a hearthstone or use a mage portal / game portal etc.
  16. Hey there, can you take a look at this thread? Try what Droidz suggested in the options. If that doesn't work, take a look at my suggested work around.
  17. This should work: RunMacroText("/use item:22962"); Have you tried creating a macro by itself with /use item:22962 and does that work? Also, if this is a questing profile, maybe you need to do something like this: <QuestsSorted Action="RunLuaCode" NameClass="RunMacroText("/use item:22962")" />
  18. Any specifics? The only ones I could find did not work - They didn't have the scripting for Dual Mounts.
  19. Just to be sure, did you call the InitMethod() from your Plugin Initializer?
  20. Not stupid questions! Thanks for updating us with how you resolved the issue :D
  21. I think the Wmod dll should be in the wRobot/bin folder, right?
  22. Does anyone know of a private server where Dual Mounting is possible?
  23. Can you explain a little more on what you mean? If you're asking if it's possible to Press a Keybind from a Plugin , the answer is yes. If your question is: Is it possible to click a WoW macro by using a Keybind from a plugin, then answer is yes :).
  24. If you had noticed, @createdby actually removed ALL submissions previously and submitted everything under one large "Profile Package". You did not tell the FULL truth, @camelot10 initially. Timeline of how things occured: Each Profile had its own Page. Createdby Removed Listings Reposted All Profiles under one Page. Createdby Removed Listing Createdby Re-Listed all profiles under separate Pages. You have only reported what has occured in Steps 3 - 5. I personally see nothing wrong with this activity, as it appears that @createdby decided that having everything listed under one page may have lead to less purchases. Also, I see nothing wrong with adding in the previous reviews... I haven't seen any negatives on his profiles anyway, so your point is invalid there anyway. As long as he doesn't repeat this cycle, I don't see a problem. To be quite honest, I'm tired of these flameposts by you @camelot10. Perhaps you should speak with Droidz individually before embarrassing yourself and , quite honestly, the community with these ridiculous posts. I appreciate your contributions to this forum and bot, but things like this should stay private and mentioned only when reports are CONFIRMED.
  25. Hi all, I figured I'd post some things that I have learned during my time of developing in C#. Perhaps some of this is obvious for some of the more experienced WRobot C# writers, but for me, I had to do a lot of forum searching and experimenting to make progress on any of my work. How do I get started? Please see this post by @Droidz How can I see what Functions are available to me in the WRobot API? I recommend using some sort of decompiler in order to see what functions are available in the WRobot API. That is, use something such as dotPeek from jetbrains. See this URL: https://www.jetbrains.com/decompiler/ . Once you have this downloaded, open the WRobot Binaries located in the (C:\WRobot\Bin) folder in dotPeek. I cannot even begin to explain how many times the recompiled helped me find useful things I could re-use. As a quick tip, I would suggest taking a look at the wManager.wManager.Wow.Helpers functions that are available. Anything listed as public static <variable type> will be available to use from a Plugin/Profile/Fightclass etc. What if WRobot doesn't have an available function that I will need? WRobot doesn't have everything instantly available, so you may need to resort to using some Lua Functions to get information back from the WoW Client. An example of this that I ran into at some point was getting the number of Character Macros someone has.. Of course this is very specific, but please bear with me for the sake of this example :). WoW Lua Reference: http://wowprogramming.com/docs/api_categories Using Lua in C#: This snippet will return a List of integers and set the C# variable numberOfMacros equal to the returned list of the DoString function. To be more specific, it will provide a list of the number of Global account Macros , and the number of Personal Character Macros. var numberOfMacros = Lua.LuaDoString<List<int>>("return numCharacterMacros"); The below will return just the number Character Macros someone has. If you need a specific variable from a Lua Function, then do the following: var numPersonalMacros = Lua.LuaDoString<int>("local numAccountMacros, numCharacterMacros = GetNumMacros(); return numCharacterMacros"); The above snippet will set the C# variable numPersonalMacros equal to numCharacterMacros from the lua return value. Using a Variable in the Lua.LuaDoString. The below will return the text body of the macro that has the id of 121. var _macroID = 121 string macroBody = Lua.LuaDoString<string>("return GetMacroBody(" + _macroID + ")"); Executing Lua Code in C# This will leave the party (if the player is in one). wManager.Wow.Helpers.Lua.RunMacroText("/run LeaveParty()"); What is the difference between Lua.LuaDoString() and RunMacroText()? The difference is in can be understand in how you think about them. Lua.LuaDoString should be seen as a way to retrieve information.. More specifically, the Lua.LuaDoString's purpose is to have a value returned to it, so that you can assign it to a C# Variable. RunMacroText can be used to do something in game. More specifically, RunMacroText should be used when trying to run some sort of in-game script (such as /cast spell). Plugin Template C#: Plugin-Template.cs I have attached a basic plugin template that can be used. In it, I have provided an example of: A Basic Implementation of the wManager.Plugin.IPlugin Class (including Settings/Initialize/Dispose) Basic loop that will occur while WRobot is running Settings that can be configured from Plugin Page A Category/Short Description for the Plugin Settings An example of Watching for Game Events. An example of OnRunState / OnAfterRunState for WRobot States Watching For Game Events Sometimes you may find that you need to wait for something to occur in game before you can take a specific action. In WoW / WRobot world, these things are called events. Below are two examples of events. The first event will occur when either the Group Loot Settings change, or a Player Enters/Joins the current Party.The second Event will occur when a System Message is received. I recommend adding this watchForEvents Function in the Initialize function of a plugin, or somewhere where it will only be called once. For an example of this, please see my Plugin Template. private void watchForEvents() { EventsLuaWithArgs.OnEventsLuaWithArgs += (LuaEventsId id, List<string> args) => { if (id == wManager.Wow.Enums.LuaEventsId.PARTY_MEMBERS_CHANGED) { Logging.Write("Joined Group or something about the current group was changed."); } if (id == wManager.Wow.Enums.LuaEventsId.CHAT_MSG_SYSTEM) { Logging.Write("We Received a System Message."); } }; } Finding the list of available Game Events: Each version of the game is different here, so this is where you will need to be careful. By that I mean, some versions of the game may have an event type, but a different version may not. Blizzard was not always consistent in their name accross different versions of the game, so please be careful to test against multiple versions of the game. Open DotPeek Search for "LuaEventsID" Double Click LuaEventsId in the Assembly Explorer Window. A window will open displaying a list of Events. What do each of these Events mean? WoW Event Reference: http://wowwiki.wikia.com/wiki/Event_API (Reminder! Some of these may be different in different versions of the game.) Watching For WRobot State Changes In addition to in game events, there are also WRobot 'states'. Similar to Game Events, WRobot states are the particular condition that WRobot is in at a specific time. For example, there is a state called 'MillingState', and another called 'Looting' that come out with WRobot. States are managed by the WRobot FiniteStateMachineEvents Engine. When a State occurs/changes/ends/etc, an event is passed to the FiniteStateMachine (pardon my wording here if this is not 100% correct). There are three main events that we can use to manage our States. State Events that occur: OnBeforeCheckIfNeedToRunState - This can be used to CANCEL an event if specific conditions are met. OnRunState - This can be used to do something just as the State is being started. OnAfterRunState - This can be used to do something just as the State has completed. Example of OnRunState and OnAfterRunState In this example we are watching for when WRobot starts the ToTown State and when it finishes it. We create a boolean that is set to true when the state is started, and then set it to false when the State is completed. I recommend adding the initializeToTownWatcher() function in the Initialize function of a plugin, or somewhere where it will only be called once. For example of this, please see my Plugin Template. bool goToTown = false; private void initializeToTownWatcher() { robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) => { if (state != null && state.DisplayName == "To Town") { goToTown = true; Logging.Write("Going to Town State has been initiated."); } }; robotManager.Events.FiniteStateMachineEvents.OnAfterRunState += (engine, state) => { if (state != null && state.DisplayName == "To Town") { goToTown = false; Logging.Write("We have completed going To Town State."); } }; } Example of OnBeforeCheckIfNeedToRunState In this example, we catch the state with the name of To Town and cancel it by setting the passed in cancelable parameter to true. private void cancelToTownState() { robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) => { if (state != null && state.DisplayName == "To Town") { Logging.Write("We have cancelled the To Town State"); cancelable.Cancel = true; } }; } Where can I find other WRobot States? Each version of the WRobot is different, so some versions of WRobot may have a state type, but a different version may not. Please be careful to test against multiple versions of the game/WRobot. Open DotPeek Expand wManager Module Expand wManager.Wow.Bot.States namespace. MORE TBA.... The above is my attempt at trying to help newcomers to WRobot at writing their own plugins / fight classes / etc. If there are any questions , suggestions, or even corrections, please do let me know in the comments and I'll be sure to add/update things as they come up! Thanks, - Avvi
×
×
  • Create New...