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 


Close Current CT

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Fri Aug 09, 2024 7:54 am    Post subject: Close Current CT Reply with quote

Is there a way to close the current cheat table without deleting the entries (since autosave will overwrite the original file)?
The cheat table contains addresses/scripts, comments and code list entries.

I think because this feature doesn't exist to my knowledge, someone is going to tell me to create an empty "cheattable.ct" in CE dir and call it when I want to close my cheat table using loadTable()

Tell me if there is another way thank you
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Fri Aug 09, 2024 8:02 am    Post subject: Reply with quote

autosave doesn't overwrite the original file. it saves it in "%localAppData%\Cheat Engine Autosave"

and yeah, just open an empty table

_________________
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
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Fri Aug 09, 2024 9:00 am    Post subject: Reply with quote

Okay, this is how I did it:

Code:
function closeCurrentCT()
    local filename = os.getenv("USERPROFILE").."\\Documents\\Empty.CT"
    local file = io.open(filename, "w")
    if file then
        file:close()
        --messageDialog("Success", "Empty cheat table has been created!", 2)
        loadTable(filename)
        os.remove(filename)
        --messageDialog("Success", "File has been remved!", 2)
    end
end
Back to top
View user's profile Send private message Visit poster's website
panraven
Grandmaster Cheater
Reputation: 62

Joined: 01 Oct 2008
Posts: 958

PostPosted: Fri Aug 09, 2024 12:08 pm    Post subject: Reply with quote

This may be the minimum code to 'load' an empty table (without saving current table?)
Code:

loadTable(createStringStream'<CheatTable></CheatTable>',false, true)


This make an menu item in File Menu to use it , can be save in autorun :
Code:

local mf = MainForm
local fileMi = mf.Menu.Items[0] -- files menu
if not fileMi._mi_LoadEmptyCT_ and fileMi.Count > 2 then
  local mi = createMenuItem(fileMi)
  mi.Name = '_mi_LoadEmptyCT_'
  mi.Caption = 'load Empty CT'
  mi.OnClick = function()loadTable(createStringStream'<CheatTable></CheatTable>',false, true)end
  fileMi.insert(fileMi.Count-2,mi)
end


Only that the empty table seems don't clear the saved symbolist, <del>clear dissect data structures tho.</del>, dissect data and codelist.

UPDATE: fixed.

_________________
- Retarded.


Last edited by panraven on Fri Aug 09, 2024 5:08 pm; edited 1 time in total
Back to top
View user's profile Send private message
Game Hacking Dojo
Master Cheater
Reputation: 1

Joined: 17 Sep 2023
Posts: 250

PostPosted: Fri Aug 09, 2024 1:16 pm    Post subject: Reply with quote

I was almost going to say that's perfect but upon testing, it doesn't clear the codelist. Thank you that was a good one really but since I want a perfect solution I'll stick to my approach


THANK YOU THAT ACTUALLY MADE ME FIND THIS WAY:

Code:
loadTable("")


This will clear everything


And if you combine it with this:

Code:
MainForm.actOpen.OnExecute=function()
  if MainForm.OpenDialog1.execute() then
    loadTable(MainForm.OpenDialog1.FileName)
  end
end

You would never get the prompt of "Do want to merge CTs" again
Back to top
View user's profile Send private message Visit poster's website
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