Здравствуйте, гость ( Вход | Регистрация )

 
Ответить в эту темуОткрыть новую тему
> help me understand Readmem
Ramsiriuz
сообщение 3.12.2023, 11:18
Сообщение #1


*

Registred
Сообщений: 2
Регистрация: 3.12.2023
Группа: Пользователи
Наличность: 0
Пользователь №: 20.670
Возраст: 25



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
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
DarkMaster
сообщение 3.12.2023, 15:20
Сообщение #2


***********

Модератор UOPilot
Сообщений: 9.467
Регистрация: 2.12.2008
Группа: Супермодераторы
Наличность: 27725
Пользователь №: 11.279



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.


--------------------
Скрипты UOPilot под заказ.
Консультации по UOpilot 15$/час.
Услуги Lua разработчика (не пилот, проекты, постоянка)
Disсоrd:
Kov____
Пользователь в онлайне!Delete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
Ramsiriuz
сообщение 3.12.2023, 19:15
Сообщение #3


*

Registred
Сообщений: 2
Регистрация: 3.12.2023
Группа: Пользователи
Наличность: 0
Пользователь №: 20.670
Возраст: 25



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.
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения
Aqualon
сообщение 5.2.2024, 19:52
Сообщение #4


**

Neophyte
Сообщений: 23
Регистрация: 21.3.2023
Группа: Пользователи
Наличность: 1
Пользователь №: 20.503
Возраст: 22



Цитата(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
Пользователь в офлайнеDelete PostОтправить личное сообщение
Вернуться в начало страницы
+Ответить с цитированием данного сообщения

Ответить в эту темуОткрыть новую тему
2 чел. читают эту тему (гостей: 2, скрытых пользователей: 0)
Пользователей: 0

 

- Текстовая версия | Версия для КПК Сейчас: 27.4.2024, 23:43
Designed by Nickostyle