View previous topic :: View next topic |
Author |
Message |
Kamd Cheater Reputation: 1
Joined: 02 May 2018 Posts: 28
|
Posted: Tue Nov 13, 2018 6:11 pm Post subject: CE 6.8+ makes printing new lines as "\r\n" instead |
|
|
EDIT: Appears that this is due to a Windows update and not CE itself
As of Cheat Engine 6.8 and above, the Lua print command will not output "\n" as a new line, instead I have to use "\r\n"
For example:
Code: | print("hello\nworld") | prints:
helloworld
Code: | print("hello\r\nworld") | prints:
hello
world
Is there any way to make "\n" work again?
Last edited by Kamd on Tue Nov 13, 2018 7:59 pm; edited 1 time in total |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25295 Location: The netherlands
|
Posted: Tue Nov 13, 2018 6:28 pm Post subject: |
|
|
Perhaps some system setting on your windows install. Did you recently update windows ?
\n won't work in 6.7 (or 6.8)
\n\r also won't work in 6.7 (or 6.8)
Wait for 6.9 which scans for /n and then splits up the lines into separate strings before sending it to the output (TMemo object) _________________
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 |
|
|
Kamd Cheater Reputation: 1
Joined: 02 May 2018 Posts: 28
|
Posted: Tue Nov 13, 2018 7:29 pm Post subject: |
|
|
Yeah, I think it's due to Windows. Just tried on CE 6.6 right now, and "\n" still doesn't work.
I'll have to wait for 6.9. Thanks. |
|
Back to top |
|
|
AylinCE Grandmaster Cheater Supreme Reputation: 32
Joined: 16 Feb 2017 Posts: 1257
|
Posted: Tue Nov 13, 2018 7:37 pm Post subject: Re: CE 6.8+ makes printing new lines as "\r\n" ins |
|
|
Kamd wrote: |
Is there any way to make "\n" work again? |
You can use a memo for now, Example:
Code: | form = createForm(true)
form.Position = poDesktopCenter
form.Width = 200
form.Height = 100
memo1 = createMemo(form)
memo1.Top = 0
memo1.Left = 0
memo1.Width = form.Width
memo1.Height = form.Height
memo1.Lines.Text = "hello\nworld\nhello\nworld" |
_________________
|
|
Back to top |
|
|
Kamd Cheater Reputation: 1
Joined: 02 May 2018 Posts: 28
|
Posted: Tue Nov 13, 2018 8:27 pm Post subject: Re: CE 6.8+ makes printing new lines as "\r\n" ins |
|
|
Aylin wrote: | You can use a memo for now |
Thanks for your suggestion. However I want to stick with print and not memo
Here is my simple workaround for now:
Code: |
function print2(text)
local newTxt = text:gsub("\n","\r\n")
print(newTxt)
end
print2("hello\nworld")
|
My main concern is for existing scripts/no-window trainers which rely on print "\n" for newline. |
|
Back to top |
|
|
panraven Grandmaster Cheater Reputation: 55
Joined: 01 Oct 2008 Posts: 942
|
Posted: Tue Nov 13, 2018 11:32 pm Post subject: |
|
|
was being blocked before, don't why...
http://fearlessrevolution.com/viewtopic.php?f=16&t=8249
... has been unblocked?
ADDED:
modify the line containing 'select' allow to post.
previous post:
---------------
You may make an autorun lua script to replace print function:
Code: |
if not ori_print then
crlf, ori_print, print = "\r\n", print, function(...)
local r, sel = {}, select
for i=1,sel("#",...)do r[i]=tostring(sel(i,...)) end
return ori_print( (table.concat(r,"\t"):gsub("[\r]*[\n]",crlf)) )
end
end
--- test
local ss = "a test\n\n\r\r\n\n2test"
ori_print(1,nil,2,3,4,ss)
print(1,nil,2,3,4,ss)
-- output on console look like (being edited)
1 2 3 4 a test
2test
1 nil 2 3 4 a test
2test
|
_________________
- Retarded. |
|
Back to top |
|
|
Kamd Cheater Reputation: 1
Joined: 02 May 2018 Posts: 28
|
Posted: Thu Nov 15, 2018 7:59 pm Post subject: |
|
|
panraven wrote: | You may make an autorun lua script to replace print function: |
Nice! I'll use this, thanks |
|
Back to top |
|
|
|