Advertisement
dstodev

(MC) Triggered Tank

Sep 23rd, 2017
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. -- OpenComputers Lib
  2. local sh = require("shell")
  3. local fs = require("filesystem")
  4.  
  5. -- Make library folder
  6. local PATH_LIB = sh.resolve("lib") .. "/"
  7. fs.makeDirectory(PATH_LIB)
  8.  
  9. -- Config
  10. local URL = "https://raw.githubusercontent.com/dstodev/MC-Fluid-Tank-Controller/master/lib/"
  11.  
  12. local function getlib(file)
  13.     local status, error = sh.execute("wget -f " .. URL .. file .. " " .. PATH_LIB .. file)
  14.     if status == false then
  15.         error("Could not retrieve " .. file .. "!")
  16.     end
  17. end
  18.  
  19. -- Get external libraries
  20. getlib("schmitt_trigger.lua")
  21. getlib("tank_control.lua")
  22. getlib("configurator.lua")
  23. getlib("event_loop.lua")
  24.  
  25. -- Start the program
  26. local status, config = sh.execute("lib/configurator.lua")
  27. local status, error = sh.execute("lib/tank_control.lua")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement