|
|
|
@ -68,7 +68,7 @@ script_update = { |
|
|
|
|
check_update_url = "https://git.deadpoo.net/rubin/easy-cruise/raw/branch/master/version", |
|
|
|
|
auto_update = false, |
|
|
|
|
auto_update_url = "https://git.deadpoo.net/rubin/easy-cruise/raw/branch/master/easy-cruise.lua", |
|
|
|
|
address_ini = "rubin-scripts-updates.ini", |
|
|
|
|
address_ini = "rubin-mods-updates.ini", |
|
|
|
|
main = function() |
|
|
|
|
local name = thisScript().name |
|
|
|
|
local ini = inicfg.load({ |
|
|
|
@ -80,7 +80,7 @@ script_update = { |
|
|
|
|
script_update.check_update = ini[name].check_update |
|
|
|
|
script_update.auto_update = ini[name].auto_update |
|
|
|
|
inicfg.save(ini, script_update.address_ini) |
|
|
|
|
if script_update.check_update then |
|
|
|
|
if script_update.check_update or script_update.auto_update then |
|
|
|
|
local fpath = os.tmpname() |
|
|
|
|
local text = openURL(script_update.check_update_url, fpath) |
|
|
|
|
if text ~= "" and not string.find(text, thisScript().version) then |
|
|
|
@ -144,16 +144,16 @@ script_update = { |
|
|
|
|
script_update.menu.dialog[#script_update.menu.dialog+1] = function() |
|
|
|
|
script_update.menu.show() |
|
|
|
|
end |
|
|
|
|
script_update.menu.text[#script_update.menu.text+1] = string.format("\tcheck update %s", (ini[k].check_update and "on" or "off")) |
|
|
|
|
script_update.menu.text[#script_update.menu.text+1] = string.format("\tauto update %s", (ini[k].auto_update and "{59fc30}ON" or "{ff0000}OFF")) |
|
|
|
|
script_update.menu.dialog[#script_update.menu.dialog+1] = function() |
|
|
|
|
ini[k].check_update = not ini[k].check_update |
|
|
|
|
ini[k].auto_update = not ini[k].auto_update |
|
|
|
|
inicfg.save(ini, script_update.address_ini) |
|
|
|
|
script_update.menu.show() |
|
|
|
|
end |
|
|
|
|
if ini[k].check_update then |
|
|
|
|
script_update.menu.text[#script_update.menu.text+1] = string.format("\tauto update %s", (ini[k].auto_update and "on" or "off")) |
|
|
|
|
if not ini[k].auto_update then |
|
|
|
|
script_update.menu.text[#script_update.menu.text+1] = string.format("\tcheck update %s", (ini[k].check_update and "{59fc30}ON" or "{ff0000}OFF")) |
|
|
|
|
script_update.menu.dialog[#script_update.menu.dialog+1] = function() |
|
|
|
|
ini[k].auto_update = not ini[k].auto_update |
|
|
|
|
ini[k].check_update = not ini[k].check_update |
|
|
|
|
inicfg.save(ini, script_update.address_ini) |
|
|
|
|
script_update.menu.show() |
|
|
|
|
end |
|
|
|
|