From 687c112f9e4af38f8853397b193b21673b12fb7b Mon Sep 17 00:00:00 2001 From: Arcidayne <9382522b@opayq.com> Date: Tue, 22 Dec 2015 18:04:13 -0800 Subject: [PATCH] Fixed updater --- .../Epic_Not_Here_Counter.xml | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/Epic_Not_Here_Counter/Epic_Not_Here_Counter.xml b/Epic_Not_Here_Counter/Epic_Not_Here_Counter.xml index 0c85aed..14ea514 100644 --- a/Epic_Not_Here_Counter/Epic_Not_Here_Counter.xml +++ b/Epic_Not_Here_Counter/Epic_Not_Here_Counter.xml @@ -15,7 +15,7 @@ save_state="y" date_written="2015-10-25 12:00:38" requires="4.00" - version="2.2" + version="2.3" > pversion then - ColourNote("white", "blue", "Updating from version " .. pversion .. " to " .. raw_version .. ". Do not touch anything.") - local file = io.open(pfile, "w") + elseif raw_version > GetPluginInfo(GetPluginID(), 19) then + ColourNote("white", "blue", "Updating from version " .. GetPluginInfo(GetPluginID(), 19) .. " to " .. raw_version .. ". Do not touch anything.") + local file = io.open(GetPluginInfo(GetPluginID(), 6), "w") file:write(page) file:close() end @@ -248,6 +244,15 @@ function update_plugin () Execute(GetAlphaOption("script_prefix").."DoAfterSpecial(1, \"ReloadPlugin('"..GetPluginID().."')\", sendto.script)") end + +function update_plugin () + local raw = "https://raw.githubusercontent.com/Arcidayne/Aardwolf-Scripts/master/Epic_Not_Here_Counter/Epic_Not_Here_Counter.xml" + async_ok, async = pcall (require, "async") + + if async_ok then + plugin_page = async.doAsyncRemoteRequest(raw, raw_get, "HTTPS") + end +end ]]>