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 


Write file on the desktop.

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

Joined: 07 Jan 2016
Posts: 208
Location: My house

PostPosted: Wed Mar 01, 2017 3:57 pm    Post subject: Write file on the desktop. Reply with quote

In C / C ++ I can do this, but on moon I can not.
I've tried in many ways but always mistake.
Code:
FILE = io.open("%USERPROFILE%/Desktop/my_file.txt", "w")

Code:
FILE = io.open("%USERPROFILE%\\Desktop\\my_file.txt", "w")

Code:
FILE = io.open("%%USERPROFILE%%/Desktop/my_file.txt", "w")

Code:
FILE = io.open("%%USERPROFILE%%\\Desktop\\my_file.txt", "w")

_________________
...
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 146

Joined: 07 Nov 2008
Posts: 4133
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Wed Mar 01, 2017 4:07 pm    Post subject: Reply with quote

Code:
file = assert(io.open(os.getenv("USERPROFILE")..'\\desktop\\file.txt', 'w'))
file:write('two tea to room two.')
file:close()

_________________
Back to top
View user's profile Send private message MSN Messenger
Filipe_Br
Expert Cheater
Reputation: 2

Joined: 07 Jan 2016
Posts: 208
Location: My house

PostPosted: Wed Mar 01, 2017 4:11 pm    Post subject: Reply with quote

mgr.inz.Player wrote:
Code:
file = assert(io.open(os.getenv("USERPROFILE")..'\\desktop\\file.txt', 'w'))
file:write('two tea to room two.')
file:close()
Thank you, it worked!
_________________
...
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