Jump to content

Lua Logbook Sorter


dlder

Recommended Posts

Posted (edited)

idk if this is the right thread for that, but it seemed "closest", so here it goes...

After some error or other I needed to compare my backed up "MissionEditor\logbook.lua" to the current one that seemed to be missing entries.

I usually do this via Notepad++ compare but for whatever reason, some of the lines were no longer at the same place as before, and the compare tool didn't manage to "Detect Moves", so I had a lot of "false positives", meaning differences between the files that actually weren't there.

So, I had to sort the LUA files. But how? I found nothing, not for Notepad++, nor for Lua.

So I wrote - with the help of Google^^ - the attached lua script. (I use the Lua plugin for NP++ to execute it)

If you change the filepath to your Saved Games folder it will read it and print the sorted data. You can then copy this text and paste it into a new Notepad++ file.
Do this with the copy of the lua file too.
You can now compare those two files and you'll find any differences.

It's still a bit of a chore, as you then need to go into the actual logbook.lua and edit it manually (copy the missing/changed lines from the backup file), but at least it's now possible to actually see the differences.

Maybe someone has a use for this. I'm a LUA n00b and had to search my a$$ off to find and cobble together that nested sort function^^

Cheers!SortedLuaTableOutput.lua

 


Edited by dlder

OpenXR-Switcher: to easily switch OpenXR runtimes as well as en-/disable API layers

Kneeboard-Picture-Viewer: my own take on a Kneeboard for a 2nd monitor, that acts more or less as a better picture viewer.

F-15CX mod: my own take on a simple F-15C upgrade

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...