This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MasterServer | |
-- Ver. 0.1 | |
-- Include external lib | |
dofile("/lib/amari/string/StringUtil.lua") | |
local REDNET_SIDE = "back" | |
local REDNET_PROTOCOL = "MasterServer" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- FileClient | |
-- Ver. 0.1 | |
-- Include external lib | |
dofile("/lib/amari/string/StringUtil.lua") | |
local REDNET_SIDE = "left" | |
local REDNET_PROTOCOL_MASTER = "MasterServer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function string.startsWith(str, start) | |
return (string.sub(str, 1, string.len(start)) == start) | |
end | |
-- https://symfoware.blog.fc2.com/blog-entry-455.html | |
function string.split(str, delim) | |
if string.find(str, delim) == nil then | |
return { str } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local MINING_X = 3 | |
local MINING_Z = 3 | |
local MINING_Y = -2 | |
function inspectAndRefuelFront() | |
local success, result = turtle.inspect() | |
if success and result.name == "minecraft:lava" then | |
turtle.place() | |
turtle.refuel() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local resInspect, blkInfo = turtle.inspect() | |
local blkType = blkInfo.name | |
print(resInspect) | |
print(blkType) | |
if resInspect == false then | |
print("Front block is nil.") | |
return | |
end |