Advertisement
BugFix

Untitled

Oct 20th, 2013
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.74 KB | None | 0 0
  1. #include "LuaInline.au3"
  2. _Lua_StartUp()    ; == Initialisiert Lua, Shutdown automatisch bei AutoIt-Ende
  3.  
  4. Global $sLua = _
  5. " folder = 'C:\\Users\\BugFix\\Downloads\\hosta\\'" & _
  6. " path1 = folder .. 'hosts'" & _
  7. " path2 = folder .. 'hosts_1'" & _
  8. " hFile = io.open(path1)" & _
  9. " sHosts1 = hFile:read('*a')" & _
  10. " hFile:close()" & _
  11. " hFile = io.open(path2)" & _
  12. " sHosts2 = hFile:read('*a')" & _
  13. " hFile:close()" & _
  14. " sAdd, sExists = '', ''" & _
  15. " for k, v in sHosts2:gmatch('\n(%d+%.%d+%.%d+%.%d+)%s+([^#\n%s]+)') do" & _
  16. "   if not sHosts1:find(v) then" & _
  17. "       sAdd = sAdd..k..'  '..v..'\n'" & _
  18. "   end" & _
  19. " end" & _
  20. " hFile = io.open('C:\\Users\\BugFix\\Downloads\\hosta\\AddHosts', 'w+')" & _
  21. " hFile:write(sAdd)" & _
  22. " hFile:close()"
  23.  
  24. _Lua_DoString($sLua)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement