Jump to content

Recommended Posts

	start = os.time()
timeout = 1
stop = start + timeout
f = 0
m = {}
while stop > os.time() do
    m[f] = 'Iter N. '..f
    f = f + 1
end
print(m)
os.exit() 
	

Output:

	Script terminato:
    [75781] = 'Iter N. 75781',
    [75782] = 'Iter N. 75782',
    [75783] = 'Iter N. 75783',
    ***
    [85140] = 'Iter N. 85140',
    [85141] = 'Iter N. 85141',
    [    0] = 'Iter N. 0',
}
	Uscita.
	

Share this post


Link to post
Share on other sites

Because you asked the script to do this, yet you ask why he do this .. ?

Share this post


Link to post
Share on other sites

Thanks for the reply, but I don't understand what happened to the values from 1 to 75780. I would like to get 0, 1, 2, etc

Share this post


Link to post
Share on other sites

Output limited few last lines. Obviously it is cropped when you try out unreal amount of text.

Share this post


Link to post
Share on other sites
Posted (edited)

If you want to read fully. Use

start = os.time()
timeout = 1
stop = start + timeout
f = 0
m = "";
while stop > os.time() do
  	m = m .. "Iter N. ".. f .. "\n"
    f = f + 1
end
io.open("/sdcard/Download/Output.lua","w"):write(m) 
os.exit() 
	

this can get full content with no text limit.

Edited by ItsSC
typo, re-edit into Enyby's advise

Share this post


Link to post
Share on other sites
3 minutes ago, ItsSC said:

tostirng(m)

Can simply ended OOM.

Better write line by line directly to file, instead of store in table. It is very expensive and eat a lot of memory.

[added 4 minutes later]

gg.saveVariable also better suit for this because especially optimized for work with huge tables without OOM.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...