|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
etioplmld Advanced Cheater Reputation: 0
Joined: 09 Feb 2021 Posts: 72
|
Posted: Sat May 13, 2023 1:23 am Post subject: address Filter for no access |
|
|
In the built-in game of Window, it has code access one time per second.In the results containing time address,If you use this code to check, it will step by step select all addresses。address Filter not working。
If setbp (i) is placed outside createTimer(), it will instantly select all addresses
How to make the filter work?
Code: |
f = createForm(true)
f.Position=poDesktopCenter
f.Width=500
f.Height=220
f.Caption = 'checkForAccess'
local lb = createLabel(f)
lb.Left=44
lb.Top=30
lb.caption='adress'
lb.Color = 16777215
local font=lb.Font
font.Size = 22
font.Color = 0xff0000
debugProcess()
local fl = getMainForm().Foundlist3
ckAccess = 0
function setbp(i)
debug_setBreakpoint(fl.Items[i-1].Caption, 1, bptAccess, function() ckAccess = 1 end)
if ckAccess == 0 then
fl.Items[i-1].Selected = true
end
debug_removeBreakpoint(fl.Items[i-1].Caption)
end
for i=1,fl.Items.Count do
createTimer(2000*i,function() lb.caption=fl.Items[i-1].Caption;setbp(i) end )
end
|
Description: |
|
Filesize: |
18.79 KB |
Viewed: |
1078 Time(s) |
|
|
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 31
Joined: 16 Feb 2017 Posts: 1234
|
Posted: Sat May 13, 2023 12:02 pm Post subject: |
|
|
Here is an example.
https://forum.cheatengine.org/viewtopic.php?p=5685269
Or filter and remove if the address value changes;
( Source: https://forum.cheatengine.org/viewtopic.php?p=5685269 )
Code: | function autoFilterFoundList()
fl = getMainForm().Foundlist3
local input = "currentValue ~= previousValue"
local filter = assert(loadstring("local address, currentValue, previousValue = ...; return " .. input))
results = {}
local miRemove
for i=0, fl.PopupMenu.Items.Count-1 do
if fl.PopupMenu.Items[i].Name == "Removeselectedaddresses1" then
miRemove = fl.PopupMenu.Items[i]
break
end
end
for i=0, fl.Items.Count-1 do
currentValue=fl.Items[i].SubItems[0]
print(i,currentValue)
previousValue=fl.Items[i].SubItems[1]
if currentValue~=previousValue then
results[#results+1] = i
end
end
for i,k in pairs(results) do
fl.Items[k].Selected = filter(fl.Items[k].Caption, fl.Items[k].SubItems[0], fl.Items[k].SubItems[1]) == true
print(i.." - "..fl.Items[k].Caption)
miRemove.DoClick()
end
end
if filterTmr then filterTmr.Destroy() filterTmr=nil end
filterTmr=cretaeTimer()
filterTmr.Interval=2000 --2 sec.
filterTmr.OnTimer=autoFilterFoundList
filterTmr.Enabled=true -- filter start .. false = filter stop .. |
_________________
|
|
Back to top |
|
|
etioplmld Advanced Cheater Reputation: 0
Joined: 09 Feb 2021 Posts: 72
|
Posted: Sat May 13, 2023 4:58 pm Post subject: |
|
|
no ,No problem with Foundlist3.
Code: |
local fl = getMainForm().Foundlist3
print(fl.Items[0].Caption) --address
print(fl.Items[0].SubItems[0]) -- value
print(fl.Items[0].SubItems[1]) -- previous value
|
fl.Items[i-1].Selected = true work well
Code: |
for i=1,fl.Items.Count do
createTimer(2000*i,function() )
end
|
the code seems to mean creating a bunch of timers,Execute each function at i seconds.
so
The access should be checked at the next timer,
but the first one did not need check, while the last one requires a timer to check without debug_setBreakpoint.
If there are too many addresses and timers, CE may crash,Iterative timer will More complex.
|
|
Back to top |
|
|
etioplmld Advanced Cheater Reputation: 0
Joined: 09 Feb 2021 Posts: 72
|
Posted: Wed May 24, 2023 9:49 pm Post subject: |
|
|
The first address is the target address, only it has code access.If the this code is executed individually, it selects all addresses. All of ckAccess[i-1] is 0.
Code: |
f = createForm(true)
f.Position=poDesktopCenter
f.Width=500
f.Height=220
f.Caption = 'checkForAccess'
local lb = createLabel(f)
lb.Left=44
lb.Top=30
lb.caption='adress'
lb.Color = 16777215
local font=lb.Font
font.Size = 22
font.Color = 0xff0000
debugProcess()
local fl = getMainForm().Foundlist3
ckAccess = {}
function countdown()
local i = 0
local t = createTimer()
t.Interval = 1000
t.OnTimer = function()
if i>=1 then -- check previous bp
if i<= fl.Items.Count then
if ckAccess[i-1] == 0 then
fl.Items[i-1].Selected = true
debug_removeBreakpoint(fl.Items[i-1].Caption)
end
end
end
if i< fl.Items.Count then -- set bp
ckAccess[i] =0
debug_setBreakpoint(fl.Items[i].Caption, 1, bptAccess, function() ckAccess[i] = 1 end)
lb.caption=fl.Items[i].Caption
end
i = i + 1
if i > fl.Items.Count then
t.Destroy()
end
end
end
countdown()
|
After multiple attempts to confirm, due to some mysterious reason, using the timer in this way will fail
Code: |
local cctimer = createTimer()
cctimer.Interval = 1000
i = 0
function countdown()
i=i + 1
print(i)
if i>= 5 then
object_destroy(cctimer)
end
end
cctimer.OnTimer = countdown
function countdown()
local i = 0
local t = createTimer()
t.Interval = 1000
t.OnTimer = function()
i = i + 1
print(i)
if i>=5 then
t.Destroy()
end
end
end
countdown()
|
|
|
Back to top |
|
|
|
|
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
|
|