Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- --- Generated by EmmyLua(https://github.com/EmmyLua)
- --- Created by holco.
- --- DateTime: 2/26/2022 7:06 PM
- ---
- local filesystem = require("filesystem");
- local component = require("component");
- local computer = require("computer");
- function tablelength(T)
- local count = 0
- for _ in pairs(T) do count = count + 1 end
- return count
- end
- print("Server Client Installer by Yaggy Corp");
- print("Are you sure you would like to install the CLIENT on this device?");
- local input = io.read();
- if input == "y" then
- local ifRun = true;
- print("Beginning Installation...")
- print("Verifying Computer...Please Make Sure ALL components are successfully installed");
- local redstoneComponents = tablelength(component.list("redstone"));
- local hv_capacitors = tablelength(component.list("ie_hv_capacitor"));
- local tanks = tablelength(component.list("ie_tank"));
- local currentTransformers = tablelength(component.list("ie_current_transformer"));
- if redstoneComponents > 7 then
- print("Too Many Redstone I/Os Attached To System")
- ifRun = false;
- elseif redstoneComponents < 7 then
- print("Not Enough Redstone I/Os Attached To System")
- ifRun = false;
- end
- if hv_capacitors > 24 then
- print("Too Many HV Capacitors found on system")
- print(hv_capacitors);
- ifRun = false;
- elseif hv_capacitors < 24 then
- print("Not Enough HV Capacitors found on system")
- ifRun = false;
- end
- if tanks > 2 then
- print("Too Many Tanks Attached To System")
- ifRun = false;
- elseif tanks < 2 then
- print("Not Enough Tanks Attached To System")
- print(tanks);
- ifRun = false;
- end
- if currentTransformers > 2 then
- print("Too Many Current Transformers Attached To System")
- ifRun = false;
- elseif currentTransformers < 2 then
- print("Not Enough Transformers Attached To System")
- ifRun = false;
- end
- if component.isAvailable == false then print("Wireless Network Card Not Found On System..."); ifRun = false; end
- if ifRun then
- print("Downloading Client Files...");
- if filesystem.exists("/home/Client.lua") then print("Client.lua already exists on device...deleting"); filesystem.remove("/home/Client.lua"); end
- os.execute("pastebin get EeijtFNZ /home/Client.lua");
- local file = io.open("/autorun.lua", "w");
- file:write("os.execute(\"/home/Client.lua\")");
- file:close()
- print("Client Software Successfully Installed");
- print("Would you like to reboot?");
- local input = io.read();
- if input == "y" then computer.shutdown(true); end
- else
- print("Error(s) have been found...Aborting.");
- end
- else
- print("Aborting...")
- end
Add Comment
Please, Sign In to add comment