Edit: my bad hadn't check good ActorCommonDataHelper
And btw i changed while loop to while (true) else it would drop me error
Do you have any demos using your tbh? Like interacting actors, lootings etc?
Edit: my bad hadn't check good ActorCommonDataHelper
And btw i changed while loop to while (true) else it would drop me error
Do you have any demos using your tbh? Like interacting actors, lootings etc?
Last edited by ileandros; 06-10-2014 at 08:02 PM.
Hey ileandros! I got a few simple code examples on my home computer which I can share with you once I get back from work (EU here). Basically, you'll want to be using the helpers that enigma provides us with in order to get the information you want. Also, the enums make it (a lot) easier to know what everything means everywhere.
-B
That was the missing point, thank you very much)
But there seem to be some offsets for the Scenes, from what I've seen Darthton gets these form the x798_Storage in the ObjectManager, I tried to rebuild his memory reading, but the values i get don't make any sense
has someone found them yet?
once again, thank you very much, enigma for your constant help
NoCopyPaste
Used a non-patched D3 client with new Enigma.D3? I suspect you did, a version check will be added on next commit.
Using my what? Interact how? I'm not making bot examples. But maybe someone else can.
Please share in public if you don't mind Or at least with me as well, maybe can be inspired by something and it's always nice to see what people do with this.
Those are "actual" scenes with live data and not just static definitions like all SNO objects are. There is some stuff in the Legacy namespace regarding those but I'm not planning on updating that.
Yeah that's the whole purpose of what I am doing at the moment - I want to test how far this can go using your framework The reason why I haven't posted anything yet is a mixture of both getting features done and trying to present parts of it in an understandable way for ileandros.
Does anyone know if there is an easy way to check whether you are in the main menu or actually in-game? An ugly way I found was to check for the worldid on the localacd. While this means it is possible to distinguish between town and areas on the map, assuming that null means being in the menu isn't necessarily true and it's nasty. Problem is that while I'm in the menu, a lot of stuff returns null (and with good reason) and therefore I'd like to know if anyone knows how to check for this in a better way.
- B
Nice to hear ObjectManager.Struct790 has several flag fields indicating various stages and types of load. Maybe you could play around with that. There is also ObjectManager.x040_GameGlobals.x01C which can be checked for 1, meaning in game. But this will say you're in game way before everything is loaded. Combining that with ObjectManager.x790.x40 and x60 should be able to give pretty accurate time of when you're "fully in" in a game.
What i do to check if I'm in town or in main menu or in the login page is:
For the main menu I check for the resume game button and then to perform a log in I check if it pressed, it's visibility.
For the login page I check for the login button.
For in game there are a lot of ways. You check the ui of anything that is standard in game.
What I do in my bot is: to check if I'm in town an if yes I return the name of the act.
So basically my function will check in town and if yes will return a string with the act's name else return false.
Post the examples even if they are not completed or wrong formatted so we can work on them all together or at least the two o us that are interested.
I will post you my codes as soon as I get home from work but they are in autoit.
Don't worry they are easy to understand
I'm back, been away for a while (sorry for the delayed response NoCopyPaste). I've ported Enigma's code to C++ so you'll have to think back in C#:
So for some more info on the NavCell topic:
- Player position is given by Actor.x0A4_WorldPosX / Y / Z
- For each Scene in ObjectManager().x798_Storage().x1BC_Scenes().x11C_Items() find the corresponding GlobalDefinitionContainer().SnoDefinition.x10_SnoItemAs<Autogenerated::Scene>() by matching Scene.x0E8_SceneSnoId() == Autogenerated::Scene.x00_SceneSnoId()
- GlobalDefinitionContainer is currently at 0x01CF596C in 2.0.6
- Get NavCells from Autogenerated::Scene with Autogenerated::Scene.x180_NavZoneDefinition().GetNavCells() (NavZoneDefinition as described by Enigma). My C++ looks like this
- Use corresponding Scene.x0FC_MeshMinX and Scene.x100_MeshMinY to offset the NavCell AABB coordinates NavCell.x00_Min.X / Y. This should transform the NavCell coordinates into world space (same as player position).Code:std::vector<NavCell> GetNavCells() { return Dereference<NavCell>(0x08, x10().x04_Size() / NavCell::SizeOf); }
- If you would be painting these you'll have to negate X and rotate all by 45° to match the minimap.
- As mentioned use NavCell.x18_Flags() & 1 for walkable cells.
BR
AxlRose
Last edited by axlrose; 06-11-2014 at 03:37 PM.
ileandros: Seeing that what seems to interest you the most is botting, I'll write a bit about what I am currently working on. I have two on-going projects, where the first is a bot based on state machine concepts and to explore how things work when using this framework in contrast to relying on pixel colors. It is currently waypoint-based (it works pretty well on fixed landscapes such as Warrior's Rest etc), which is why I'm following the discussion regarding NavCells closely. Why a bot? After RoS landed, the closure of the AH effectively rendered botting pointless, therefore it seemed as a good way to learn more about memory reading, AI and pathfinding.
My other project is heavily inspired by the minimap screenshots I saw on this forum lately, which revolves around adding additional information to the minimap using either a transparent form with click-through or hooking into the rendering directly (still experimenting with upsides and downsides of each).
The overall goal I want to achieve is to enable myself to control and administer the bot remotely using a web interface. This interface is currently used for managing waypoints for different zones, and to set cooldowns on my skills. One of my next steps is to publish my minimap information on this web interface.
Will I publish the full source code? Probably not. But if you have concrete concerns regarding specific details in terms of using this framework and/or aspects of how state machines can be used to support a diablo bot (there is quite a few ways of implementing a state machine), then I am more than willing to try and help you understand how it works.
Edit: Oh yea, and my chars are hardcore only, which means added focus on AI
-B
Last edited by bitterbee; 06-12-2014 at 08:03 AM.
Hi axelrose,
thanks for your answer
I did pretty much the same, when I tried to rebuild Darthtons code, but the Scene Data in the Storage seems to be a bit off
my Scene.x0E8_SceneSnoId() values are mostly 0 and the Scene.x0FC_MeshMinX and Scene.x100_MeshMinY give me some odd numbers as well.
Do these offsets work for you with the current patch?
And another thing, could you tell me how you got to these offsets so I can find them myself and contribute something to this project?
NoCopyPaste
Take care: The Scene in Legacy currently checked in is outdated. It has the SceneSnoId at x0DC_SceneSnoId. You have to use x0E8_SceneSnoId. Scene.x0FC_MeshMinX and Scene.x100_MeshMinY are floats not ints! Sorry for missing that info - I have been heaping up all sorts of small changes locally. If the numbers in the dumps look weird, switch to floating point and vice versa. If it still doesn't work, could you paste a dumped view from CodeGeneratorHelper::GetDump<Scene>() of your Scene data in Storage?
Yes! All's fine.
Global offsets an sizes via good old-fashioned magic and local offsets via GetDump() and searching :-).
Last edited by axlrose; 06-12-2014 at 12:07 PM.
Then why you told me that you have some examples using this framework and that you will share them since you won't?
Anyway the only reason that I will use this c# framework is to create a bot.
I have already created a bot but it is in autoit which is a monothreaded language an I want to move to a multi one.
I already created yesterday some functions to be able to move the hero and return coords from d3 world to desktop coords for accurate mousemoves.
Cheers
There are some very interesting projects from enigmas framework, many fun ideas.
Bitterbee I have done something similar to your project and have my web interface that shows a minimap and all character stats, if anyone is interested or has questions I can post samples of the code. My suggestion is to use Asp.Net Mvc5 great web framework to add a web layer to their project.
I wish to thank everyone for their contributions and discoveries, special thanks to enigma!