1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-12 03:00:30 +00:00

Add Checks for Turtle and Pocket programs (#226)

Error if turtle and pocket computers programs are not run on
their respective devices.
This commit is contained in:
JakobDev 2019-06-01 13:48:33 +02:00 committed by SquidDev
parent da7e4b9016
commit 56434259c1
11 changed files with 47 additions and 0 deletions

View File

@ -1,3 +1,8 @@
if not pocket then
printError( "Requires a Pocket Computer" )
return
end
local ok, err = pocket.equipBack() local ok, err = pocket.equipBack()
if not ok then if not ok then
printError( err ) printError( err )

View File

@ -1,3 +1,8 @@
if not pocket then
printError( "Requires a Pocket Computer" )
return
end
local ok, err = pocket.unequipBack() local ok, err = pocket.unequipBack()
if not ok then if not ok then
printError( err ) printError( err )

View File

@ -1,3 +1,7 @@
if not turtle then
printError( "Requires a Turtle" )
return
end
if not turtle.craft then if not turtle.craft then
print( "Requires a Crafty Turtle" ) print( "Requires a Crafty Turtle" )

View File

@ -1,3 +1,6 @@
if not turtle then
printError( "Requires a Turtle" )
end
local tMoves = { local tMoves = {
function() function()

View File

@ -1,3 +1,7 @@
if not turtle then
printError( "Requires a Turtle" )
return
end
local tArgs = { ... } local tArgs = { ... }
local function printUsage() local function printUsage()

View File

@ -1,3 +1,7 @@
if not turtle then
printError( "Requires a Turtle" )
return
end
local tArgs = { ... } local tArgs = { ... }
if #tArgs ~= 1 then if #tArgs ~= 1 then

View File

@ -1,3 +1,8 @@
if not turtle then
printError( "Requires a Turtle" )
return
end
local tArgs = { ... } local tArgs = { ... }
if #tArgs < 1 then if #tArgs < 1 then
print( "Usage: go <direction> <distance>" ) print( "Usage: go <direction> <distance>" )

View File

@ -1,3 +1,7 @@
if not turtle then
printError( "Requires a Turtle" )
return
end
local tArgs = { ... } local tArgs = { ... }
local nLimit = 1 local nLimit = 1

View File

@ -1,3 +1,7 @@
if not turtle then
printError( "Requires a Turtle" )
return
end
local tArgs = { ... } local tArgs = { ... }
if #tArgs ~= 1 then if #tArgs ~= 1 then

View File

@ -1,3 +1,8 @@
if not turtle then
printError( "Requires a Turtle" )
return
end
local tArgs = { ... } local tArgs = { ... }
if #tArgs < 1 then if #tArgs < 1 then
print( "Usage: turn <direction> <turns>" ) print( "Usage: turn <direction> <turns>" )

View File

@ -1,3 +1,7 @@
if not turtle then
printError( "Requires a Turtle" )
return
end
local tArgs = { ... } local tArgs = { ... }
local function printUsage() local function printUsage()