Версия для печати темы

Нажмите сюда для просмотра этой темы в обычном формате

UoKit.com Форумы _ UO Pilot в онлайн играх _ help me understand Readmem

Автор: Ramsiriuz 3.12.2023, 11:18

Hello, I want to create a script that presses F1 when it detects mana below 50. However, the issue is that I don't know how to correctly start the readme sequence of readme. Could help me interpret the data correctly, please? Currently, if I use the final memory value, it finds the maximum mana value, which in this case would be 90. But when I want to use the memory path, it doesn't find it and returns a value of -1.


Код

--lua
local pointer = readmem (0x00000354, "D")
pointer = readmem (pointer + 0x1E8, "D")
pointer = readmem (pointer + 0x4C, "D")
pointer = readmem (pointer + 0x18, "D")
pointer = readmem (pointer + 0x38, "D")
pointer = readmem (pointer + 0x18, "D")
pointer = readmem (pointer + 0x8, "D")
pointer = readmem (pointer + 0x578, "D")
msg(pointer)



I leave a complete image of the context so you can help me.
https://ibb.co/c3LvMsn

Автор: DarkMaster 3.12.2023, 15:20

i recommend to use
log(pointer)
after each readmem for you can see where it return wrong value.
probably log(dec2hex(pointer)) can be useful too.

Автор: Ramsiriuz 3.12.2023, 19:15

The problem is that I don't know which value to use as the first pointer, as you can see in the image there are several, I don't know how they should be correctly interpreted.

Автор: Aqualon 5.2.2024, 19:52

Цитата(Ramsiriuz @ 3.12.2023, 20:15) *

The problem is that I don't know which value to use as the first pointer, as you can see in the image there are several, I don't know how they should be correctly interpreted.

You missed base address of the process.
To get it:
1. Click "Add Address Manually" in CE.
2. Type in whatever goes before +00000354 as an address, in your case its THREADSTACK0
3. Click OK
4. Base address of process should be in "Address" column
Before +00000354 you should first read from base address.
So, here's how it should be:
Код

--lua
local BASE_ADDRESS = 0x00FF0000 -- here you should type YOUR base address
local pointer = readmem (BASE_ADDRESS, "D")
pointer = readmem (pointer + 0x00000354, "D")
-- ... rest of your offsets go there

Also, it is extremely important that pilot is bound to the window of the game.
You can either do it manually each time or by using workwindow function
Example of workwindow:
Код

--lua
workwindow(findwindow('YOUR WINDOW TITLE GOES HERE')[1][1])
-- ... rest of your code goes after

Русская версия Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)