Skip to content

Instantly share code, notes, and snippets.

@Quader
Quader / turtle_scan.lua
Created August 25, 2014 20:55
turtle scan
--EN:
--This program will create a virtual map of
--an specified area. This map can be used for
--copying this area somewhere else.
--
--Download BuildArea from http://pastebin.com/45dc4FG2
--CZ:
--Tenhle program naskenuje danou oblast a vytvori
--virtualni mapu. Tu muze pouzit program BuildArea
local myid = os.computerID()
local doorList = { 11,13 }
local passwordForDoor = { "notch","minecraft" }
mon=peripheral.wrap("top")
print("Access Terminal")
rednet.open("left")
print("Computer id for Access Terminal is "..tostring(myid))
osLoadAPI("json")
file = fs.open("playerDB.txt", "r")
fileStr = file.readAll()
file.close()
jsonObj = json.decode(fileStr)
for key, value in pairs(jsonObj) do
if key == "player" then
local playerObj = value
rednet.open("top")
os.pullEvent = os.pullEventRaw
os.loadAPI("json")
local serverID = 1087
function playerDetected(player)
term.clear()
term.setCursorPos(1,1)
print("Player Detected: "..player)
end
rednet.open("top")
os.pullEvent = os.pullEventRaw
os.loadAPI("json")
local serverID = 1087
function playerDetected(player)
term.clear()
term.setCursorPos(1,1)
print("Player Detected: "..player)
end
local myid = os.computerID()
local doorList = { 11,13 }
local passwordForDoor = { "notch","minecraft" }
mon=peripheral.wrap("top")
print("Access Terminal")
rednet.open("left")
os.loadAPI("json")
print("Computer id for Access Terminal is "..tostring(myid))
{
"player": [
{
"name": "Quader",
"password": "Wh0sTh3B0ss"
},
{
"name": "downdead11",
"password": "N0b0dykn0ws"
}
local myid = os.computerID()
local doorList = { 11,13 }
local passwordForDoor = { "notch","minecraft" }
mon=peripheral.wrap("top")
print("Access Terminal")
rednet.open("left")
os.loadAPI("json")
print("Computer id for Access Terminal is "..tostring(myid))
local myid = os.computerID()
local doorList = { 11,13 }
local passwordForDoor = { "notch","minecraft" }
mon=peripheral.wrap("top")
print("Access Terminal")
rednet.open("left")
os.loadAPI("json")
print("Computer id for Access Terminal is "..tostring(myid))
local myid = os.computerID()
local doorList = { 11,13 }
local passwordForDoor = { "notch","minecraft" }
mon=peripheral.wrap("top")
print("Access Terminal")
rednet.open("left")
os.loadAPI("json")
os.loadAPI("peripherals")
print("Computer id for Access Terminal is "..tostring(myid))