[C#][Source] BlackRain - Simple Object Manager Library menu

User Tag List

Page 4 of 14 FirstFirst 12345678 ... LastLast
Results 46 to 60 of 196
  1. #46
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    I actually ditched the entire 'object searching' method, in favor of (faster) LINQ queries.
    ---SNIP---
    Apoc, isn't LINQ slower because the keywords used by LINQ are syntactic sugar for invoactions to a set of generic routines that iterates collections and filtering through lambda expressions, meaning less possibilities for optimization? I may very well be wrong though...

    [C#][Source] BlackRain - Simple Object Manager Library
  2. #47
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jackedy129 View Post
    I've copied and pasted your code exactly (apart from readonly, for somereason it won't compile with that there), yet am getting NullReferenceException errors when reading health, wow is open and logged in etc. Any chance of a heads up?

    Code:
    Process[] _wowProc = Process.GetProcessesByName("Wow");
    int pid = _wowProc[0].Id; // Will grab the first WoW process found. (0th element)
    ObjectManager.Initialize(pid);
    int playerHealth = ObjectManager.Me.Health;
    Which version are you using?

    Originally Posted by Robske View Post
    ...

    From the post:
    Alright, I missed something obvious.

  3. #48
    uliena1979's Avatar Member
    Reputation
    1
    Join Date
    Nov 2007
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to populate ObjectManager.Me first.
    You can do that with ObjectManager.Pulse()

    Originally Posted by Jackedy129 View Post
    I've copied and pasted your code exactly (apart from readonly, for somereason it won't compile with that there), yet am getting NullReferenceException errors when reading health, wow is open and logged in etc. Any chance of a heads up?

    Code:
    Process[] _wowProc = Process.GetProcessesByName("Wow");
    int pid = _wowProc[0].Id; // Will grab the first WoW process found. (0th element)
    ObjectManager.Initialize(pid);
    int playerHealth = ObjectManager.Me.Health;

  4. #49
    Jackedy129's Avatar Member
    Reputation
    1
    Join Date
    Apr 2009
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im using Pulse now and health comes out as -3753472532?? And using latest version.

  5. #50
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jackedy129 View Post
    Im using Pulse now and health comes out as -3753472532?? And using latest version.
    You're right, it did initialize ObjectManage.Me, and populated it, but didn't read the descriptors appropriately. That has been fixed, and a new revision is up on the SVN and as a download, which should display your health properly:

    [23/04/2010 14:49:38] - Type: 4
    BaseAddress: 0x775334xxx
    GUID: 360287xxxx2076xxxx
    Health: 69
    Location: 1680.705,-4443.605,19.18787
    And the testing code I used:

    Code:
    lst_Objects.Items.Add("Me Type: " + ObjectManager.Me.Type);
                lst_Objects.Items.Add(string.Format("Me BaseAddress: 0x{0:X}", ObjectManager.Me.BaseAddress));
                lst_Objects.Items.Add("Me GUID: " + ObjectManager.Me.GUID);
                lst_Objects.Items.Add(ObjectManager.Me.ToString());
                lst_Objects.Items.Add(ObjectManager.Me.Health);
    The only problem I've run into is that when you foreach loop WowPlayer, it throws an exception about not being able to convert WowItem to WowPlayer. Yet have to find out where that originates.

    Anyway, download the new lib/src and you should be going again.


  6. #51
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As a sidenote, if you want to rely on Blackmagic, so might want to try the new 1.1 version with built-in asm support I think. Didn't test it, but API seems to be quite the same. Get it from GameDeception.com.
    Sooner or later I would suggest to write your own memory implementation is a more Apoc-style with generics and IntPtr instead of uint addresses for some people on x64.
    One big advantage of .net 4, and that was because I downloaded the VS 10 RC at that time, is, that IntPtr got the long awaited offset operator and .Add/Substract methods. While not affecting efficiency it is a gratification for my eyes to use
    Code:
    Memory.Read<IntPtr>(BaseAddress + 0x546548);
    instead of something like
    Code:
    Memory.Read<IntPtr>(new IntPtr(BaseAddress.ToInt64() + 0x546548));
    Great to see someone doing something for the beginners in this forum to get an insight into how to combine all that source snippets

    EDIT: Forget about what I said about the Blackmagic 1.1 and the fasm dependency. I just examined the project and I haven't noticed any changes.
    Last edited by Bananenbrot; 04-24-2010 at 02:47 PM.

  7. #52
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I might implement an IntPtr based memory library at a later point in time, but as of now, BlackMagic does its job perfectly. I'm based on an x64 system myself, and haven't had any trouble at all with BlackMagic, or fasm_managed.

    Currently, I'm working on better and more detailed Exception handling, and logging. Thanks for the suggestion.

  8. #53
    solttu's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Seifer View Post

    The only problem I've run into is that when you foreach loop WowPlayer, it throws an exception about not being able to convert WowItem to WowPlayer. Yet have to find out where that originates.
    It also throws an exception when I try to foreach loop WowGameObjects.

    InvalidCastException was unhandled

    Unable to cast object of type 'BlackRain.Common.Objects.WowItem' to type 'BlackRain.Common.Objects.WowGameObject'.
    Last edited by solttu; 05-02-2010 at 09:15 AM.

  9. #54
    Apoc's Avatar Angry Penguin
    Reputation
    1387
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I already explained to seifer why it was throwing exceptions, and how to fix it.

    Code:
    foreach(var obj in ObjectList.OfType<WowPlayer>()) { DoStuff(); }
    You can't convert a WoWItem to a WoWPlayer. Go read up on OOP, and how inheritance works.

  10. #55
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Apoc View Post
    I already explained to seifer why it was throwing exceptions, and how to fix it.

    Code:
    foreach(var obj in ObjectList.OfType<WowPlayer>()) { DoStuff(); }
    You can't convert a WoWItem to a WoWPlayer. Go read up on OOP, and how inheritance works.

    Correct, I've just been extremely lazy and haven't got around to updating it. I do plan on doing this sometime in the near future.

  11. #56
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, I've been rate lazy and finally kicked my own bollocks into updating this again. Should've done it long ago, since Apoc just spoon-fed the solution, basically.

    This update will fix the problem people had with the "Unable to cast object of type 'BlackRain.Common.Objects.WowItem' to type 'BlackRain.Common.Objects.WowGameObject'.".

    Where we used to do:
    Code:
    foreach (WowPlayer obj in ObjectManager.Objects)
    We now do:
    Code:
    foreach (WowPlayer obj in ObjectManager.Objects.OfType<WowPlayer>())
    This requires the System.Linq reference in the file where you are calling the list, and the Type.
    Somewhere in the coming weeks I'll be kicking this rig up again, and use LINQ to get Object "Searching" done, and make this something proper and up to standards again.

    Small push to the SVN to reflect these changes. Enjoy.

    // Edit - No bins this time around, everything you need is on the SVN. If you want the "latest compiled binary", even though changes are extremely minimal; grab it from the SVN.

    Last edited by Seifer; 05-31-2010 at 07:14 AM.

  12. #57
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm doing it with a single query and mostly with named paramters.
    The actual implementation is (needless to say) ugly, especially the prototype:
    Code:
    public static IEnumerable<T> Search<T>(int minLevel = int.MinValue, int maxLevel = int.MaxValue, int exactLevel = int.MaxValue, 
                bool? dead = null, bool? canAttack = null, bool lineOfSight = false, bool includeMe = true, string name = "",
                float minDistance = float.MinValue, float maxDistance = float.MaxValue, ulong guid = 0) 
                where T: WoWObject
            {
                if (guid != 0)
                    return new T[] { GetObjectByGuid(guid) as T };
    
                var query = ObjectList.OfType<T>();
    
                if (exactLevel != int.MaxValue)
                    query = query.Where(o => (o as WoWUnit).Level == exactLevel);
                else
                {
                    if (minLevel != int.MinValue)
                        query = query.Where(o => (o as WoWUnit).Level >= minLevel);
                    if (maxLevel != int.MinValue)
                        query = query.Where(o => (o as WoWUnit).Level <= maxLevel);
                }
    
                if (dead.HasValue)
                    query = query.Where(o => (o as WoWUnit).IsDead == dead);
                if (canAttack.HasValue)
                    query = query.Where(o => (o as WoWUnit).IsCritter == !canAttack);
                if (lineOfSight)
                    query = query.Where(o => o.IsInLineOfSight);
                if (!includeMe)
                    query = query.Where(o => !(o as WoWUnit).IsMe);
    
                if(minDistance != float.MinValue)
                    query = query.Where(o => o.Distance(ObjectManager.Me) >= minDistance);
                if(maxDistance != float.MaxValue)
                    query = query.Where(o => o.Distance(ObjectManager.Me) <= maxDistance);
    
                return query;
            }
    Searching for an object boils down to something like:
    Code:
    var nextMob = ObjectManager.Search<WoWUnit>(
        minLevel: 1, 
        maxLevel: 3, 
        dead: false, 
        canAttack: true, 
        includeMe: false,
    ).OrderBy(u => u.Distance(ObjectManager.Me)).First();

  13. #58
    ~Unknown~'s Avatar Contributor
    Reputation
    193
    Join Date
    Jan 2009
    Posts
    211
    Thanks G/R
    0/5
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice work on the library. Few questions though. I'm just wondering why you aren't using a dictionary structure for your wow objects. I always thought it was a better data structure for that, but I could be mistaken. Also, have you planned on using locks in the manager at some point for use in multi-threaded applications?

  14. #59
    Seifer's Avatar Site Donator
    Reputation
    129
    Join Date
    Apr 2007
    Posts
    270
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by ~Unknown~ View Post
    Very nice work on the library. Few questions though. I'm just wondering why you aren't using a dictionary structure for your wow objects. I always thought it was a better data structure for that, but I could be mistaken. Also, have you planned on using locks in the manager at some point for use in multi-threaded applications?
    Thanks. And I prefer lists over dictionaries, because I have no reason whatsoever to use the TKey, TValue structure, I just want a list of my objects and then use LINQ to search what I need, rather than Dictionary[index] and Dictionarty.ContainsKey stuff, which - in my opinion - is just rubbish. Feel free to use dictionaries for it, though. :P

    And no, I don't plan to implement locks in the near future.


  15. #60
    Kryso's Avatar Active Member
    Reputation
    40
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I personally use Dictionary because in theory it should be faster than list when we are refreshing it, unless you are destroying and re-creating all objects in which case speed should be about the same.
    Tea and cake or death?!

Page 4 of 14 FirstFirst 12345678 ... LastLast

Similar Threads

  1. [C#][Source] Radar and Object Manager Tester / Verifier
    By xochi in forum WoW Memory Editing
    Replies: 18
    Last Post: 01-08-2011, 02:04 AM
  2. [Source] WPF Wow Object manager
    By !@^^@! in forum WoW Memory Editing
    Replies: 11
    Last Post: 01-26-2010, 04:13 PM
  3. Mobs missing from object manager.
    By RawrSnarl in forum WoW Memory Editing
    Replies: 23
    Last Post: 12-31-2008, 01:31 PM
  4. Object Manager
    By Shamun in forum WoW Memory Editing
    Replies: 11
    Last Post: 11-28-2008, 02:06 PM
  5. WoW Object Manager ?
    By discorly in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 07-28-2007, 06:34 PM
All times are GMT -5. The time now is 10:16 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search