Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to update an address stored in a variable automatically?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
mitosu7410
How do I cheat?
Reputation: 0

Joined: 31 Oct 2022
Posts: 7

PostPosted: Tue Apr 04, 2023 3:18 am    Post subject: How to update an address stored in a variable automatically? Reply with quote

I want to update an address stored in a variable automatically.
Here is my CT.

Code:

[ENABLE]
{$lua}
function table.copy(t)
  local u = { }
  for k, v in pairs(t) do u[k] = v end
  return setmetatable(u, getmetatable(t))
end

if syntaxcheck then return end
FirstMonsAdd = readBytes("[Cemu.exe+1306438]+02e5caa24",4,true)

temp1 = table.copy(FirstMonsAdd)
FirstMonsAdd[1] = temp1[4]
FirstMonsAdd[2] = temp1[3]
FirstMonsAdd[3] = temp1[2]
FirstMonsAdd[4] = temp1[1]
FirstMonsAddOut = byteTableToDword(FirstMonsAdd)

[DISABLE]


This is used for Monster Hunter 3G by Cemu, WiiU emulator.
Function "table.copy" is for converting an address ordered by big endian into little endian in order to use the address with Cheat Engine.

I use this script to show monster's HP.
A value stored at [Cemu.exe+1306438]+02e5caa24 has monster's information address.

HP address is located at $CemuBase+$FirstMonsAddOut+8B8
($CemuBase is a base address of an Cemu emulator)

Problem is that I have to reenable this script every time when target monster is changed since every monster has different address.
I want to make an address of "FirstMonsAddOut" update automatically.
How can I do that?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites