summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/cheat/xml_to_json.lua
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2017-06-02 17:59:55 -0500
committer cracyc <cracyc@users.noreply.github.com>2017-06-02 18:03:25 -0500
commit33c65a2afccb8031e5c929498cdbdb6c83bb645e (patch)
treee91bc89b1ffdaac44a8f4bbb2fb135e1221db597 /plugins/cheat/xml_to_json.lua
parente6ee45d670bc54cf033a2d71454095b0392bbf3b (diff)
plugins/cheat: add hotkey support [Carl]
Diffstat (limited to 'plugins/cheat/xml_to_json.lua')
-rw-r--r--plugins/cheat/xml_to_json.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/cheat/xml_to_json.lua b/plugins/cheat/xml_to_json.lua
new file mode 100644
index 00000000000..1273fb9885e
--- /dev/null
+++ b/plugins/cheat/xml_to_json.lua
@@ -0,0 +1,11 @@
+xml = require("cheat_xml")
+json = dofile("../json/init.lua")
+
+function readAll(file)
+ local f = io.open(file, "rb")
+ local content = f:read("*all")
+ f:close()
+ return content
+end
+
+print(json.stringify(xml.conv_cheat(readAll(arg[1])), {indent = true}))