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 


Disable Lua Engine Echo Output?

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

Joined: 08 Oct 2015
Posts: 486

PostPosted: Tue Aug 02, 2016 7:55 pm    Post subject: Disable Lua Engine Echo Output? Reply with quote

Is there a way to disable Lua Engine echoing the executed code? TIA
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4695

PostPosted: Tue Aug 02, 2016 8:19 pm    Post subject: Reply with quote

If you want to stop it from stealing focus, deselect View -> Show on Print.

Otherwise, I guess you could override the print function. Example:
Code:
canprint = true
local printB = print
print = function(...)
  if canprint then
    printB(...)
  end
end

canprint = true
print("this will be printed")
canprint = false
print("this will not be printed")

_________________
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
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Tue Aug 02, 2016 8:33 pm    Post subject: Reply with quote

ParkourPenguin wrote:
If you want to stop it from stealing focus, deselect View -> Show on Print.

Otherwise, I guess you could override the print function. Example:
Code:
canprint = true
local printB = print
print = function(...)
  if canprint then
    printB(...)
  end
end

canprint = true
print("this will be printed")
canprint = false
print("this will not be printed")


I don't mean the stealing focus behavior, I meant that the Lua Engine always prints the executed code before the output. So if I have a long lua script that prints out a long list of data, I have to manually find and delete the script from the output log and not just select all copy paste my output data. I could always output whatever data I have to a io file but I would prefer to just write print().


Last edited by predprey on Tue Aug 02, 2016 8:41 pm; edited 2 times in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4695

PostPosted: Tue Aug 02, 2016 8:40 pm    Post subject: Reply with quote

Oh. I don't believe there's any official way of doing that.

Executing the code in the Lua script window won't show the code you executed. If you're already working on something, copy and paste whatever is inside of it into notepad or something and restore it after you're done.

You could also add this line of code at the beginning of the code to clear everything (including the script) from the console:
Code:
getLuaEngine().Menu.Items[0][4].doClick()

_________________
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
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Tue Aug 02, 2016 8:47 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Executing the code in the Lua script window won't show the code you executed.


doh! didn't think it would be so simple. i will do this, thanks.
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Fri Aug 05, 2016 7:53 pm    Post subject: Reply with quote

Or add this at beginning script to avoid Lua Engine pop-up

Code:

getLuaEngine().cbShowOnPrint.Checked=false
getLuaEngine().hide()
Back to top
View user's profile Send private message
dxxd
How do I cheat?
Reputation: 0

Joined: 20 Sep 2018
Posts: 3

PostPosted: Thu Mar 07, 2019 8:03 pm    Post subject: Reply with quote

Good way!
Corroder wrote:
Or add this at beginning script to avoid Lua Engine pop-up

Code:

getLuaEngine().cbShowOnPrint.Checked=false
getLuaEngine().hide()
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