Files
one-off-scripts/search_luanti_mods.lua

388 lines
7.3 KiB
Lua
Executable File

#!/usr/bin/env luajit
-- this list was manually assembled from my notes
local mods = {
"plutoniumships",
"stnodes",
"too_many_tnt",
"mesecons_carts",
"coloredstrings",
"grass_string",
"renewable_desert_stone",
"basic_materials",
"farming",
"x_farming",
"unifieddyes",
"xcompat",
"worldedit",
"home_workshop_modpack",
"plasticbox",
"steel",
"xdecor",
"technic",
"technic_recycle",
"plastic_bucket",
"uraniumstuff",
"anvil",
"hammers_redo",
"desertores",
"livingcaves",
"livingcavesmobs",
"roads",
"digilines",
"mesecons",
"moreblocks",
"digistuff",
"eye_spy",
"edit_skin",
"fishing_boat",
"whitelist",
"lib_chatcmdbuilder",
"carpets",
"digiterms",
"display_modpack",
"biofuel",
"automobiles_pck",
"nutrional",
"denseores",
"airtanks",
"handholds_redo",
"bike",
"pixelfurniture",
"airutils",
"ju52",
"ju52_hydro",
"supercub",
"hidroplane",
"heli",
"trike",
"pa28",
"spacecannon",
"accountmgr",
"farmtools",
"imese",
"scifi_nodes",
"beacons",
"dfcaverns",
"tunnelmaker",
"railbuilder",
"advtrains",
"advtrains_moreslopes",
"advtrains_platform",
"advtrains_horntrack",
"dlxtrains",
"classic_coaches",
"tfl_s7_stock_modpack",
"advtrains_train_rocket",
"advtrains_subway_ny",
"advtrains_train_orient_express",
"advtrains_train_jpntlr600",
"advtrains_transib",
"advtrains_freight_train",
"advtrains_bboe_1080",
"advtrains_db_160",
"advtrains_train_zugspitzbahn",
"ethereal",
"wihelminessound",
"datacard",
"x_enchanting",
"bucket_wooden",
"motorboat",
"mobkit",
"digicontrol",
"colorful_beds",
"discovery_maps",
"computertest",
"more_ladders",
"colored_chests",
"bonemeal",
"livingdesert",
"livingjungle",
"naturalbiomes",
"ambience",
"marinara",
"people",
"marinaramobs",
"nativevillages",
"winuserleafdecay",
"everness",
"cottages",
"towercrane",
"homedecor_modpack",
"pipeworks",
"lwcomponents",
"moretubes",
"omnidriver",
"plantlife_modpack",
"ebiomes",
"biome_lib",
"mobs",
"yl_api_nodestages",
"yl_canned_food",
"yl_canned_food_mtg",
"mobs_water",
"mobs_animal",
"glooptest",
"mobs_horse",
"mobs_mese_monster_classic",
"dmobs",
"travelnet",
"hangglider",
"fakelib",
"3d_armor",
"illumination",
"hazmat_suit",
"headlamp",
"technic_armor",
"unified_inventory",
"unified_inventory_plus",
"vizlib",
"cool_trees",
"powerbanks",
"mobs_monster",
"treecapitator",
"moretrees",
"moreores",
"toolranks",
"toolranks_extras",
"charcoal",
"awards",
"moreawards",
"ancient_bones",
"bakedclay",
"orienteering",
"ccompass",
"spacesuit",
"ropes",
"obsidianstuff",
"more_chests",
"multitools",
"luanti_utils",
"vines",
"morebricks",
"place_rotated",
"digtron",
"drawers",
"elevator",
"stamina",
"lavastuff",
"wetmud",
"geocache",
"locator",
"jumpdrive",
"loot",
"maple",
}
-- this list was obtained from running ls -1 in the worldmods directory
local current_mods = {
"3d_armor",
"accountmgr",
"advtrains",
"advtrains_bboe_1080",
"advtrains_db_160",
"advtrains_freight_train",
"advtrains_horntrack",
"advtrains_moreslopes",
"advtrains_platform",
"advtrains_subway_ny",
"advtrains_train_jpntlr600",
"advtrains_train_orient_express",
"advtrains_train_rocket",
"advtrains_train_zugspitzbahn",
"advtrains_transib",
"airtanks",
"airutils",
"ambience",
"ancient_bones",
"anvil",
"automobiles_pck",
"awards",
"bakedclay",
"basic_materials",
"beacons",
"bike",
"biofuel",
"biome_lib",
"bucket_wooden",
"carpets",
"ccompass",
"charcoal",
"classic_coaches",
"colored_chests",
"coloredstrings",
"colorful_beds",
"computertest",
"cool_trees",
"cottages",
"datacard",
"denseores",
"desertores",
"dfcaverns",
"digicontrol",
"digilines",
"digistuff",
"digiterms",
"digtron",
"discovery_maps",
"display_modpack",
"dlxtrains",
"dmobs",
"drawers",
"ebiomes",
"edit_skin",
"elevator",
"everness",
"eye_spy",
"fakelib",
"farming",
"farmtools",
"fishing_boat",
"geocache",
"grass_string",
"hammersredo",
"handholds_redo",
"hangglider",
"hazmat_suit",
"headlamp",
"heli",
"hidroplane",
"home_workshop_modpack",
"homedecor_modpack",
"illumination",
"ju52",
"ju52_hydro",
"jumpdrive",
"lavastuff",
"lib_chatcmdbuilder",
"livingcaves",
"livingcavesmobs",
"livingdesert",
"livingjungle",
"locator",
"lwcomponents",
"marinara",
"marinaramobs",
"mesecons",
"mesecons_carts",
"mob_horse",
"mob_mese_monster_classic",
"mobkit",
"mobs",
"mobs_animal",
"mobs_monster",
"mobs_water",
"more_chests",
"more_ladders",
"moreawards",
"moreblocks",
"morebricks",
"moreores",
"moretrees",
"moretubes",
"motorboat",
"multitools",
"nativevillages",
"naturalbiomes",
"nutritional",
"obsidianstuff",
"omnidriver",
"orienteering",
"pa28",
"people",
"pipeworks",
"pixelfurniture",
"place_rotated",
"plantlife_modpack",
"plastic_bucket",
"plasticbox",
"plutoniumships",
"powerbanks",
"railbuilder",
"renewable_desert_stone",
"roads",
"ropes",
"scifi_nodes",
"spacecannon",
"spacesuit",
"stamina",
"steel",
"stnodes",
"supercub",
"technic_armor",
"technic_plus",
"tfl_s7_stock_modpack",
"too_many_tnt",
"toolranks",
"toolranks_extras",
"towercrane",
"travelnet",
"treecapitator",
"trike",
"tunnelmaker",
"unified_inventory",
"unified_inventory_plus",
"unifieddyes",
"uraniumstuff",
"vizlib",
"wetmud",
"whitelist",
"wilhelminessounds",
"winuserleafdecay",
"worldedit",
"x_enchanting",
"x_farming",
"xcompat",
"xdecor",
"yl_api_nodestages",
"yl_canned_food",
"yl_canned_food_mtg",
}
local function uniqify_mods(mod_list)
print(#mod_list .. " mods listed.")
local unique = {}
for _, name in ipairs(mod_list) do unique[name] = true end
mod_list = {}
for name in pairs(unique) do mod_list[#mod_list + 1] = name end
print(#mod_list .. " unique.")
table.sort(mod_list)
return mod_list
end
local function open_mods_search(mod_list)
for i, name in ipairs(mod_list) do
print("Opening search for " .. name)
os.execute("open \"https://content.luanti.org/packages/?q=" .. name .. "\"")
os.execute("sleep 1") -- open creates race conditions with itself, so these are not opened in order, despite being called in order
if i % 9 == 0 then
print("Press enter to continue.")
io.read("*line")
end
end
end
local function detect_inconsistencies()
local mods_unique = {}
for _, name in ipairs(mods) do mods_unique[name] = true end
local current_mods_hashtable = {}
for _, name in ipairs(current_mods) do current_mods_hashtable[name] = true end
-- local missing_mods, overstated_mods = {}, {} -- I don't need to make the lists because they're so small.. I hope
for name in pairs(current_mods_hashtable) do
if not mods_unique[name] then print(name .. " missing from manual list.") end
end
print()
for name in pairs(mods_unique) do -- this list SHOULD exist, but already fixed in my markdown note
if not current_mods_hashtable[name] then print(name .. " listed, but was rejected.") end
end
print()
end
detect_inconsistencies()
open_mods_search(uniqify_mods(mods))