Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bot = {}
- bot.yStart = 0
- bot.currY = 0
- bot.currX = 1
- bot.currZ = 1
- bot.direction = 1
- bot.totalLayer = 0
- bot.currLayer = 0
- bot.valuable = 0
- bot.resumeY = 0
- bot.resumeX = 0
- bot.resumeZ = 0
- bot.resumeDirection = 1
- bot.isRunning = false
- bot.isModem = false
- bot.isEnderchest = false
- bot.tilesToMine = 0
- bot.tilesMined = 0
- bot.currentFuel = 0
- bot.fuelNeeded = 0
- bot.status = "Idle"
- bot.blockName = 0
- bot.blacklistName = "N/A"
- local function savePos()
- local fileName = "savedPosition2"
- local handle = fs.open(fileName, "w")
- handle.write(textutils.serialize(bot))
- handle.close()
- end
- local function loadPos()
- local fileName = "savedPosition2"
- if fs.exists(fileName) == true then
- local handle = fs.open(fileName, "r")
- local readFile = handle.readLine()
- if readFile ~= nil then
- bot = textutils.unserialize(readFile)
- end
- handle.close()
- else
- print("file does not exist, check path..")
- end
- end
- print("Original: "..bot.direction)
- bot.direction = 2
- savePos()
- print("Changed: "..bot.direction)
- loadPos()
- print("Loaded: "..bot.direction)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement