So far i managed turning coords from d3 world to screen coords and managed to create MoveToPosition(double _x,double _y,double _z) function to performe click on diablo 3 world.
And it works on every screen resolution
I am starting to like this framework.
ileandroscan you share function MoveToPosition?
Credit goes to raler for posting this a month ago in this thread. Obviously you need to add the click functionality, but this converts a 3D vector containing in-game coords to a point on the screen.Code:public static Point FromD3toScreenCoords(Vector3 objectGameLocation) { Vector3 currentCharGameLoc = Game.Me.Location; double xd = objectGameLocation.X - currentCharGameLoc.X; double yd = objectGameLocation.Y - currentCharGameLoc.Y; double zd = objectGameLocation.Z - currentCharGameLoc.Z; double w = -0.515 * xd + -0.514 * yd + -0.686 * zd + 97.985; double X = (-1.682 * xd + 1.683 * yd + 0 * zd + 7.045e-3) / w; double Y = (-1.54 * xd + -1.539 * yd + 2.307 * zd + 6.161) / w; double width = Engine.Current.VideoPreferences.x0C_DisplayMode.x20_Width; double height = Engine.Current.VideoPreferences.x0C_DisplayMode.x24_Height; double aspectChange = (double)((double)width / (double)height) / (double)(4.0f / 3.0f); // 4:3 = default aspect ratio X /= aspectChange; float rX = (float)((X + 1) / 2 * width); float rY = (float)((1 - Y) / 2 * height); return new Point((int)rX, (int)rY); }
-B
Last edited by bitterbee; 06-13-2014 at 01:32 AM.
Yeah my biggest concern is to how to present the minimap. Currently it is outputting an image file every second of the minimap. The idea is to retrieve it using AJAX to provide a near real-time minimap overview of where the bot is. I hope to spend some of the weekend working on this project, and hopefully get to the point where I can interact with the bot using a web page
-B
Last edited by bitterbee; 06-13-2014 at 01:48 AM.
Hi axlrose,
I tried everything as you said, but I fell really dumb right now, maybe you can find my mistake, this is how I tried to get the scenes step by step:
then I doCode:public ObjectManager ObjectManager { get { return Dereference<ObjectManager>(0x01CE3814); } } public Storage x798_Storage { get { return Field<Storage>(0x798 ); } } public Container<SceneRaw> x1BC_Scenes { get { return Dereference<Container<SceneRaw>>(0x1BC); } } public T[] x11C_Items { get { return Dereference<T>(0x11C, x100_Capacity); } }while SceneRaw is a class I wrote inspired by Darthtons Code:Code:foreach (SceneRaw scr in (Engine.Current.ObjectManager.x798_Storage.x1BC_Scenes.x11C_Items)) { Console.WriteLine(scr.x0FC_MeshMinX); Console.WriteLine("ID: " + scr.x0E8_SceneSnoId); Console.WriteLine(scr.x100_MeshMinY); }
I tried getting a dump of the legacy scenes in the struct by changing the Containers generic type to Legacy.Scene andCode:public class SceneRaw : MemoryObject { public const int SizeOf = 0x2A8; public SceneRaw(ProcessMemory memory, int address) : base(memory, address) { } public int x000_id_scene { get { return Field<int>(0x000); } } // 0x000 public NavMeshRaw x004_Navmesh { get { return Field<NavMeshRaw>(0x004); } } // 0x004 public float x0FC_MeshMinX { get { return Field<float>(0x0FC); } } public float x100_MeshMinY { get { return Field<float>(0x100); } } public int x0E8_SceneSnoId { get { return Field<int>(0x0E8); } } }
but it throws ArgumentOutOfRangeException for the address, every time I use itCode:Enigma.D3.Helpers.CodeGeneratorHelper.GetDump<Enigma.D3.Legacy.Scene>(Engine.Current.ObjectManager.x798_Storage.x1BC_Scenes.x11C_Items)
NoCopyPaste
Last edited by NoCopyPaste; 06-13-2014 at 03:45 AM.
I solved this in an ugly, ugly way. Basically I measured the size of the minimap, and then simply remapping the X,Y screen coord to the minimap coord based on my own resolution. It worked for me so I didnt put a lot of effort in getting a generic solution that would work for all resolutions. Some time ago, some people were toying around with it in this thread but I don't know if they have working source code available or hints that could help you out in that manner.
Edit: I guess I should invest some time in learning how UI elements work since it would help me tremendiously.
Last edited by bitterbee; 06-13-2014 at 04:02 AM.
yep, you're right, the exception occurs while dereferring a Linked List from Legacy.Scene.
how would you recommend to use the dump on outdated structs like these? should I just print the pointer instead of trying to derefer it?
ok, thanks
then this is my dump:
I couldn't manage to upload the whole dump, because the upload manager didn't let me do so (not even zipped :/)
so it's only from the first 3 Scene Objects, does this help?
How do you view these dumps? is there a way to fit them into an excel-table or something? because right now it's pretty confusing^^
Tried just pasting it into Excel? That's what I do You might have to help Excel if it can't figure out to layout the data Split names by using the Convert Text to Columns Wizard - Excel
If it helps you then it helps ^^
i seem to get the scaling somewhat right, and remapped as you can see below, but it seems the angle is off, if i tilted the coordinate system by ~45 degrees left it would look correctly compared to the direction of my character, and now that i'm typing this it actually looks like i need to account for the direction of my character instead, back to the drawing board
Last edited by Thacai; 06-13-2014 at 10:30 AM. Reason: i need to be more humble...
Since you people seem really interested in a map hack I'll post/commit this later today or tomorrow. Have to finish some other stuff before I have time to deal with it. If anyone wanna be prepared, go learn WPF