diff --git a/src/main/resources/assets/computercraft/lua/bios.lua b/src/main/resources/assets/computercraft/lua/bios.lua index 1b06ac3a27..9dd2eba3e7 100644 --- a/src/main/resources/assets/computercraft/lua/bios.lua +++ b/src/main/resources/assets/computercraft/lua/bios.lua @@ -18,9 +18,6 @@ if _VERSION == "Lua 5.1" then if env ~= nil and type( env) ~= "table" then error( "bad argument #4 (expected table, got " .. type( env ) .. ")", 2 ) end - if mode ~= nil and mode ~= "t" then - error( "Binary chunk loading prohibited", 2 ) - end local ok, p1, p2 = pcall( function() if type(x) == "string" then local result, err = nativeloadstring( x, name ) diff --git a/src/main/resources/assets/computercraft/lua/rom/apis/window.lua b/src/main/resources/assets/computercraft/lua/rom/apis/window.lua index 154c447271..7d318d6085 100644 --- a/src/main/resources/assets/computercraft/lua/rom/apis/window.lua +++ b/src/main/resources/assets/computercraft/lua/rom/apis/window.lua @@ -421,8 +421,10 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible ) function window.reposition( nNewX, nNewY, nNewWidth, nNewHeight ) if type( nNewX ) ~= "number" then error( "bad argument #1 (expected number, got " .. type( nNewX ) .. ")", 2 ) end if type( nNewY ) ~= "number" then error( "bad argument #2 (expected number, got " .. type( nNewY ) .. ")", 2 ) end - if nNewWidth ~= nil and type( nNewWidth ) ~= "number" then error( "bad argument #3 (expected number, got " .. type( nNewWidth ) .. ")", 2 ) end - if nNewHeight ~= nil and type( nNewHeight ) ~= "number" then error( "bad argument #4 (expected number, got " .. type( nNewHeight ) .. ")", 2 ) end + if nNewWidth ~= nil or nNewHeight ~= nil then + if type( nNewWidth ) ~= "number" then error( "bad argument #3 (expected number, got " .. type( nNewWidth ) .. ")", 2 ) end + if type( nNewHeight ) ~= "number" then error( "bad argument #4 (expected number, got " .. type( nNewHeight ) .. ")", 2 ) end + end nX = nNewX nY = nNewY diff --git a/src/main/resources/assets/computercraft/lua/rom/programs/help.lua b/src/main/resources/assets/computercraft/lua/rom/programs/help.lua index 5cc23354b1..e01f032976 100644 --- a/src/main/resources/assets/computercraft/lua/rom/programs/help.lua +++ b/src/main/resources/assets/computercraft/lua/rom/programs/help.lua @@ -13,18 +13,14 @@ if sTopic == "index" then return end -local w,h = term.getSize() local sFile = help.lookup( sTopic ) local file = ((sFile ~= nil) and io.open( sFile )) or nil -local nLinesPrinted = 0 if file then - local sLine = file:read() - local nLines = 0 - while sLine do - nLines = nLines + textutils.pagedPrint( sLine, (h-3) - nLines ) - sLine = file:read() - end + local sContents = file:read("*a") file:close() + + local _, nHeight = term.getSize() + textutils.pagedPrint( sContents, nHeight - 3 ) else print( "No help available" ) end diff --git a/src/main/resources/assets/computercraft/lua/rom/programs/http/pastebin.lua b/src/main/resources/assets/computercraft/lua/rom/programs/http/pastebin.lua index e633e8d2bf..6ed1de298d 100644 --- a/src/main/resources/assets/computercraft/lua/rom/programs/http/pastebin.lua +++ b/src/main/resources/assets/computercraft/lua/rom/programs/http/pastebin.lua @@ -113,7 +113,7 @@ elseif sCommand == "run" then printError( err ) return end - local success, msg = pcall(func, table.unpack(tArgs, 3)) + local success, msg = pcall(func, select(3, ...)) if not success then printError( msg ) end diff --git a/src/main/resources/assets/computercraft/lua/rom/programs/turtle/dance.lua b/src/main/resources/assets/computercraft/lua/rom/programs/turtle/dance.lua index 48e696edc9..1b07b90199 100644 --- a/src/main/resources/assets/computercraft/lua/rom/programs/turtle/dance.lua +++ b/src/main/resources/assets/computercraft/lua/rom/programs/turtle/dance.lua @@ -89,18 +89,17 @@ end print( "Press any key to stop the groove" ) -local bEnd = false -parallel.waitForAll( +parallel.waitForAny( function() while not bEnd do local event, key = os.pullEvent("key") if key ~= keys.escape then - bEnd = true + return end end end, function() - while not bEnd do + while true do local fnMove = tMoves[math.random(1,#tMoves)] fnMove() end