Lua Script for main.lua?

Want Cheat Engine to do something specific and no idea how to do that, ask here. (From simple scripts to full trainers and extensions)
Post Reply
Enferno33
Expert Cheater
Expert Cheater
Posts: 173
Joined: Tue Dec 24, 2019 6:05 am
Reputation: 32

Lua Script for main.lua?

Post by Enferno33 »

I have a table with a drop down list, but every time that I choose what I want in the drop down list and close the game / table it resets. Is there a way to save my choices? I have been researching and seen that it was mentioned in the main.lua inside the CE main directory, however I cannot get it to work...

Here's my table:
Spoiler
[Link]
and this is it when I close the game / table and reopen:
Spoiler
[Link]
This is what I have inside the main.lua, but none of it saves my choices:

settings=getSettings('MyTable')
settings.Value['Empty']=0
settings.Value['Coins']=1
settings.Value['Bones']=2
settings.Value['Iron Ore']=3
settings.Value['Metal Flint']=4
settings.Value['Dwarven Stone']=5

settings=getSettings('MyTable')
--settings.Value['Empty']=settings.Value['Coins']
--settings.Value['Empty']=settings.Value['Bones']
--settings.Value['Empty']=settings.Value['Iron Ore']
--settings.Value['Empty']=settings.Value['Metal Flint']
--settings.Value['Empty']=settings.Value['Dwarven Stone']
--ID1=tonumber(settings.Value['Coins'])
--if ID1~=settings.Value['Empty'] then ID1=settings.Value['Coins']
--end

--ID1=0(settings.Value['Coins'])
--ID1=settings.Value['Coins']
--ID2=settings.Value['Bones']
--ID3=settings.Value['Iron Ore']
--ID4=settings.Value['Metal Flint']
--ID5=settings.Value['Dwarven Stone']

--if settings.Value['Empty']==0 then
--ID1=settings.Value['Coins']
--end

--if settings.Value~=nil then settings.Value=1
--end

--if (settings.Value ~= nil) then
-- settings.Value:write(settings.Value['Coins'])
--end

BTW: I did the -- to try each one differently to see. I know that the -- takes them out and I didn't use them all at once, these are just all of the different things that I've tried after searching for hours and finding different solutions. Some of them have syntax errors and some doesn't, but none of them work. Most of everything I find on the forums, etc. are for trainers and not tables, so that's probably my problem?

Is there any chance someone could show me how it's done, please?

Thank you!!

Post Reply

Who is online

Users browsing this forum: skytard