View previous topic :: View next topic |
Author |
Message |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Fri Feb 26, 2016 2:59 am Post subject: How to save settings from edit box or check box? |
|
|
Is there a way to save the settings from the edit box or check box? And load it when the user opens the trainer next time? Thanks a lot.
Update: I just found the "string_saveTofile(filename)" function, is it the one I need? I'm gone try to use it and see what I get.[/code]
Last edited by Dr.Disrespect on Fri Feb 26, 2016 3:25 am; edited 1 time in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Fri Feb 26, 2016 3:25 am Post subject: |
|
|
https://github.com/cheat-engine/cheat-engine/blob/master/Cheat%20Engine/bin/main.lua
something like this:
in the onclose event of the form:
Code: |
local s=getSettings('mytrainer')
s.Value['editbox value']=formname.editbox.Text
if formname.checkox.Checked then
s.Value['checkbox state']='1'
else
s. Value['checkbox state'] ='0'
end
s.destroy()
|
and after showing the form:
Code: |
local s=getSettings('mytrainer')
formname.editbox.Text=s.Value['editbox value']
formname.checkbox.Checked=s.Value['checkbox state'] =='1'
s.destroy()
|
_________________
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 |
|
 |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Fri Feb 26, 2016 3:39 am Post subject: |
|
|
Dark Byte wrote: |
something like this:
in the onclose event of the form:
Code: |
local s=getSettings('mytrainer')
s.Value['editbox value']=formname.editbox.Text
if formname.checkox.Checked then
s.Value['checkbox state']='1'
else
s. Value['checkbox state'] ='0'
end
s.destroy()
|
and after showing the form:
Code: |
local s=getSettings('mytrainer')
formname.editbox.Text=s.Value['editbox value']
formname.checkbox.Checked=s.Value['checkbox state'] =='1'
s.destroy()
|
|
Thanks for the reply. But I don't quite understand, even after I read the main.lua file. Is 'mytrainer' suppose to be the name of my form? And what if I want to save two editbox value? For example, the name of my form is "CETrainter', and I want to save the values of two editboxes with the name "CEEdit1" and "CEEdit2".
Should I do the following?
Code: |
local s=getSettings(CETrainer)
s.Value[CETrainer.CEEdit1]=formname.editbox.Text
s.Value[CETrainer.CEEdit2]=formname.editbox.Text
|
Update: Oh, did you mean this?
Code: |
local s=getSettings('CETrainer')
s.Value['editbox1 value']=CETrainer.CEEdit1.Text
s.Value['editbox2 value']=CETrainer.CEEdit2.Text
|
Last edited by Dr.Disrespect on Fri Feb 26, 2016 3:50 am; edited 1 time in total |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25778 Location: The netherlands
|
Posted: Fri Feb 26, 2016 3:50 am Post subject: |
|
|
"mytrainer" can be any string you like. This way you can make sure no other trainer/table overrides your settings
same for the names of the settings
e.g:
Code: |
s.Value['whatever I like']=TheNameOfMyTrainerForm.CEEdit1.Text
|
_________________
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 |
|
 |
Dr.Disrespect Grandmaster Cheater
Reputation: 3
Joined: 17 Feb 2016 Posts: 526
|
Posted: Fri Feb 26, 2016 3:51 am Post subject: |
|
|
Dark Byte wrote: | "mytrainer" can be any string you like. This way you can make sure no other trainer/table overrides your settings
same for the names of the settings
e.g:
Code: |
s.Value['whatever I like']=TheNameOfMyTrainerForm.CEEdit1.Text
|
|
Thanks a lot, I figured that out and updated my previous post. I was so dumb. LOL. Thanks again.
Update: its working, thnx a lot! CE is so powerful !!!!
|
|
Back to top |
|
 |
|