Jump to content

reapler

Elite user
  • Posts

    288
  • Joined

  • Last visited

Everything posted by reapler

  1. I believe this should work: /// <summary> /// Used to get the facing from two positions based on the origin rotation. /// </summary> /// <param name="from">The 1. position.</param> /// <param name="to">The 2. position.</param> /// <param name="originRotation">The origin rotation.</param> /// <returns>Negative radian on the right; positive on the left.</returns> public float FacingCenter(WoWPoint from, WoWPoint to, float originRotation) { var face = NormalizeRadian(Atan2Rotation(from, to) - originRotation); if (face < Math.PI) return -face; return NormalizeRadian(originRotation-Atan2Rotation(from, to)); } /// <summary> /// Used to normalize the input radian. /// </summary> /// <param name="radian">The radians to normalize.</param> public float NormalizeRadian(float radian) { if (radian < 0.0) return (float) (-(- radian % (2.0 * Math.PI)) + 2.0 * Math.PI); return radian % 6.283185f; } /// <summary> /// Used to calculate atan2 of to positions. /// </summary> /// <param name="from">Position 1.</param> /// <param name="to">Position 2.</param> /// <param name="addRadian">Radians to add.</param> /// <returns></returns> public static float Atan2Rotation(WoWPoint from, WoWPoint to, float addRadian = 0) { return (float) Math.Atan2(to.Y - from.Y, to.X - from.X) + addRadian; } /// <summary> /// Used to calculate new position by parameter. /// </summary> /// <param name="from">The position to calculate from.</param> /// <param name="rotation">The rotation of the object in radians.</param> /// <param name="radius">The radius to add.</param> /// <returns></returns> public static WoWPoint CalculateNewPosition(WoWPoint from, float rotation, float radius) { return new WoWPoint(Math.Sin(rotation) * radius + from.X, Math.Cos(rotation) * radius + from.Y, from.Z); }
  2. Database Manager
  3. It depends, if you compile yourself any framework version should work. If you let for example WRobot compile your C# files(.cs) it will be on C# 4.0 / net framework 4.0. Prefered would be a higher version. https://stackoverflow.com/questions/247621/what-are-the-correct-version-numbers-for-c At first a small project like a plugin for WRobot is good enough to start off, later you may take other sources as reference and improve your code style, structure & performance preferably with C# projects on github or here at the download section. If the goal is to create a bot, you can also just start your own project and take other bot sources as reference. It is also advisable to google as much you can to follow the best practices and apply it to the code. Recommend tools: Visual Studio(IDE) DotPeek(Decompiler) - if you would like to view the API Recommend links: https://github.com/ - Many open source projects to explore http://stackoverflow.com - For me a good a resource on things like how to do X https://www.dotnetperls.com - Good & small code examples for handling different tasks https://docs.microsoft.com/en-us/dotnet/framework/index - C# / Net framework reference https://docs.microsoft.com/en-us/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application - Create your own app with Wpf Bot sources: https://github.com/miceiken/IceFlake https://github.com/tanis2000/babbot/ https://github.com/Zz9uk3/ZzukBot_V3
  4. Hello you can use a hashset for this purpose like this: private HashSet<int> safeList = new HashSet<int> { 12345, 12346, } private void ProtectItem(WoWItem item) { safeList.Add(item.GetItemInfo.ItemId); } private void ProtectItem(int itemId) { safeList.Add(itemId); } private void PulseDestroy() { if (ButlerSettings.CurrentSetting.DestroyGray) { foreach (WoWItem item in bagItems) { if ((item.GetItemInfo.ItemRarity==0 || item.GetItemInfo.ItemRarity==1) && !safeList.Contains(item.GetItemInfo.ItemId)) { while (ObjectManager.Me.InCombat || ObjectManager.Me.IsDead) { Thread.Sleep(shortDelay); } List<int> BagAndSlot=Bag.GetItemContainerBagIdAndSlot(item.Entry); Logging.Write(ButlerPrefix+"destroying \""+item.GetItemInfo.ItemName+"\""); Lua.LuaDoString(string.Format("PickupContainerItem({0}, {1}); DeleteCursorItem()", (object) BagAndSlot[0],(object) BagAndSlot[1]),false); Thread.Sleep(shortDelay); } } } }
  5. On vanilla this field is a List, it should be be HashSet on all expansions.
  6. The following classes can have these overrides implemented: Vector3 TaxiNode A correct implementation would look like this: public override int GetHashCode() { return (Position.X.GetHashCode() * 397 ^ Position.Y.GetHashCode()) * 397 ^ Position.Z.GetHashCode(); } public override bool Equals(object obj) { Node rhs = obj as Node; if (rhs == null) return false; return Position.X == rhs.Position.X && Position.Y == rhs.Position.Y && Position.Z == rhs.Position.Z; } This will enable the usage of the class in Dictionary<> and HashSet<>. These collections provide higher performance and uniqueness of each inserted element. List<> collection's behavior will stay the same.
  7. The bug happens while the character tries to walk while stunned and this message appears "[MovementManager] Think we are stuck". I could also imagine it, it would also happen with other movement impairing effects such as roots. If the event "MovementEvents.OnSeemStuck" is registered this will be also called. If someone else would use this event for an own bug reporting, this would result in false-positive reports.
  8. Hello, you may decompile or create project with dotpeek for the plugin and tweak it abit. The used methods are correct to turn the character(the same methods which are called for mouse turns). One problem is, wrobot is hooking endscene to execute methods of wow and this is also affected by fps, it must be also mentioned it is a safe method to do it. Injected it could calls the used methods directly with a higher ratio. Also the plugin itself is in my eyes still a prototype. A pid controller, better fps / latency dependent settings can be implemented in order to work 'ok' with endscene.
  9. @all I would like to thank you for using the plugin and giving feedback. However the future development will be forwarded by someone else(he will also take care of the bugs). He will get in touch and response as soon he is releasing this.
  10. Thank you for your feedback, i will try to fix the problems, if i got time(other projects) Hello there, sorry i have overlooked your message. If the problem still persist and is not already fixed from Humanmaster plugin you may response.
  11. Thank you for the kind words. To your problem, this bug may happen on low fps, high configured path-smoothness, used product/plugins/fightclass, or whether the character is riding or not. To pin the bug please describe your steps to reproduce it exactly, provide the used settings from the plugin, may include the path(A-B), using a 'xml-fightclass', disable all other plugins and a log would be also helpful. If i got time, i can hopefully investigate the bug.
  12. Hello, .cs files are written in C# and allows the developer to take advantage of the full Wrobot API / Bot behavior. This means C# written routines are superior towards routines created by the fightclass editor because every action of the character can controlled by these C# routines. In case if you would like to develop yourself these fightclasses:
  13. Hello, you may take a look into memory mapped objects / remote procedure call(RPC). For example: https://github.com/spazzarama/SharedMemory http://csharptest.net/projects/rpclibrary/index.html These can be also installed via nuget packet manager on Visual Studio and can be binded with fody with your distributed library(fightclass / plugin). Note: RPC is rather for client / server communication but you may also exchange data via calls. If this may take abit too much effort, you can also save a file to disk(like fightclass settings) and read from another wrobot instance.
  14. Hello for this problem i have added "Disable in Combat" to the settings. On true it should resolve the problem, atleast on my side. If you still got problems please describe detailed the steps to cause this bug and a log would be helpful.
  15. I have uploaded a new version. If a problem encounters, please disable all other plugins, using a "xml" fightclass and try to reproduce it. Log, profile(if possible) and the exact & detailed steps about the occuring bug would be helpful to fix the problem.
  16. Hello, you can subscribe to the movement events to block the movement. It could look like this(not tested): //call at initialize public void SubscribeEvents() { MovementEvents.OnMovementPulse += MovementEventsOnOnMovementPulse; } //call at dispose public void UnSubscribeEvents() { MovementEvents.OnMovementPulse -= MovementEventsOnOnMovementPulse; } private void MovementEventsOnOnMovementPulse(List<Vector3> path, CancelEventArgs cancelEventArgs) { if (DestinationTmp != Vector3.Empty && path.LastOrDefault()?.Action != "custom" ) { cancelEventArgs.Cancel = true; } } public static Vector3 DestinationTmp = Vector3.Empty; public static void MoveTo(Vector3 destination) { List<Vector3> path = PathFinder.FindPath(ObjectManager.Me.Position, destination); var last = path.LastOrDefault(); if (last != null) last.Action = "custom"; DestinationTmp = MovementManager.CurrentPath.LastOrDefault() ?? ObjectManager.Me.Position; MovementManager.Go(path); } public static void GoBack() { List<Vector3> path = PathFinder.FindPath(ObjectManager.Me.Position, DestinationTmp); DestinationTmp = Vector3.Empty; MovementManager.Go(path); }
  17. This part should be fixed now. But it seems like the profile doesn't perceive that it has reached the destination and stuck. Probably an unlucky condition i guess. There's nothing more what i could do since the profile is not accessible. @camelot10 may hopefully expose the condition on https://wrobot.eu/files/file/1139-paid-pandaria-world-bosses/, dunno what's exactly wrong there.
  18. @KnightRyder The catchup should be fixed now with this: CurrentMoveTo = SmoothMove.Utilities.Math.NextVector( MovementManager.CurrentPath.FindIndex(i => i.X == vector3.X && i.Y == vector3.Y), MovementManager.CurrentPath, 1.2f ) ?? vector3; The other problem with the stuck, i've added the end point so it should hopefully continue with the next step.
  19. How high was your fps while it stutter? Very low values could cause this because it depends on the fps how fast the functions are executed in wow's main thread.
  20. @KnightRyder Thank you for your logs and did this stuck happen only with flying?
  21. Yes, it should work. Since it will just modify the path, nothing else on this version. But so far i can see, i guess the path is being altered somewhere and my mark disappears. This will result the path being smoothed a second, third or fourth time and causes stuttering movement: [D] 01:27:48 - [SmoothMove] Path count: 2284 [D] 01:27:48 - [SmoothMove] Stop Move @OnMovementStop [D] 01:27:48 - [SmoothMove] Stop Move @OnMovementStop [D] 01:27:48 - [SmoothMove] Stop Move @OnMoveToStop [D] 01:27:48 - [SmoothMove] Stop Move @OnMoveToStop [D] 01:27:49 - [SmoothMove] Stop Move @OnMoveToStop [D] 01:27:49 - [SmoothMove] Path count: 26304 [D] 01:27:49 - [SmoothMove] Stop Move @OnMovementStop [D] 01:27:49 - [SmoothMove] Stop Move @OnMovementStop [D] 01:27:49 - [SmoothMove] Stop Move @OnMoveToStop [D] 01:27:50 - [SmoothMove] Stop Move @OnMoveToStop [D] 01:27:50 - [SmoothMove] Stop Move @OnMoveToStop [D] 01:27:50 - [SmoothMove] Path count: 76292 [D] 01:27:50 - [SmoothMove] Stop Move @OnMovementStop [D] 01:27:50 - [SmoothMove] Stop Move @OnMovementStop [D] 01:27:50 - [SmoothMove] Stop Move @OnMoveToStop [D] 01:27:50 - [SmoothMove] Stop Move @OnMoveToStop [D] 01:27:51 - [SmoothMove] Stop Move @OnMoveToStop But i could need more information @KnightRyder, on how you reproduce this exactly and maybe monitor the debug log where this behavior happens. I uploaded a new version with a better logging for this.
  22. With stuck do you mean also stutter movement, or it doesn't move at all?
  23. I changed the behavior when to stop and start moving, maybe this will work now. If not please let me know and if possible a snippet from the profile would be helpful.
  24. @Steffen Which plugins, fightclass and product was used? Additionally a log would be also helpful if possible.
  25. Thanks for the feedback, i'll look later into it.
×
×
  • Create New...