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 


FYI: redirect Print()

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

Joined: 20 Jul 2017
Posts: 122

PostPosted: Fri Dec 03, 2021 1:34 pm    Post subject: FYI: redirect Print() Reply with quote

CT table: [ https://www101.zippyshare.com/v/igKtT6It/file.html ]
additional info: [ https://imgur.com/a/lVyFDUl ]

I have been using this routine for some time in several of my tables, but recently replaced that feature using a Form. However: i wanted to extend that feature so that i could use it for any type of loging (to file/disk).

As proof of concept, you can just run the script: the 1st loop prints to the Lua window; the 2nd one to a file (edit script to your needs first)
As practical example, i "redirected" the 'Find out what address...' info to disk (in fact, using the 'break condition'). For this purpose, I evaluated a game's opcode that would basically grind my game to a halt (iow became unworkeable). As soon as i enabled the script, i got back in business - and even with some minor lag - i could still move around... (although this will surely have its limitations as well)
The idea is: to log all that info, add additional 'skips' to your script, which gradually will/should improve responsiveness more...

any suggestions to finetune/complete this routine are most welcome ofc.

Some remarks:
a. current routine i never used in practise; apart from the redirect, most logic sat in the report script itself
b. did not do any extensive testing: f.e. loging past the string's limitation
c. did some testing with 'stringlist': routine still works fine, but adds an empty line with each addition
(tried to remove it, but sofar no luck ~ C++ seems to have a method for dealing with emptly lines; did check CE github but no cigar it seems)
(looping the stringlist should do the trick though)
d. for completeness sake: CE's debug setting 'Wait after gui update' helps in those situations when even stopping log_process becomes irresponsive.
e. indirectly related to this topic: [ https://forum.cheatengine.org/viewtopic.php?t=618637 ]

ps: tried to attach table, but limit is 8 bytes (?) Rolling Eyes
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