Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Script by Savage_Me55iah of CraftAU.com.au--
- --Other Savage_Me55iah scripts @ http://pastebin.com/u/Savage_Me55iah
- --INSTRUCTIONS ON USE--
- --Instruction video on http://youtube.com/savagemessiah5
- --Contact Savage_Me55iah @ CraftAU.com.au or Nuqube.co or http://www.computercraft.info/forums2/ with suggestions/fixes/bugs
- local scriptName = "Installer_Autocrafter"
- fileDetail = fileDetail or {}
- fileDetail[scriptName] = {["version"] = 0.1, ["pastebin"] = "5fvYzdDQ"}
- function runPastebin(param_filename, param_pastebinCode) shell.run("pastebin get "..param_pastebinCode.." "..param_filename) end
- local tArgs = {...}
- if tostring(tArgs[1]) == "update" then runPastebin("installer", fileDetail["Installer_Autocrafter"]["pastebin"]) end
- local files = {
- ["DataStore"] = {
- ["currentLog"] = {},
- ["previousLog"] = {},
- ["Errors"] = {}
- },
- ["Program"] = {
- ["CC_AutoCrafter"] = "gECkmMyg"
- },
- ["Run"] = "ZtUrtP3p",
- ["sm_API"] = {
- ["loadAPIs"] = "0FMzFMsP",
- ["logger"] = "9zBzHK0N",
- ["generalinfo"] = "4a8jhYMe",
- ["booleanmanip"] = "irkktmgP",
- ["tablemanip"] = "1FxrRa1w",
- ["eventmanip"] = "AijGThy5",
- ["coroutinemanip"] = "MrMAuAkc",
- ["buttonmanip"] = "qtD3jeMK"
- }
- }
- -- BACKSLASH WAS MESSING WITH MY SCRIPT EDITOR
- function insertBS()
- local result = "\\"
- return result
- end
- createFileStructure = nil
- function createFileStructureF(...) local result = nil if tostring(createFileStructure) ~= "nil" then result = createFileStructure(...) end return result end
- function createFileStructure(param_directory, param_next)
- for a,b in pairs(param_next) do
- if type(b) == "table" then
- local directory = nil
- if tostring(param_directory) ~= "nil" then
- directory = param_directory..insertBS()..a
- else
- directory = a
- end
- if not fs.exists(directory) then
- fs.makeDir(directory)
- end
- createFileStructureF(directory, b)
- elseif type(b) == "string" then
- if tostring(param_directory) ~= "nil" then
- directory = param_directory..insertBS()..a
- else
- directory = a
- end
- if fs.exists(directory) then
- fs.delete(directory)
- print("replacing: "..directory)
- end
- runPastebin(directory, b)
- end
- end
- end
- createFileStructureF(nil, files)
- print("Installation completed")
- print("run script >run< to start")
Advertisement
Add Comment
Please, Sign In to add comment