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 


Need help with an algorithm
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
mrally2
Cheater
Reputation: 0

Joined: 01 Apr 2020
Posts: 43

PostPosted: Tue Oct 10, 2023 2:05 pm    Post subject: Reply with quote

ParkourPenguin wrote:
mrally2 wrote:
When overwriting the spots to 0, gonna store all the values and their addresses into 2 separate arrays so I can restore them easily. Does this look convenient?

You mean store the values into one array and the addresses in a separate array? I'd couple them together. Maybe index values using their addresses, or make the table an array of other tables each containing an address and value.
Yes, exactly but your way seems a lot more sensible. Can you please make a quick example of each approach (index values vs table array)?

I have to use this method since hiding the jackspots with ASM (without overwriting the values inside the structure; just mov ecx,0 to hide) works fine until you access the jackspots through the easydrive menu to switch car (a simplified in-game menu that you can access without pausing the game). Once you do that and you spawn in the new vehicle, all jackspots appear again unfortunately. If I overwrite the jackspots permanently, this will be reflected inside the easydrive menu making the hidden jackspot vehicles to be unaccessible and there’s no other way to switch to them otherwise.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4718

PostPosted: Tue Oct 10, 2023 2:11 pm    Post subject: This post has 1 review(s) Reply with quote

Code:
local address = readPointer'registeredSymbolName'
local value = readInteger(address)

-- index by address
local t1 = {}
t1[address] = value
for addr, val in pairs(t1) do
  print(('%08X'):format(addr), val)
end

-- array of tables
local t2 = {}
t2[#t2+1] = { addr = address, val = value }
for _,t in ipairs(t2) do
  print(('%08X'):format(t.addr), t.val)
end

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
mrally2
Cheater
Reputation: 0

Joined: 01 Apr 2020
Posts: 43

PostPosted: Wed Oct 11, 2023 12:11 am    Post subject: Reply with quote

ParkourPenguin wrote:
Code:
local address = readPointer'registeredSymbolName'
local value = readInteger(address)

-- index by address
local t1 = {}
t1[address] = value
for addr, val in pairs(t1) do
  print(('%08X'):format(addr), val)
end

-- array of tables
local t2 = {}
t2[#t2+1] = { addr = address, val = value }
for _,t in ipairs(t2) do
  print(('%08X'):format(t.addr), t.val)
end
Perfect, thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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