Jump to content

reapler

Elite user
  • Posts

    288
  • Joined

  • Last visited

Everything posted by reapler

  1. @iMod I've used a more or less modified lua engine from a guy that had written it for 4.3.4 but i got tired with cataclysm and couldn't use the stuff for other Wow expansions(so i came here and learned abit C#) and with objectmanager/hook i'm not sure but i don't think you need to write much or? i mean you can get the base address, pointers and as well other objects and lookup/add descriptors or offsets from the already existing manager. For e.g. i needed something to check a descriptorfield wheter item is soulbound or not(i don't know anymore where exactly i've found it) but i figured out later that the function already exist haha Anyway here is how it looked like: public class Descriptor { private static uint Descriptor_Offset = 0x8; //not in api Can be added later /*public static uint Read(WoWDynamicObject obj, Descriptors.DynamicObjectFields field) { return Read(obj.GetBaseAddress, (uint)field); }*/ public static uint Read(WoWItem obj, Descriptors.ItemFields field) { return Read(obj.GetBaseAddress, (uint) field); } public static uint Read(WoWObject obj, Descriptors.ObjectFields field) { return Read(obj.GetBaseAddress, (uint)field); } public static uint Read(WoWContainer obj, Descriptors.ContainerFields field) { return Read(obj.GetBaseAddress, (uint)field); } public static uint Read(WoWCorpse obj, Descriptors.CorpseFields field) { return Read(obj.GetBaseAddress, (uint)field); } public static uint Read(WoWGameObject obj, Descriptors.GameObjectFields field) { return Read(obj.GetBaseAddress, (uint)field); } public static uint Read(WoWPlayer obj, Descriptors.PlayerFields field) { return Read(obj.GetBaseAddress, (uint)field); } public static uint Read(WoWUnit obj, Descriptors.UnitFields field) { return Read(obj.GetBaseAddress, (uint)field); } public static uint Read(uint obj, uint field ) { try { if (obj != null) { uint address = Memory.WowMemory.Memory.ReadUInt32(obj + Descriptor_Offset); return Memory.WowMemory.Memory.ReadUInt32(address + field); } } catch (Exception ex) { Logging.WriteError("Error: " + ex); return 0; } return 0; } //Add Write } Maybe you also don't need to write for yourself for your goal
  2. Yep. It's almost the same ;) public List<WoWGameObject> WoWGameObjects(string name) { return ObjectManager.GetObjectWoWGameObject().Where(i => i != null && i.Name == name //&& i.GetDistance <= RealmHopSettings.CurrentSetting.DistanceBeforeHopping //or other arguments ).OrderBy(i => ObjectManager.Me.Position.DistanceTo(i.Position)).ToList(); } usage: WoWGameObjects("Kingsblood").FirstOrDefault();
  3. Hello i have also written something similar on another script language. My method was to register the combatlog and set a timer with a boolean value on it when a spell was cast by me(you can add to this latency & some personal preferences to it). I've done this, because (for me) the api function wasn't accurate enough. and you can also add some overloads to your method if you need them for e.g. with list debuffs: public static bool CastSpell(Spell spell, WoWUnit target, double buffTimeLeft = 0, int stacks = 0, List<Spell> debuffs = null, bool owner = true, bool force = false) { //... } or with spellname instead: public static bool CastSpell(string spellname, WoWUnit target, double buffTimeLeft = 0, int stacks = 0, Spell debuff = null, bool owner = true, bool force = false) { //... }
  4. An alternative would be to use wManager.Wow.ObjectManager.ObjectManager.Me.Rotation. But it's also not that what it should do while moving. for e.g: The player face to the angle but movement doesn't get updated that result in that the character is still moving to the same direction before the rotation was set: - movement direction is the same - only facing is changed It looks abit strange while moving :) I've read that a movementflag can be changed to correct this wrong behavior but i'm not sure. Best regards
  5. Hello, i would like to report that the facing behavior isn't working correct on the 3.3.5a client. I tried to call "ClickToMove.CGPlayer_C__ClickToMove(position.X, position.Y, position.Z, 0UL, 2, 0.5f)" with different ClickToMoveTypes. The result: it face to an other fixed position in nowhere. Thank you in advance.
  6. Hello, i would like to ask if a method can be added to return the currents cursor position in-game like: public static Vector3 GetCursorPosition() { try { //return data //return } catch (Exception ex) { Logging.WriteError(" " + ex, true); return new Vector3(0.0f, 0.0f, 0.0f); } } It would be really helpful for e.g. easy profile creating or editing. Thank you in advance.
  7. Hello and welcome to the Wrobot community! Usually you don't need to reopen Wrobot to compile the plugins(only if you add a new .cs or .dll file to the plugin directory). As soon you save the .cs or .dll file you just need to start and stop Wrobot to update it. And yes, you can block your product indirectly by events. For e.g. the movement public Vector3 POI = new Vector3(); public void Initialize()//wrobot method { MovementEvents.OnMoveToPulse += (vectors, state) => { if (POI != Vector3.Empty && MovementManager.CurrentPath.LastOrDefault() != POI) { state.Cancel = true; } }; } public void Pulse()//ticks { if (ObjectManager.Me.TargetObject.Position != Vector3.Empty && POI == Vector3.Empty && POI.DistanceTo(ObjectManager.Me.Position) > 5) { List<Vector3> Path = PathFinder.FindPath(ObjectManager.Me.Position, ObjectManager.Me.TargetObject.Position); MovementManager.Go(Path); POI = Path.LastOrDefault(); Logging.Write("Walk to :\n"+POI); } if (!ObjectManager.Me.GetMove && POI != Vector3.Empty) { List<Vector3> Path = PathFinder.FindPath(ObjectManager.Me.Position, POI); MovementManager.Go(Path); } else if (POI.DistanceTo(ObjectManager.Me.Position) < 7) { Logging.Write("Arrived clear target to go back to task"); Lua.LuaDoString("ClearTarget()"); } if (ObjectManager.Me.Target == 0) { POI = new Vector3(); } } or you switch your product which doesn't influence specific behaviors:
  8. Yep you can also paste the code to the fightclass for e.g. Gobehindtest.xml as i wrote it in the last post, i prefer to use lua(but it's more difficult to code) else it looks abit jagged with moveto and by the way if you wanna see the point just enable 3dRadar.
  9. Yes, i think you can do it by lua or moveto(i prefered on other bots to use lua if character was close enough to the target to strafe and set rotation). There must be also an movementevent that you can block which is set on the fightclass. Here's an example to get the target's back vector: public Vector3 BackofVector3(Vector3 from, float radius) { if (from != null && from != Vector3.Empty) { //abit ugly float rotation = -robotManager.Helpful.Math.DegreeToRadian(robotManager.Helpful.Math.RadianToDegree(ObjectManager.Me.TargetObject.Rotation)+90); return new Vector3((System.Math.Sin(rotation)*radius) + from.X, (System.Math.Cos(rotation)*radius) + from.Y, from.Z); } return new Vector3(0, 0, 0); } and to see the point where it is just add this in initialize method: Radar3D.OnDrawEvent += () => { if (ObjectManager.Me.TargetObject != null) Radar3D.DrawCircle(BackofVector3(ObjectManager.Me.TargetObject.Position, 2f), 0.3f, Color.Blue); }; if you decide to use it, i recommend to also set your own rotation by atan2 to your target(it looks more smooth) and disable it on npcs because it looks awful when the bot is running around on its target indefinitely. .
  10. Thank you all for your help, but it just doesn't get the event that i wanted. On other events it is working: parameter & id is printed. I think i will report it to the bugtracker maybe it's just a bug in wrobot itself( tested it with 3.3.5a/4.3.4 clients).
  11. No, capitalization is not the problem (i'm sorry, i just forgot to capitalize it in my question) it simply don't get the event : EventsLuaWithArgs.OnEventsLuaWithArgs += (id, args) => { Logging.WriteDebug("\nid contains: " + id); for (int i = 0; i < 20; i++) { Logging.WriteDebug("\nArg" + i + " contains: " + args[i]); } }; and with "EventsLua.AttachEventLua(LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED, mymethod());" i can't return the parameters of it(so far as i know).
  12. Hello, is it possible to register "COMBAT_LOG_EVENT_UNFILTERED" with its parameter like guid, spellname etc? i already tried it with EventsLuaWithArgs.OnEventsLuaWithArgs but it doesn't contain the event nor its parameters and EventsLua.AttachEventLua isn't what im looking for.
  13. @Jasabi For plugins there's no best. It depends on the situation. Most of the time you won't need it anyway for plugins because it's not so complex and stucks don't happen that often while running. I think also that every plugin run anyway on it's own thread. For e.g. if you use async with a method it will run independent (it doesn't block the main thread on its own processing) so other stuff can continue and the second one what you have mention is multithreading. The both are "almost" the same but with multithreading you have your seperate thread which can execute its own code.
  14. Version 1.0.1

    924 downloads

    What is it? A plugin to avoid groups of hostile npcs during traveling (currently). How it works? By reporting the dangerous area & regenerate path. Some more information: -Currently tested it with grinder on a 3.3.5a client, but it should also work with other clients & path generating products too -only supports the travelling path for now(not the grinder/gatherer hotspots itself) -if the desired goal is not achieved, try to change the settings -initial release = some errors can occur Future features: -implent custom resurrection -avoid fighting while travelling Ideas, suggestions or problems? Please leave your feedback here.
  15. ah forget the complicated code, i've found a better way to do it for e.g: public void Initialize() { Logging.Write("Plugin started."); Thread.Sleep(7000); SwitchProduct("Grinder"); } public void Dispose() { Logging.Write("Disposed"); } public void Settings() { } public void SwitchProduct(string name) { if (Products.ProductName != name && Products.IsStarted) { var t = Task.Run(async delegate { await Task.Delay(500); Logging.Write("Switch to " + name); Products.ProductStop(); Products.LoadProducts(name); Logging.Write("stop & load product"); Thread.Sleep(200); Products.ProductStart(); Logging.Write("product start"); Thread.Sleep(1500); }); t.Wait(); } } I think it's better ;) Edit: using System.Threading.Tasks; is also needed
  16. Tried to use it onevent? like this: Radar3D.OnDrawEvent += () => { Radar3D.DrawCircle(ObjectManager.Me.Position, 10, Color.Red); };
  17. Hello, i tried this also by a plugin but i have figured out that it's abit difficult. You need to create your own thread because if you dispose product your plugin also stop working(maybe there's another method to do it but i haven't found it yet). Here's an example how do you create your own thread: public static bool _isLaunched1; public static bool AllowAbort; Dictionary<string, Thread> threadDict = new Dictionary<string, Thread>(); public void Initialize() { MemoryBool(true); Thread th1 = new Thread(() => Thread1()); th1.Name = Convert.ToString(TableID); th1.Start(); threadDict.Add("Thread1", th1); Logging.Write("Thread started."); } public void Dispose() { if (!MemoryBool()) { Logging.Write("Abort thread."); SwitchProduct(StartedRotationName()); if (AllowAbort) { threadDict["Thread1"].Abort(); } } } public void Settings() { } public void Thread1() { Logging.Write("Initialize thread."); _isLaunched1 = true; var timer = new Timer(1500); timer.ForceReady(); while (_isLaunched1) { try { if (Conditions.ProductIsStartedNotInPause && timer.IsReady //&& !ObjectManager.Me.IsDead //optional ) { Pulse1(); timer.Reset(); } } catch { } Thread.Sleep(65); } } //may change address if not available or use System.Runtime.Caching.MemoryCache or write settings public bool MemoryBool() { if (Memory.WowMemory.Memory.ReadInt32((uint) GetWoWBase() + 0x7322CA) == 1) { return true; } return false; } public void Pulse1(); { Logging.Write("Tick"); } and the key to switch products: //Need own thread to work //=> Products.ProductStop();/Products.DisposeProduct(); aborts the main thread and method has nothing to continue public void SwitchProduct(string name) { if (Products.ProductName != name && Products.IsStarted) { Logging.Write("Switch to " + name); MemoryBool(true); Products.ProductStop(); Products.LoadProducts(name); Logging.Write("stop & load product"); Thread.Sleep(200); Products.ProductStart(); Logging.Write("product start & abort old"); MemoryBool(false); Thread.Sleep(1500); threadDict["Thread1"].Abort(); //abort of current thread } } if you need support, feel free to pm me
  18. i would implent the check in a pulse method(runs every x seconds), add stopwatch and attach luaevents that reads your combat actions. If a spell was cast it resets your stopwatch (maybe attach also "PLAYER_ENTER_COMBAT" & "PLAYER_LEAVE_COMBAT") to control itself. Here how it could look like: private System.Diagnostics.Stopwatch ActionTimer; public void Initialize() { //... EventsLuaWithArgs.OnEventsLuaWithArgs += Events; EventsLua.AttachEventLua(LuaEventsId.PLAYER_ENTER_COMBAT, m => Event_PLAYER_ENTER_COMBAT()); EventsLua.AttachEventLua(LuaEventsId.PLAYER_LEAVE_COMBAT, m => Event_PLAYER_LEAVE_COMBAT()); } public void Events(LuaEventsId id, List<string> args) { //everytime something happens it will write it here //for e.g. try to cast a spell and lookup which args was used for (int i = 0; i < 11; i++) { Logging.Write("\nArg"+i+" contains: "+args[i]); } //example if (args[0] == "player" && (args[2] == "SPELL1") || (args[2] == "SPELL2")) //arg[0] is probably fine but check args[2] if it contains any spellname { if (ObjectManager.Me.InCombat) { Logging.Write("reset stopwatch"); ActionTimer.Reset(); if (!ActionTimer.IsRunning) ActionTimer.Start(); } } } public void Pulse()//or any other method thats ticks every x seconds { if (ActionTimer.ElapsedMilliseconds >= 5000) { ActionTimer.Reset(); Lua.LuaDoString("RunMacroText('/reload')"); } } public void Event_PLAYER_ENTER_COMBAT() { ActionTimer.Reset(); ActionTimer.Start(); } public void Event_PLAYER_LEAVE_COMBAT() { ActionTimer.Reset(); ActionTimer.Stop(); }
  19. Hello, i would replace it by this: public bool NpcExist(string name) { foreach (var unit in ObjectManager.GetObjectWoWUnit()) { if (unit.Name == name && !unit.IsDead && unit.GetDistance <= RealmHopSettings.CurrentSetting.DistanceBeforeHopping) Logging.Write("Unit found."); return true; } return false; } Usage: if (NpcExist("Warbringer")) { //your code } or if you want the ordered npc list by distance: public List<Npc> GetNearestNpcs(string name) { return ObjectManager.GetObjectWoWUnit().Where(i => i != null && !i.IsDead && i.GetDistance <= RealmHopSettings.CurrentSetting.DistanceBeforeHopping ).OrderBy(i => ObjectManager.Me.Position.DistanceTo(i.Position)).ToList(); } Usage to get closest WoWUnit: GetNearestNpcs("Warbringer").FirstOrDefault(); I couldn't test it but it should work :)
  20. Version 1.2.0

    781 downloads

    EvadeHate stops fights with evading npcs and blacklist it. Currently it only works for english clients. If you encounter any problems feel free to post a log with the proceedings and information about the used product, fightclass & a screenshot of the situation would be helpful. Additional features: -take screenshot on evaded npc -fight back if npc is attacking the player again (currently it only detects the player's target - bugged combatlog) => since new changes to combatlog, a new version can be expected, if other projects are done Any Ideas, suggestions? Please leave your feedback here.
  21. Yes you can by memory writing(i haven'nt found another way for it) here is a method: public void SetRotation(float rotation) { uint rot = Memory.WowMemory.Memory.ReadUInt32(ObjectManager.Me.GetBaseAddress + 280U); Memory.WowMemory.Memory.WriteFloat(rot + 28U, rotation); } But the rotation needs to be updated with another small movement like a jump or short strafe to actually change the rotation to the server :)
  22. hi, im looking for something to execute my code e.g. by a macro ingame => /applypoison Any suggestions?
×
×
  • Create New...