View previous topic :: View next topic |
Author |
Message |
Birdi Expert Cheater Reputation: 0
Joined: 08 Jun 2020 Posts: 122 Location: Migrating
|
Posted: Thu Jul 22, 2021 4:14 am Post subject: Load Recent via Script? |
|
|
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 |
|
|
LeFiXER Grandmaster Cheater Supreme Reputation: 20
Joined: 02 Sep 2011 Posts: 1054 Location: 0x90
|
Posted: Thu Jul 22, 2021 6:03 am Post subject: |
|
|
As in load the last opened table?
|
|
Back to top |
|
|
ByTransient Expert Cheater Reputation: 5
Joined: 05 Sep 2020 Posts: 240
|
Posted: Thu Jul 22, 2021 2:51 pm Post subject: |
|
|
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 |
|
|
Birdi Expert Cheater Reputation: 0
Joined: 08 Jun 2020 Posts: 122 Location: Migrating
|
Posted: Thu Jul 22, 2021 10:11 pm Post subject: |
|
|
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 |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Fri Jul 23, 2021 1:14 am Post subject: |
|
|
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 |
|
|
Birdi Expert Cheater Reputation: 0
Joined: 08 Jun 2020 Posts: 122 Location: Migrating
|
Posted: Fri Jul 23, 2021 10:28 am Post subject: |
|
|
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 |
|
|
|