mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-10 18:33:00 +00:00
Merge branch 'master' into mc-1.14.x
This commit is contained in:
@@ -334,7 +334,11 @@ end
|
||||
|
||||
local bRunning = false
|
||||
|
||||
--- @local
|
||||
--- Listen for modem messages and converts them into rednet messages, which may
|
||||
-- then be @{receive|received}.
|
||||
--
|
||||
-- This is automatically started in the background on computer startup, and
|
||||
-- should not be called manually.
|
||||
function run()
|
||||
if bRunning then
|
||||
error("rednet is already running", 2)
|
||||
|
||||
@@ -207,7 +207,7 @@ function load(sPath)
|
||||
for k, v in pairs(tFile) do
|
||||
local ty_v = type(k)
|
||||
if type(k) == "string" and (ty_v == "string" or ty_v == "number" or ty_v == "boolean" or ty_v == "table") then
|
||||
local opt = details[name]
|
||||
local opt = details[k]
|
||||
if not opt or not opt.type or ty_v == opt.type then
|
||||
set_value(k, v)
|
||||
end
|
||||
|
||||
@@ -5,7 +5,12 @@
|
||||
if not turtle then
|
||||
error("Cannot load turtle API on computer", 2)
|
||||
end
|
||||
native = turtle.native or turtle --- @local
|
||||
|
||||
--- The builtin turtle API, without any generated helper functions.
|
||||
--
|
||||
-- Generally you should not need to use this table - it only exists for
|
||||
-- backwards compatibility reasons.
|
||||
native = turtle.native or turtle
|
||||
|
||||
local function addCraftMethod(object)
|
||||
if peripheral.getType("left") == "workbench" then
|
||||
|
||||
@@ -384,7 +384,7 @@ local function pretty_impl(obj, tracking)
|
||||
end
|
||||
|
||||
tracking[obj] = nil
|
||||
return group(concat(obrace, nest(2, concat(table.unpack(doc, 1, n))), space_line, cbrace))
|
||||
return group(concat(obrace, nest(2, concat(table.unpack(doc, 1, doc.n))), space_line, cbrace))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ local function createShellEnv(sDir)
|
||||
package.path = "?;?.lua;?/init.lua;/rom/modules/main/?;/rom/modules/main/?.lua;/rom/modules/main/?/init.lua"
|
||||
if turtle then
|
||||
package.path = package.path .. ";/rom/modules/turtle/?;/rom/modules/turtle/?.lua;/rom/modules/turtle/?/init.lua"
|
||||
elseif command then
|
||||
elseif commands then
|
||||
package.path = package.path .. ";/rom/modules/command/?;/rom/modules/command/?.lua;/rom/modules/command/?/init.lua"
|
||||
end
|
||||
package.config = "/\n;\n?\n!\n-"
|
||||
|
||||
@@ -93,18 +93,10 @@ end
|
||||
print("Press any key to stop the groove")
|
||||
|
||||
parallel.waitForAny(
|
||||
function()
|
||||
while not bEnd do
|
||||
local _, key = os.pullEvent("key")
|
||||
if key ~= keys.escape then
|
||||
return
|
||||
end
|
||||
end
|
||||
end,
|
||||
function() os.pullEvent("key") end,
|
||||
function()
|
||||
while true do
|
||||
local fnMove = tMoves[math.random(1, #tMoves)]
|
||||
fnMove()
|
||||
tMoves[math.random(1, #tMoves)]()
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user