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 


Search records for spefic texts

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

Joined: 08 Oct 2012
Posts: 586

PostPosted: Tue Feb 15, 2022 2:00 pm    Post subject: Search records for spefic texts Reply with quote

I know that Excel has the ability to search cells for "strings" containing certain text.
What I'd like to do is to search all the records in a table for the text swim, it will be a partial and may be anywhere in a description. This is an old table and has over 2k records. Any thoughts?
Back to top
View user's profile Send private message Yahoo Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Feb 15, 2022 2:48 pm    Post subject: Reply with quote

If, by table, you are referring to a cheat table, then you can use notepad++.
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Tue Feb 15, 2022 4:51 pm    Post subject: Reply with quote

Well, yes, but that wouldn't allow any value manipulations.
Back to top
View user's profile Send private message Yahoo Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Feb 15, 2022 5:27 pm    Post subject: Reply with quote

Perhaps it would be more helpful if you can explain more regarding what you are trying to accomplish.

Regarding Notepad++, you can search and replace all text, but I can still only guess if that would be beneficial for you.
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Tue Feb 15, 2022 7:17 pm    Post subject: Reply with quote

++METHOS wrote:
Perhaps it would be more helpful if you can explain more regarding what you are trying to accomplish.

Regarding Notepad++, you can search and replace all text, but I can still only guess if that would be beneficial for you.


Find those records that have swim and modify the values.
Back to top
View user's profile Send private message Yahoo Messenger
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Tue Feb 15, 2022 8:01 pm    Post subject: Reply with quote

Still not clear. I am sorry.
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 958

PostPosted: Tue Feb 15, 2022 8:31 pm    Post subject: Reply with quote

To enumerate the memory records,
Code:

local al = getAddressList()
for i=1,al.Count do
  local mr = al[i-1]
--  check mr eg. is mr.Description has 'swim'?
  if mr.Description:lower():find'swim' then -- lower() for case insensitive
-- do thing on it
  end
end

_________________
- Retarded.
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Wed Feb 16, 2022 8:00 am    Post subject: Reply with quote

panraven wrote:
To enumerate the memory records,
Code:

local al = getAddressList()
for i=1,al.Count do
  local mr = al[i-1]
--  check mr eg. is mr.Description has 'swim'?
  if mr.Description:lower():find'swim' then -- lower() for case insensitive
-- do thing on it
  end
end


The find was new to me and the first three lines are what I had, but for some reason I'm getting an error on step three:attempt to call a userdata value(global al) Script error
Back to top
View user's profile Send private message Yahoo Messenger
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 958

PostPosted: Wed Feb 16, 2022 8:38 am    Post subject: Reply with quote

Would you mind share the code so far?
_________________
- Retarded.
Back to top
View user's profile Send private message
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Wed Feb 16, 2022 10:18 am    Post subject: Reply with quote

Code:
al = getAddressList()
for i = 1, al.count do
mr = al(i)
if mr.Description:find"Swim" then
print(mr)
end
end

I looked in the table an the partial was Swim full Swimming


Last edited by bknight2602 on Wed Feb 16, 2022 1:39 pm; edited 1 time in total
Back to top
View user's profile Send private message Yahoo Messenger
TheyCallMeTim13
Wiki Contributor
Reputation: 51

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Wed Feb 16, 2022 11:50 am    Post subject: Reply with quote

You're using parentheses which makes it a function call. You need to be using the square brackets. i.e. change "al(i)" to "al[i]".
_________________
Back to top
View user's profile Send private message Visit poster's website
bknight2602
Grandmaster Cheater
Reputation: 0

Joined: 08 Oct 2012
Posts: 586

PostPosted: Wed Feb 16, 2022 1:42 pm    Post subject: Reply with quote

TheyCallMeTim13 wrote:
You're using parentheses which makes it a function call. You need to be using the square brackets. i.e. change "al(i)" to "al[i]".

Code:
al = getAddressList()
for i = 1, al.count do
mr = al[i-1]
if mr.Description:find"Swim" then
print(mr.Description)
end
end


Works, thanks to all.
Back to top
View user's profile Send private message Yahoo Messenger
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