Advertisement
Naheulf

ComputerCraft/setup_nft.lua

Oct 20th, 2020 (edited)
2,522
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. -- pastebin.com/UxF3Muqi
  2. -- This program check/install the "nft" module
  3. -- if it's not available.
  4. -- Installed version come from
  5. -- cc-tweaked-1.15.2-1.90.0
  6.  
  7. function is_module_available()
  8.   local path = "/cc/image/nft.lua"
  9.   if fs.exists("/rom/modules/main"..path) then
  10.     return true
  11.   end
  12.   if fs.exists(path) then
  13.     return true
  14.   end
  15.   return false
  16. end
  17.  
  18. function dl(code, file)
  19.   return shell.run("pastebin get", code, file)
  20. end
  21.  
  22. function install_module()
  23.   dl("ZBJaV1Ci", "/cc/image/nft.lua")
  24.   dl("kbDve0Lz", "/cc/expect.lua")
  25. end
  26.  
  27. if not is_module_available() then
  28.   install_module()
  29. end  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement