Advertisement
simon1007

MAj Checker

May 4th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local id = "" --id pastebin
  2. local url = "https://pastebin.com/raw/"..id
  3. local filename = "" --name program to check
  4. local code = "" --dont touch
  5. if fs.exists(filename) then
  6.   local h=fs.open(filename,"r")
  7.   code=h.readAll()
  8.   h.close()
  9. end
  10.  
  11. local h=http.get(url)
  12. local newcode=h.readAll()
  13. h.close()
  14.  
  15. if newcode ~= code then
  16.   local h=fs.open(filename,"w")
  17.   h.write(newcode)
  18.   h.close()
  19. end
  20.  
  21. shell.run(filename)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement