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 


SaveDialog?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Fri Apr 15, 2016 12:35 am    Post subject: SaveDialog? Reply with quote

I want to save a txt file, but the following code did not work, I think I missed something.....:

Code:

function CEButton1Click(sender)
  load_dialog = createSaveDialog(sender)
  --load_dialog.InitalDir = os.getenv('%USERPROFILE%')
  load_dialog.execute()
end


Thanks in advance.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Fri Apr 15, 2016 2:12 am    Post subject: Reply with quote

It works for me.
Obvious question, but CEButton1Click is the OnClick event for the button? And the lua script has been executed ?

to get the file picked by the user read load_dialog.Filename

_________________
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
View user's profile Send private message MSN Messenger
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Fri Apr 15, 2016 3:12 am    Post subject: Reply with quote

Dark Byte wrote:
It works for me.
Obvious question, but CEButton1Click is the OnClick event for the button? And the lua script has been executed ?

to get the file picked by the user read load_dialog.Filename


Thanks for the reply. But it did not work until I changed the code to the following one:
Code:

function CEButton3Click(sender)
  load_dialog = createSaveDialog(sender)
  settingsList = createStringlist()
  if load_dialog.execute() then
    settingsList.saveToFile(load_dialog.Filename)
  end
  load_dialog.destroy()
  settingsList.destroy()
end

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