View previous topic :: View next topic |
Author |
Message |
ParkourPenguin Grandmaster Cheater Supreme
Reputation: 63
Joined: 06 Jul 2014 Posts: 1919 Location: Arcadian Suburbia
|
Posted: Sat Jul 30, 2016 10:45 pm Post subject: Remove Results in Found List via Filter |
|
|
A little script I threw together.
It adds a menu item to the found list's right click menu with the caption "Remove addresses using filter". It allows you to remove records from the found list based on the records' addresses, current values, and previous values. Return true if you want to remove any given record.
All 3 parameters (address, currentValue, previousValue) are strings and should be cast to numbers if needed.
If you're hiding the previous value column, previousValue will not be valid. (the previous value isn't explicitly exposed to Lua AFAIK, and I'm not going to look through the disk for it)
Code: | -- initial declarations
local fl = getMainForm().Foundlist3
local input = "currentValue ~= previousValue"
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
assert(miRemove,"Remove addresses using filter failed; could not find Removeselectedaddresses1 menu item")
-- create menu item
local mi = createMenuItem(fl.PopupMenu)
mi.Caption = "Remove addresses using filter"
mi.OnClick = function()
--get the filter
input = inputQuery(mi.Caption, "Type Lua code resulting in a boolean value. Function declared as:\nfunction (address, currentValue, previousValue) : boolean", input)
if not input then return end
local filter = assert(loadstring("local address, currentValue, previousValue = ...; return " .. input))
-- select the items to remove
for i=0, fl.Items.Count-1 do
fl.Items[i].Selected = filter(fl.Items[i].Caption, fl.Items[i].SubItems[0], fl.Items[i].SubItems[1]) == true
end
-- execute the "Remove selected addresses" menu item
miRemove.DoClick()
end
-- add new menu item just after the "remove selected" menu item
fl.PopupMenu.Items.insert(miRemove.MenuIndex+1, mi) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
panraven Grandmaster Cheater
Reputation: 28
Joined: 01 Oct 2008 Posts: 689
|
Posted: Sun Jul 31, 2016 1:45 am Post subject: |
|
|
Thank you~
Dark Byte mentioned getCurrentMemscan().ScanResultFolder in forum,
checking that directory during scan, it seems previous result and also first result can be referenced by Lua file operation. I guess UNDO is previous result, TMP is current. UNDO only appeared after 2nd scan.
bye~
Description: |
|
Filesize: |
26.8 KB |
Viewed: |
11205 Time(s) |

|
_________________
- Retarded. |
|
Back to top |
|
 |
mbabo Cheater
Reputation: 0
Joined: 30 Jul 2016 Posts: 49
|
Posted: Sun Jul 31, 2016 2:08 am Post subject: Re: Remove Results in Found List via Filter |
|
|
ok i executed your script now to filter option shows up once i use it
a popup menu shows up telling me to type lua code resulting in Boolean
what should i type ?
Code: | tonumber(currentValue) ~= previousValue+5 and tonumber(currentValue) ~= previousValue-5 |
and it didn't work well because the remaining list is 200K
i think its huge number for a script to handle
is there any way to enhance to code to make it work faster
it works perfectly fine if the list is small
|
|
Back to top |
|
 |
ParkourPenguin Grandmaster Cheater Supreme
Reputation: 63
Joined: 06 Jul 2014 Posts: 1919 Location: Arcadian Suburbia
|
Posted: Sun Jul 31, 2016 10:19 am Post subject: |
|
|
panraven:
I knew about that; it's just I don't want to go through each file and parse the raw data.
mbabo:
Lua isn't a fast language. It's possible to increase the speed of it marginally the way it is now, but you should be able to get the scan results down to manageable levels with enough changed/unchanged value scans.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
 |
|