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 add found list to address list and change value

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

Joined: 19 Jan 2018
Posts: 1

PostPosted: Fri Jan 19, 2018 12:20 pm    Post subject: How to add found list to address list and change value Reply with quote

Hi I need to know how to add found addresses to the address list.
And then after that to replace the current value of the address with integer: 5000.

Sorry I'm fairly new to LUA scripts.
Here is what i have so far:

--initialize memory scan
--INITIALIZE MEMORY SCAN
ms=createMemScan()
ms.firstScan(soExactValue, vtGrouped, rtExtremerounded, "F:450 F:109.5445098877 F:20", "", 0, 0xffffffffffffffff, "", fsmAligned, "4", false, false, false, false)
ms.waitTillDone()

--POPULATE THE FOUNDLIST
f=createFoundList(ms);
f.initialize();

--ADD FOUNDLIST TO ADDRESSLIST
need the codes for this part

--CHANGE FIRST ADDRESS VALUE TO 5000
and this part
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Fri Jan 19, 2018 12:27 pm    Post subject: Reply with quote

From "celua.txt":
Code:

createFoundList(memscan)

properties
  Count: integer - Number of results found
  Address[index] : string - Returns the address as a string at the given index
  Value[index]: string - Returns the value as a string at the given index
  [index]: string - Same as Address

methods
  initialize() : Call this when a memscan has finished scanning. This will open the results for reading
  deinitialize() : Release the results
  getCount()
  getAddress(index) : Returns the address as a string
  getValue(index) : Returs the value as a string


Code:
writeInteger(f.getAddress(1), 5000)

or
Code:
writeInteger(f.Address[1], 5000)


you may want to check if there are results first

Code:
if f.Count ~= -1 then
    writeInteger(f.Address[1], 5000)
end


EDIT:
Some how missed the first part for adding to address list.

Code:
if f.Count ~= -1 then
   writeInteger(f.Address[1], 5000) -- Set value for the first one
   for i = 1, f.Count do
      if f.Address[i] ~= nil then -- if address then create memory record
         local mr = AddressList.createMemoryRecord()
         mr.Description = tostring(i) -- set description to then found index
         mr.Type = vtDword
         mr.Address = f.Address[i]
      end
   end
end

_________________
Back to top
View user's profile Send private message Visit poster's website
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