Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Moves Kenshi mods out of your Steam workshop folder and in to your actual mods folder.
- -- Save this as a text file in your Kenshi folder, name it as "grabWorkshopMods.lua" or somesuch,
- -- double click to run.
- -- You can stick it somewhere else if you modify the WorkshopFolder and ModsFolder values.
- -- Lua VM required, I use 5.1 and can't tell you if other versions will work:
- -- https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/luaforwindows/LuaForWindows_v5.1.4-46.exe
- ------------------------------------------------------------
- local WorkshopFolder = "../../workshop/content/233860"
- local ModsFolder = "mods"
- ------------------------------------------------------------
- require "lfs"
- if WorkshopFolder:sub(2,2) ~= ":" then WorkshopFolder = lfs.currentdir() .. "/" .. WorkshopFolder end
- if ModsFolder:sub(2,2) ~= ":" then ModsFolder = lfs.currentdir() .. "/" .. ModsFolder end
- for entry in lfs.dir(WorkshopFolder) do if entry ~= "." and entry ~= ".." then
- local attribs = lfs.attributes(WorkshopFolder .. "/" .. entry)
- if attribs and attribs.mode == "directory" then
- local modname
- for filename in lfs.dir(WorkshopFolder .. "/" .. entry) do
- if filename:lower():sub(-4) == ".mod" then
- modname = filename
- break
- end
- end
- if modname then os.rename(WorkshopFolder .. "/" .. entry, ModsFolder .. "/" .. modname:sub(1, #modname - 4)) end
- end
- end end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement