home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Enigma / Enigma-1.01-w7.exe / reference / lua2xml < prev    next >
Encoding:
Lua script  |  2009-12-13  |  462 b   |  15 lines

  1. #!/usr/bin/env lua
  2. -- Simple converter for Enigma lua (xml ready) level to xml (utf-8) level
  3. -- Copyright (c) 2006 Ronald Lamprecht
  4. -- License: GPL2
  5. -- Usage: lua lua2xml.lua level.lua > level.xml
  6. -- Requires Lua 5.0 or abovestdout = io.output()
  7. stdout = io.output()
  8. for line in io.lines(arg[1]) do
  9.     if (string.find(line,"--xml-- ",1,true) == 1) then
  10.         stdout:write(string.sub(line, 9) .. "\n" )
  11.     else
  12.         stdout:write(line .. "\n" )
  13.     end
  14. end
  15.