Advertisement
apemanzilla

bench webload

May 16th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. -- the source code for the program can be found at the link below
  2. -- https://github.com/bench-cc/bench
  3.  
  4. assert(http, "HTTP API is required.")
  5. assert(_HOST or _CC_VERSION, "CC 1.74+ is required.")
  6.  
  7. local f, e
  8. if fs.exists(".bench/bench.lua") then
  9.     --f, e = loadfile(".bench/bench.lua")
  10.     local _f = fs.open(".bench/bench.lua", "r")
  11.     f, e = load(_f.readAll(), "bench.lua", nil, setmetatable({shell = shell}, {__index = _G}))
  12.     _f.close()
  13. else
  14.     print("Connecting...")
  15.     local h = assert(http.get("https://raw.githubusercontent.com/bench-cc/bench/master/src/bench.lua"))
  16.     f, e = load(h.readAll(), "bench.lua", nil, setmetatable({shell = shell}, {__index = _G}))
  17.     h.close()
  18. end
  19. assert(f, e)
  20. return f(...)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement