Skip to content

Commit

Permalink
1.2.5 fix
Browse files Browse the repository at this point in the history
Fixed the blocked console bug (very annoying)
The update check is now checking every 30min
  • Loading branch information
boubouleuh authored Feb 27, 2023
1 parent ac63d05 commit 1655416
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ VOTEKICKLIST = {}
COMMANDLIST = {}
VERSIONPATH = script_path() .. "version.txt"
CONFIGPATH = script_path() .. "NickelConfig.toml"
VERSION = "1.2.4"
VERSION = "1.2.5"



Expand Down Expand Up @@ -700,8 +700,8 @@ function checkForUpdates()
local function httpRequest(url)
--check os
if MP.GetOSName() == "Windows" then
local response = io.popen("curl -s " .. url .. " --output temp.txt", "r")
response:close()
local response = os.execute("curl -s " .. url .. " --output temp.txt", "r")
-- response:close()
if response then
local file = io.open("temp.txt", "r")
local content = file:read("*all")
Expand All @@ -713,8 +713,8 @@ function checkForUpdates()
end
else
--dont use curl
local response = io.popen("wget -q -O temp.txt " .. url, "r")
response:close()
local response = os.execute("wget -q -O temp.txt " .. url, "r")
-- response:close()
if response then
local file = io.open("temp.txt", "r")
local content = file:read("*all")
Expand Down Expand Up @@ -939,4 +939,4 @@ MP.CreateEventTimer("EverySecond", 1000)


MP.RegisterEvent("CheckUpdate", "checkForUpdates")
MP.CreateEventTimer("CheckUpdate", 60000)
MP.CreateEventTimer("CheckUpdate", 1800000)

0 comments on commit 1655416

Please sign in to comment.