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 


Working with Strings query

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

Joined: 08 Jun 2018
Posts: 25

PostPosted: Tue Dec 18, 2018 3:00 am    Post subject: Working with Strings query Reply with quote

Hi guys, I have a new idea for a script I want to write that involves a String address. In this game most enemy characters use the same attack skills and most of those skills inflict ailments that must be removed by using potions. I found a String Address that displays the latest Attack skill used on you but the problem is they aren't unique. I want to ask if there is a way to bypass this. For example

Raptor Shaman used Poison Shot

Goblin used Poison Shot

What im asking is can the names of the enemies be ignored so just the name of the skill remains. That way I can make the right potions activate from the corresponding skill used.
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 17

Joined: 01 Feb 2016
Posts: 1416

PostPosted: Tue Dec 18, 2018 4:23 am    Post subject: Reply with quote

parse it, until you find "used". (since "used" is not going to change)
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
patched cheat engine tutorials


Last edited by OldCheatEngineUser on Tue Dec 18, 2018 5:57 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
MikeNoey
Cheater
Reputation: 0

Joined: 08 Jun 2018
Posts: 25

PostPosted: Tue Dec 18, 2018 4:33 am    Post subject: Reply with quote

Thank you. Do you or anyone else mind posting an example of parsing in Lua or a link to a page with that information. Would much appreciate it
Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 17

Joined: 01 Feb 2016
Posts: 1416

PostPosted: Tue Dec 18, 2018 6:00 am    Post subject: Reply with quote

OldCheatEngineUser wrote:
parse it, until you find "used". (since "used" is not going to change)

and then get the text after "used"

i dont know lua, only assembly.
some users here can provide examples, or even write a full code.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
patched cheat engine tutorials
Back to top
View user's profile Send private message Visit poster's website
MikeNoey
Cheater
Reputation: 0

Joined: 08 Jun 2018
Posts: 25

PostPosted: Tue Dec 18, 2018 6:45 am    Post subject: Reply with quote

I believe I've found what I need courtesy of Dr.Disrespect and his code


words = {}
s = "This is a string"
for w in string.gmatch(s, "%a+") do
words[#words+1] = w
end

print(words[1])
print(words[2])
print(words[3])
print(words[4])

out will be:
This
is
a
string
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 68

Joined: 06 Jul 2014
Posts: 2171

PostPosted: Tue Dec 18, 2018 9:43 am    Post subject: Reply with quote

Alternatively:
Code:
local s = 'sdnke awerng used woker abeiutkn eij'

print(s:match'^.- used (.+)$')

_________________
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
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