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 


Load Recent via Script?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Birdi
Expert Cheater
Reputation: 0

Joined: 08 Jun 2020
Posts: 122
Location: Migrating

PostPosted: Thu Jul 22, 2021 4:14 am    Post subject: Load Recent via Script? Reply with quote

I'm just wondering if there's a way to access the "Load Recent" list and choose any of them, or at least the most recent one to effectively "reload" a table instantly, with Lua scripts.

I'm not sure how practical this option would be for anyone else but with how I've scripted something, resetting everything to 'defaults' would take a few thousand lines of code and that's just needless bloat compared to just a quick "reload".


Last edited by Birdi on Thu Jul 22, 2021 10:21 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1054
Location: 0x90

PostPosted: Thu Jul 22, 2021 6:03 am    Post subject: Reply with quote

As in load the last opened table?
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Thu Jul 22, 2021 2:51 pm    Post subject: Reply with quote

Follow this menu path.
Here is the solution that completely answers the problem;
Hover over CE (CE:Main Menu) >> File >> Load Recent > and see the list of your recently loaded tables.
Click the one you want from the list and CE will open that table and load it.
Back to top
View user's profile Send private message
Birdi
Expert Cheater
Reputation: 0

Joined: 08 Jun 2020
Posts: 122
Location: Migrating

PostPosted: Thu Jul 22, 2021 10:11 pm    Post subject: Reply with quote

I understand the manual option, but for end users that may not know it exists, I was just curious if you could make a script to do this basic task, considering how much of CE is observable in Lua.

It can probably be done with LoadTable(filename/stream) from Main.lua but I'm not sure of the file path base location (if it's from the table location if called via script or otherwise).
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Fri Jul 23, 2021 1:14 am    Post subject: Reply with quote

Code:

MainForm.File1.doClick() --init the list
for i=0,MainForm.miLoadRecent.Count-1 do
  if MainForm.miLoadRecent[i].Caption=='-' then break end
  print(MainForm.miLoadRecent[i].Caption)
end


you can do MainForm.miLoadRecent[#].doClick() to initiate the load (or use loadTable as it's just the path to the file)

_________________
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
Birdi
Expert Cheater
Reputation: 0

Joined: 08 Jun 2020
Posts: 122
Location: Migrating

PostPosted: Fri Jul 23, 2021 10:28 am    Post subject: Reply with quote

Thanks DB, perfect.

I do get an "Access Violation" error when running this script (CE is ran as admin) but it doesn't affect anything as far as I can tell.. it reloads fine.

Code:

[ENABLE]
{$lua}
MainForm.File1.doClick()                                    --init the list
for i=0,MainForm.miLoadRecent.Count-1 do                    --iterate through list
  if MainForm.miLoadRecent[i].Caption=='-' then break end   --Stop iterating at the end of the list
  local myVar = MainForm.miLoadRecent[i].Caption            --Store current iteration's table path in variable
  if string.find(myVar,'yourTableNameHere') then     --Check if it contains table name
     MainForm.miLoadRecent[i].doClick()                     --Reload that table if matches name
  end
end
{$asm}
[DISABLE]
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 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