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 


Script to check and filter last bytes of result list

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

Joined: 16 Apr 2013
Posts: 97

PostPosted: Fri Mar 04, 2022 8:02 pm    Post subject: Script to check and filter last bytes of result list Reply with quote

Need a little help with my lua. A while back I made a script that would let me right click on an address in my result list and filter to an ending byte(s) I specified.

[img]https://imgur.com/rqqO5Qt[/img]
[img]https://imgur.com/Xp4FfmR[/img]

Code:
local foundList = getMainForm().Foundlist3

-- Set up item removal for click simulation
local menuItemRemove
for i=0, foundList.PopupMenu.Items.Count-1 do
  if foundList.PopupMenu.Items[i].Name == "Removeselectedaddresses1" then
    menuItemRemove = foundList.PopupMenu.Items[i]
    break
  end
end

-- Create menu item
local menuItem = createMenuItem(foundList.PopupMenu)
menuItem.Caption = "Remove Non-Matching Byte(s) From Result Set"

-- When menu item is clicked, run this function
menuItem.OnClick = function()
local mybytes = inputQuery("Posty's Byte Matcher", "Enter Byte(s) to match on then click OK", "")
  -- Store "Found" results total for for-loop below
  local foundList = getMainForm().Foundlist3

  local found = foundList.Items.Count
  for i = 0, found-1 do

    -- Store current and previous values
    local item = getMainForm().Foundlist3.Items[i]

  end

  -- Simulate a click on "Remove selected addresses", which will remove
  -- addresses selected from the above for-loop.
  menuItemRemove.DoClick()

end

-- Create new right-click menu item in results list
foundList.PopupMenu.Items.insert(menuItemRemove.MenuIndex+1, menuItem)


My HDD crashed a while back and I lost the working script. I know the working solution had something to do with using 'caption'. So, basically - as per the screen shot - if I enter 60 (for example), it'll remove all other addresses that don't have those last bytes (so only addresses that end in 60 will remain). I could enter as few or as many bytes as I want.
I can't seem to recreate it.

This makes it so much easier to refind an address, since (in my experience) the ending byte(s) will be the same for the target addy.
So, I can weed out a lot of bad results quickly. As the script is now, if I initiate the dialog (even if I hit cancel), it will remove ONLY the address I selected. Not the goal. lol
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Fri Mar 04, 2022 8:57 pm    Post subject: Reply with quote

The fast scan option "last digits" seems to do what you're describing.
_________________
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
Drivium
Advanced Cheater
Reputation: 0

Joined: 16 Apr 2013
Posts: 97

PostPosted: Sat Mar 05, 2022 10:34 am    Post subject: Reply with quote

OMG You're right. Well, problem solved I guess. haha Thank you! CE FTW
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