Update Lua OC Scripts.

This commit is contained in:
Captain ALM 2019-12-29 12:12:55 +00:00
parent e9b88eb6d4
commit 0a9479d98f
2 changed files with 7 additions and 28 deletions

View File

@ -66,7 +66,8 @@ end
local function readc(con)
local herr = false
local data = ""
while not herr do
local lout = 0
while ((not herr) and (lout < 50)) do
try {
function()
local tmp = ""
@ -75,7 +76,11 @@ local function readc(con)
if tmp ~= "" then
data = data..tmp
con:setTimeout(0)
else
lout = lout + 1
end
else
lout = lout + 1
end
end,
catch {
@ -85,6 +90,7 @@ local function readc(con)
}
}
end
lout = 0
if data == "" then
data = nil
end

View File

@ -60,33 +60,6 @@ function try(block)
return result
end
local function readc(con)
local herr = false
local data = ""
while not herr do
try {
function()
local tmp = ""
tmp = con:read(1)
if tmp ~= nil then
if tmp ~= "" then
data = data..tmp
end
end
end,
catch {
function(ex)
herr = true
end
}
}
end
if data == "" then
data = nil
end
return data
end
local function shandshake(con)
print("Sending Handshake...\n")
con:write("2")