Jump to content
  • 0

Create Random Any file name


Rizuki

Question

Hellow pro, master and mister can someone help me how can i create a file with random name

Example i want to create 50 or 100  file with random name using lua  how can i make please help me 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

math.randomseed(os.time())
for i = 1 , 50 do
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122))
io.open("/sdcard/Download/"..randName,"w"):write("This is mallicious file.")
end

 

Link to comment
Share on other sites

2 minutes ago, ItsSC said:

math.randomseed(os.time())
for i = 1 , 50 do
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122))
io.open("/sdcard/Download/"..randName,"w"):write("This is mallicious file.")
end

 

Thank master ☺️

Link to comment
Share on other sites

31 minutes ago, ItsSC said:

math.randomseed(os.time())
for i = 1 , 50 do
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122))
io.open("/sdcard/Download/"..randName,"w"):write("This is mallicious file.")
end

 

Master... Why file not created when i change to some location and also get error when changing to some location to?..

Link to comment
Share on other sites

1 minute ago, ItsSC said:

No idea what you changed.

math.randomseed(os.time()) 
for i = 1 , 50 do 
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122)) 
io.open("/storage/emulated/0/"..randName,"w"):write("This is mallicious file.") 
end

 

Location only i change

Link to comment
Share on other sites

4 minutes ago, Rizuki said:

math.randomseed(os.time()) 
for i = 1 , 50 do 
randName = string.char(math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122),math.random(97,122)) 
io.open("/storage/emulated/0/"..randName,"w"):write("This is mallicious file.") 
end

 

Location only i change

It works fine here. No error at all.

Link to comment
Share on other sites

3 minutes ago, ItsSC said:

It works fine here. No error at all.

Sorry bfo its working but file.created is hide hahaha 😂😂😂 but still thank you master i dont know why is hide when i only use gg to load lua a see it but in my storage is not appearing

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.