View previous topic :: View next topic |
Author |
Message |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Sun Mar 06, 2022 10:55 am Post subject: Code to move table addresses into Group address |
|
|
What would be a code to move table addresses into a group address?
memfirst.Address = 070F759C
...
memlast.Address = 070F776C
into
Group.Address = ??[/img]
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1521
|
Posted: Sun Mar 06, 2022 1:39 pm Post subject: |
|
|
This code continues to supersede the new value without clearing the table.
If you want to empty the table at runtime use it:
Code: | memfirst={}
memlast={} |
Code: | Group={}
addr1=[[024CDE20
024D5B78
024DA0F0
06E11CB0
06E12624
06E129EC
06E12DB4]]
addr2=[[06E13360
06E13728
06E13AF0
06E14464
073E73E0
073ED830]]
function insertTblAdd(tbl,list)
n=#tbl
sl=createStringList()
sl.Text=list
for i=0, (sl.Count) - 1 do
n=tonumber(n) + 1
tbl[n]=sl[i]
end
end
memfirst={}
memlast={}
insertTblAdd(memfirst,addr1)
insertTblAdd(memlast,addr2)
table.insert(Group,1,memfirst)
table.insert(Group,2,memlast)
print(1,Group[1][2])
print(2,Group[2][4])
--for i,k in pairs(Group[1]) do
--print(k)
--end |
_________________
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Sun Mar 06, 2022 2:48 pm Post subject: |
|
|
Could this be accomplished in a for loop where memrec.Address that are equal to or greater memfirst.Address and less than or equal to memlast.Address?
To my knowledge the addresses are increasing in value.
ETA: There are 6 groups of ~300-350 records into 6 group headers.
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Sun Mar 06, 2022 3:02 pm Post subject: |
|
|
It's certainly possible with a loop, yes. You may require several loops to achieve what you want but it's feasible.
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1521
|
Posted: Sun Mar 06, 2022 5:50 pm Post subject: |
|
|
bknight2602 wrote: | Could this be accomplished in a for loop where memrec.Address that are equal to or greater memfirst.Address and less than or equal to memlast.Address?
To my knowledge the addresses are increasing in value.
ETA: There are 6 groups of ~300-350 records into 6 group headers. |
It was a somewhat complex statement.
I don't know if it would be helpful for you to compare them all out of order.
But we can try to compare lists sequentially.
One more note: Comparing addresses will not give very healthy results.
But if you want to compare address values, we can generate additional codes.
Could you explain your statement (question) a little more?
_________________
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Mon Mar 07, 2022 11:23 am Post subject: |
|
|
AylinCE wrote: | bknight2602 wrote: | Could this be accomplished in a for loop where memrec.Address that are equal to or greater memfirst.Address and less than or equal to memlast.Address?
To my knowledge the addresses are increasing in value.
ETA: There are 6 groups of ~300-350 records into 6 group headers. |
It was a somewhat complex statement.
I don't know if it would be helpful for you to compare them all out of order.
But we can try to compare lists sequentially.
One more note: Comparing addresses will not give very healthy results.
But if you want to compare address values, we can generate additional codes.
Could you explain your statement (question) a little more? |
Comparing address values seems logical if comparing the addresses themselves is not "healthy"
Um I don't know how to say it better than I have. Let me show an image of CE to demonstrate a small piece of the puzzle, actually I'll sow three images.
The bottom image is of the first few records all of the 1st... should move into the 1st Header.
The middle image is taken at the bottom of 1st beginning of the 2nd all the records should move into the appropriate header. Ill move the "attitudes into an attitude header since there are only a few. The top image is after moving the attitudes, leaving just the 2nd records. Is this a better description?
Description: |
|
Filesize: |
130.93 KB |
Viewed: |
4104 Time(s) |

|
Description: |
|
Filesize: |
237.49 KB |
Viewed: |
4104 Time(s) |

|
Description: |
|
Filesize: |
225.55 KB |
Viewed: |
4104 Time(s) |

|
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1521
|
Posted: Mon Mar 07, 2022 5:38 pm Post subject: |
|
|
A different approach.
Click on Lua Script >> File menu, select "New Tab" and try the below code in new tab.
Code: | Group={}
memfirst={}
memlast={}
function crtList(tbl,start,finish) --List the values in the range selected from the address list into the table
addressList = getAddressList()
addrCnt = addresslist_getCount(addressList)
for i=tonumber(start), addrCnt do
aa=addresslist_getMemoryRecord(addressList,i)
if i < tonumber(finish) then
table.insert(tbl, aa.Value)
end
end
--return table.sort(tbl)
end
function tblComp(t1,t2) --Take the larger of the compared value.
aa=""
if t1 < t2 then
aa=t2 --print("t2: " .. t2 .. " < " .. t1)
else
aa=t1 --print("t1: " .. t1 .. " < " .. t2)
end
return aa
end
crtList(memfirst,0,9) --Get list "memfirst" from address list
crtList(memlast,10,17) --Get list "memlast" from address list
table.insert(Group,1,memfirst) --Set "memfirst" as Group list 1.
table.insert(Group,2,memlast) --Set "memlast" as Group list 2.
print(1,Group[1][2]) --check
print(2,Group[2][4]) --check
function findTbl(t0,t1,t2) --Collide the tables and load the high value into a new table or whatever you write there.
g1=math.min(#t1,#t2) --If the table lengths are not the same, choosing the least fixes the error.
for i=1, g1 do
t0[i]=tblComp(t1[i],t2[i])
end
end
collapse={}
findTbl(collapse,Group[1],Group[2]) --use
--table control
for i,k in pairs(collapse) do
print(k)
end |
_________________
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Tue Mar 08, 2022 8:11 am Post subject: |
|
|
Stupid question, but where is the lua scrip new tab option? All I am able to find is add a new scan tab.
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1521
|
Posted: Tue Mar 08, 2022 9:50 am Post subject: |
|
|
CE Main Menu >> Table >> Show cheat table Lua Script
Lua Script: Cheat Table Main Menu >> File >> New Tab >> click ..
_________________
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Tue Mar 08, 2022 4:09 pm Post subject: |
|
|
This what I see, the add is for an additional scan tab. I guess I don't understand how code will be executed in a different table. Now if the code were runt in the debug window that sounds like a deal.
Description: |
|
Filesize: |
250.48 KB |
Viewed: |
3983 Time(s) |

|
Description: |
|
Filesize: |
227.86 KB |
Viewed: |
3983 Time(s) |

|
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1521
|
Posted: Tue Mar 08, 2022 4:45 pm Post subject: |
|
|
Yes I forgot 6.7.
The second picture is correct, but I don't remember if there is a "File >> New Tab" feature in Lua Script in 6.7.
If I remember correctly, you had 7.4 installed.
Open the current Trainer code in 7.4 and open the new tab I said and try.
_________________
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Wed Mar 09, 2022 11:50 am Post subject: |
|
|
In 7.4 all I "see" is to add another scan tab, now if you mean to add the attached code into the debug widow, that I can do. I I don't see any new tab other than a scan tab. What am I missing?
I haven't looked at the code, is there a place to input the starting and ending addresses? Or does the program work in between Header's 1st, 2nd etc.?
|
|
Back to top |
|
 |
LeFiXER Grandmaster Cheater Supreme
Reputation: 20
Joined: 02 Sep 2011 Posts: 1069 Location: 0x90
|
Posted: Wed Mar 09, 2022 12:02 pm Post subject: |
|
|
On the main Cheat Engine window press Ctrl, Alt + L in the new window press Ctrl, Shift + T
Here is the menu AylinCE is talking about:
|
|
Back to top |
|
 |
bknight2602 Grandmaster Cheater
Reputation: 0
Joined: 08 Oct 2012 Posts: 586
|
Posted: Wed Mar 09, 2022 1:05 pm Post subject: |
|
|
Strange this is what I have. Where is the script?
Description: |
|
Filesize: |
84.36 KB |
Viewed: |
3898 Time(s) |

|
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1521
|
Posted: Wed Mar 09, 2022 1:48 pm Post subject: |
|
|
Start from your last picture and follow the steps below with the "Table" in the 3rd row:
Code: | Table >> Show Cheat Table Lua Script
Lua Script: Cheat Table Main Menu >> File >> New Tab >> click .. |
EDIT:
I asked you to open the side tab with the advice of trying the code below.
Thus, it would be convenient for you to move the useful code to the main tab.
Here is your code:
AylinCE wrote: | A different approach.
Click on Lua Script >> File menu, select "New Tab" and try the below code in new tab.
Code: | Group={}
memfirst={}
memlast={}
function crtList(tbl,start,finish) --List the values in the range selected from the address list into the table
addressList = getAddressList()
addrCnt = addresslist_getCount(addressList)
for i=tonumber(start), addrCnt do
aa=addresslist_getMemoryRecord(addressList,i)
if i < tonumber(finish) then
table.insert(tbl, aa.Value)
end
end
--return table.sort(tbl)
end
function tblComp(t1,t2) --Take the larger of the compared value.
aa=""
if t1 < t2 then
aa=t2 --print("t2: " .. t2 .. " < " .. t1)
else
aa=t1 --print("t1: " .. t1 .. " < " .. t2)
end
return aa
end
crtList(memfirst,0,9) --Get list "memfirst" from address list
crtList(memlast,10,17) --Get list "memlast" from address list
table.insert(Group,1,memfirst) --Set "memfirst" as Group list 1.
table.insert(Group,2,memlast) --Set "memlast" as Group list 2.
print(1,Group[1][2]) --check
print(2,Group[2][4]) --check
function findTbl(t0,t1,t2) --Collide the tables and load the high value into a new table or whatever you write there.
g1=math.min(#t1,#t2) --If the table lengths are not the same, choosing the least fixes the error.
for i=1, g1 do
t0[i]=tblComp(t1[i],t2[i])
end
end
collapse={}
findTbl(collapse,Group[1],Group[2]) --use
--table control
for i,k in pairs(collapse) do
print(k)
end |
|
_________________
|
|
Back to top |
|
 |
|