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 


Changing various values

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Affly
Cheater
Reputation: 1

Joined: 29 Sep 2013
Posts: 42

PostPosted: Tue Jan 05, 2016 6:24 am    Post subject: Changing various values Reply with quote

I want to cheat the inventory in a game. Each item is a individual entry in an array in the obtained order so 2 same items are in different spots.

An item is made of 4 bytes. First byte always follows the same rule and I want to change it so: 0X->0F, 4X->4F, 8X->8F, CX->CF. X in this case can be any value from 0 to F. The other 3 bytes can't be changed.

I added the adresses and tried to manually change them, however the sort by value function seems to breakdown after around 500 entries while I have ~2400 values to change.

I never touched Lua in depth so I don't know what I could use to achieve that result. Any help is apreciated.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Tue Jan 05, 2016 5:45 pm    Post subject: Reply with quote

If I understand you correctly:
Code:
local addrStart = 0x00000000
local addrEnd   = 0x00000000
local addrSize  = 4
for addr=addrStart,addrEnd,addrSize do
  local value = readBytes(addr, 1)
  value = bOr(value, 15)
  writeBytes(addr, value)
end
Back to top
View user's profile Send private message
Affly
Cheater
Reputation: 1

Joined: 29 Sep 2013
Posts: 42

PostPosted: Wed Jan 06, 2016 8:52 am    Post subject: Reply with quote

It's exactly what I needed. 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 -> Cheat Engine Lua Scripting 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