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 


Really need help with strings!

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
alphanote2
How do I cheat?
Reputation: 0

Joined: 23 Sep 2014
Posts: 6

PostPosted: Tue Sep 23, 2014 7:03 pm    Post subject: Really need help with strings! Reply with quote

I need a FUNCTION that scans for TEXT1 and replaces all the found addresses to TEXT2... SO

a function like this;

Code:
FindAndReplaceString("TEXT TO FIND","TEXT TO REPLACE")
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Wed Sep 24, 2014 3:06 am    Post subject: Reply with quote

http://forum.cheatengine.org/viewtopic.php?p=5552058#5552058
Not sure why you don't use it.. or why you opened a new account..

In case you don't understand how it works heres explanation

That function (in the url above) does the following:
converts each letter and letter of the search string to base 16 value ( builds up an array of byte) and of the replace string to base 10 value, it inserts all bytes into array(table).

it connects all search table with a space between entry and entry (does not touch the replace table) and thus creates an array of byte.

It scans for the aob, and for each each result found it writes the replace table.


How to call it?
replaceString(string_in,string_out,ignore_length);

string_in - the string you want to find (input type string)
string_out - the string you want to replace with (input type string)
ignore_length - ignore length of the 2 strings given (like if you try write 4 character word into 3 character word, that can really mess up your game, since it it will override other stuff that comes after that string..) (input type boolean).

Example
replaceString("Hi","He")

Function will return true if found, we didn't have to insert the true as third parameter as the length between the 2 strings is equal.

But if we do this
replaceString("Hi","Bye")

The function will print "Not recommended to override shorter string with a longer string", since again it can override stuff that it shouldn't.

To ignore that, just call it in this way
replaceString("Hi","Bye",true)

This will ignore the length check and override the string.


Btw:
Replace replaceString with FindAndReplaceString if function name matters that much for you.. lol.

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25287
Location: The netherlands

PostPosted: Wed Sep 24, 2014 4:21 am    Post subject: Reply with quote

Perhaps he wants it in the same format as http://forum.cheatengine.org/viewtopic.php?p=5551510#5551510 but then for strings

He hasn't mentioned if it uses widestrings or not

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
alphanote2
How do I cheat?
Reputation: 0

Joined: 23 Sep 2014
Posts: 6

PostPosted: Wed Sep 24, 2014 7:16 am    Post subject: Yes Reply with quote

That format!!

I want to change a large string to a smaller string.

Searching for HOURS (at school ;3)

My old account couldn't post anymore.

I gave up and made this post.

Please Dark Byte, you're the only one that I've known to make those functions! I really need your help!
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