Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Adventure Time
- -- This Game Demo is made by Frekvens1
- -- Do not claim this as your own!
- local oldPull = os.pullEvent;
- os.pullEvent = os.pullEventRaw;
- -- pastebin get JPx07uRB startup
- local DebugMode = false
- local ShowCords = true
- local ShowStepsReboot = true
- local showMainMenu = false
- local menuPos = 2
- local messagePos = 9
- local mapStartPos = 2
- local screenfixX = 14
- local screenfixY = 8
- local MainMenuY = -1
- local W = 17
- local S = 31
- local A = 30
- local D = 32
- local Enter = 28
- local M = 50
- local Map1X = 0
- local Map1Y = 0
- local Map2X = 0
- local Map2Y = 0
- local House1X = 0
- local House1Y = 0
- local Username = "Gamer"
- local HP = 0
- local Money = 0
- local Walks = "0"
- local WalksRemaining = ""
- local Remaining = ""
- local deathSide = ""
- local selectedMap = "Map1"
- local integer
- local maxInteger = 42
- -- 166
- -- 163
- -- 160
- -- 153
- function checkIfDebuging()
- if DebugMode == true then
- ShowCords = true
- ShowStepsReboot = true
- else
- ShowCords = false
- ShowStepsReboot = false
- end
- end
- function GetSteps()
- local junk = 41 - maxInteger
- WalksRemaining = (junk * 3) + 140
- end
- local House1falseX = {12,11,10, 9, 8, 7, 6, 5, 5,-10,-9,-11,-11,-10,-9}
- local House1falseY = {-4,-4,-4,-4,-4,-4,-4,-4,-5, -5,-5, -5, -3, -3,-3}
- local Map1falseX = {1 , 2, 3, 4, 5,-1,-2,-3,-4,-5,-5,-6,-5, 5, 6, 5, 0, 1, 2, 3, 4, 5, 6,-1,-2,-3,-4,-5,-6, 6,-6,-6,-7,-6, 6, 6, 7, 0,14,13,13}
- local Map1falseY = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,-3,-4,-2,-3,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-1,-2,-3,-4,-1,-2,-3,-2, 1, 2, 0}
- local Map2falseX = {-3,-2,-4,-14,-13,-13,7,6,8,14,13,13,0,1,2,3,4, 5,6,7,8,9,10,10,10,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,-1, 0, 0}
- local Map2falseY = {-7,-6,-6, 1, 0, 2,7,6,6, 1, 0, 2,0,0,0,0,0,-1,0,0,0,0, 0,-1,-2,-3,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-2,-1}
- local Map2maxX = {13,-13}
- local Map2maxY = {6,-6}
- local Map1maxX = {13,-13}
- local Map1maxY = {6,-6}
- local House1maxX = {13,-13}
- local House1maxY = {-1, -6}
- --("-------------------------")
- --("------_____________------")
- --("-----/_____________\\-----")
- --("------| ___ |------")
- --("------|____|_|____|------")
- --("------------o------------")
- --("-------------------------")
- --("-------------------------")
- --("-------------------------")
- --("-------------------------")
- local KeyPressed = ""
- function loadWithCords()
- if DebugMode == true then
- if ShowCords == true then
- menuPos = 2
- messagePos = 9
- mapStartPos = 2
- screenfixX = 14
- screenfixY = 8
- else
- menuPos = 1
- messagePos = 8
- mapStartPos = 1
- screenfixX = 14
- screenfixY = 7
- end
- else
- ShowStepsReboot = false
- ShowCords = false
- menuPos = 1
- messagePos = 8
- mapStartPos = 1
- screenfixX = 14
- screenfixY = 7
- end
- end
- function StartUp()
- Presser()
- integer = 1
- NoPermWalking()
- ChangeMap()
- CurrentMap()
- term.setCursorPos(1,1)
- if ShowCords == true then
- if selectedMap == "Map1" then
- print("Cords: X: ",Map1X," Y: ",Map1Y)
- elseif selectedMap == "Map2" then
- print("Cords: X: ",Map2X," Y: ",Map2Y)
- elseif selectedMap == "House1" then
- print("Cords: X: ",House1X," Y: ",House1Y)
- else
- print("Cords: X: ",Map1X," Y: ",Map1Y)
- end
- end
- giveMessage()
- if ShowStepsReboot == true then
- term.setCursorPos(1,18)
- print(Remaining," steps remaining until reboot")
- end
- term.setCursorPos(1,19)
- if showMainMenu == true then
- mainMenu()
- else
- if HP == 0 then
- deathMessage()
- else
- StartUp()
- end
- end
- end
- function mainMenu()
- term.clear()
- if Remaining == 0 then
- os.reboot()
- end
- if ShowStepsReboot == true then
- term.setCursorPos(1,18)
- print(Remaining," steps remaining until reboot")
- end
- if ShowCords == true then
- term.setCursorPos(1,1)
- print("Cords: Y: ",MainMenuY)
- end
- if MainMenuY == -1 then
- term.setCursorPos(1,menuPos)
- print("[-------------------------------------------------]")
- print("[- Main Menu -]")
- print("[-------------------------------------------------]")
- print("[- [Resume Game] Bag Save and Quit -]")
- print("[-------------------------------------------------]")
- elseif MainMenuY == 0 then
- term.setCursorPos(1,menuPos)
- print("[-------------------------------------------------]")
- print("[- Main Menu -]")
- print("[-------------------------------------------------]")
- print("[- Resume Game [Bag] Save and Quit -]")
- print("[-------------------------------------------------]")
- elseif MainMenuY == 1 then
- term.setCursorPos(1,menuPos)
- print("[-------------------------------------------------]")
- print("[- Main Menu -]")
- print("[-------------------------------------------------]")
- print("[- Resume Game Bag [Save and Quit] -]")
- print("[-------------------------------------------------]")
- else
- MainMenuY = -1
- print("[-------------------------------------------------]")
- print("[- Main Menu -]")
- print("[-------------------------------------------------]")
- print("[- [Resume Game] Bag Save and Quit -]")
- print("[-------------------------------------------------]")
- end
- local evt, key = os.pullEvent("key")
- Remaining = Remaining - 1
- if key == M then
- showMainMenu = false
- MainMenuY = -1
- showCurrentMap()
- elseif key == Enter then
- if MainMenuY == -1 then
- showMainMenu = false
- MainMenuY = -1
- SaveSteps()
- showCurrentMap()
- elseif MainMenuY == 0 then
- SaveSteps()
- mainMenu()
- elseif MainMenuY == 1 then
- SaveSteps()
- os.shutdown()
- else
- showMainMenu = false
- MainMenuY = -1
- SaveSteps()
- end
- elseif key == A then
- if MainMenuY == -1 then
- SaveSteps()
- mainMenu()
- else
- MainMenuY = MainMenuY - 1
- SaveSteps()
- mainMenu()
- end
- elseif key == D then
- if MainMenuY == 1 then
- SaveSteps()
- mainMenu()
- else
- MainMenuY = MainMenuY + 1
- SaveSteps()
- mainMenu()
- end
- else
- mainMenu()
- SaveSteps()
- end
- SaveSteps()
- end
- function showCurrentMap()
- os.reboot()
- end
- function deathMessage()
- if Remaining == 0 then
- os.reboot()
- end
- term.clear()
- if ShowStepsReboot == true then
- term.setCursorPos(1,18)
- print(Remaining," steps remaining until reboot")
- end
- if ShowCords == true then
- term.setCursorPos(1,1)
- if deathSide == D then
- print("Cords: Right")
- else
- print("Cords: Left")
- end
- end
- term.setCursorPos(1,menuPos)
- if deathSide == D then
- print("[-------------------------------------------------]")
- print("[- Oh No! You died! Do you wish to continue? -]")
- print("[-------------------------------------------------]")
- print("[- YES [NO] -]")
- print("[-------------------------------------------------]")
- elseif deathSide == A then
- print("[-------------------------------------------------]")
- print("[- Oh No! You died! Do you wish to continue? -]")
- print("[-------------------------------------------------]")
- print("[- [YES] NO -]")
- print("[-------------------------------------------------]")
- else
- deathSide = A
- print("[-------------------------------------------------]")
- print("[- Oh No! You died! Do you wish to continue? -]")
- print("[-------------------------------------------------]")
- print("[- [YES] NO -]")
- print("[-------------------------------------------------]")
- end
- local evt, key = os.pullEvent("key")
- Remaining = Remaining - 1
- if key == Enter then
- if deathSide == A then
- HP = 100
- selectedMap = "House1"
- House1X = -10
- House1Y = -4
- SaveSteps()
- os.reboot()
- else
- SaveSteps()
- os.shutdown()
- end
- else
- deathSide = key
- deathMessage()
- end
- end
- function giveMessage()
- if selectedMap == "Map1" then
- if Map1X == -3 and Map1Y == 0 then
- term.setCursorPos(29,messagePos)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 1)
- print("[- Sign -]")
- term.setCursorPos(29,messagePos + 2)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 3)
- print("[- ", Username,"'s House")
- term.setCursorPos(50,messagePos + 3)
- print("-]")
- term.setCursorPos(29,messagePos + 4)
- print("[---------------------]")
- elseif Map1X == 12 and Map1Y == 1 then
- term.setCursorPos(29,messagePos)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 1)
- print("[- Sign -]")
- term.setCursorPos(29,messagePos + 2)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 3)
- print("[- Main road ahead -]")
- term.setCursorPos(29,messagePos + 4)
- print("[- ----> -]")
- term.setCursorPos(29,messagePos + 5)
- print("[---------------------]")
- end
- elseif selectedMap == "Map2" then
- if Map2X == -12 and Map2Y == 1 then
- term.setCursorPos(29,messagePos)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 1)
- print("[- Sign -]")
- term.setCursorPos(29,messagePos + 2)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 3)
- print("[- ", Username,"'s House")
- term.setCursorPos(50,messagePos + 3)
- print("-]")
- term.setCursorPos(29,messagePos + 4)
- print("[- <---- -]")
- term.setCursorPos(29,messagePos + 5)
- print("[---------------------]")
- elseif Map2X == 2 and Map2Y == 1 then
- term.setCursorPos(29,messagePos)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 1)
- print("[- Store -]")
- term.setCursorPos(29,messagePos + 2)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 3)
- print("[- Come and buy! -]")
- term.setCursorPos(29,messagePos + 4)
- print("[---------------------]")
- end
- elseif selectedMap == "House1" then
- if House1X == -10 and House1Y == -4 then
- term.setCursorPos(29,messagePos)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 1)
- print("[- Bed -]")
- term.setCursorPos(29,messagePos + 2)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 3)
- print("[- Its Comfortable -]")
- term.setCursorPos(29,messagePos + 4)
- print("[---------------------]")
- elseif House1X == 8 and House1Y == -3 then
- term.setCursorPos(29,messagePos)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 1)
- print("[- Oven -]")
- term.setCursorPos(29,messagePos + 2)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 3)
- print("[- Cook your food -]")
- term.setCursorPos(29,messagePos + 4)
- print("[---------------------]")
- elseif House1X == 10 and House1Y == -3 then
- term.setCursorPos(29,messagePos)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 1)
- print("[- Sink -]")
- term.setCursorPos(29,messagePos + 2)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 3)
- print("[- Fresh Water -]")
- term.setCursorPos(29,messagePos + 4)
- print("[---------------------]")
- elseif House1X == 12 and House1Y == -3 then
- term.setCursorPos(29,messagePos)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 1)
- print("[- Fridge -]")
- term.setCursorPos(29,messagePos + 2)
- print("[---------------------]")
- term.setCursorPos(29,messagePos + 3)
- print("[- It can store food -]")
- term.setCursorPos(29,messagePos + 4)
- print("[---------------------]")
- end
- end
- end
- function ChangeMap()
- if selectedMap == "Map1" then
- if Map1X == 0 and Map1Y == -1 then
- selectedMap = "House1"
- Map1X = 0
- Map1Y = 0
- House1X = 0
- House1Y = -2
- elseif Map1X == 13 and Map1Y == 1 then
- selectedMap = "Map2"
- Map1X = 12
- Map1Y = 1
- Map2X = -12
- Map2Y = 1
- end
- elseif Map2X == -13 and Map2Y == 1 then
- selectedMap = "Map1"
- Map1X = 12
- Map1Y = 1
- Map2X = -12
- Map2Y = 1
- elseif selectedMap == "House1" then
- if House1X == 0 and House1Y == -1 then
- selectedMap = "Map1"
- Map1X = 0
- Map1Y = 0
- House1X = 0
- House1Y = -2
- end
- end
- end
- function House1()
- local posX = House1X + screenfixX
- local posY = House1Y + screenfixY
- term.setCursorPos(1,mapStartPos)
- print("___________________________")
- print("| /-\\ | |x|u|F|")
- print("| |?| --------|")
- print("| |-| ? ? ?|")
- print("| |")
- print("|-----------|_|-----------|")
- term.setCursorPos(posX,posY)
- print("o")
- end
- function Map1()
- local posX = Map1X + screenfixX
- local posY = Map1Y + screenfixY
- term.setCursorPos(1,mapStartPos)
- print("___________________________")
- print("| |")
- print("| _____________ |")
- print("| /_____________\\ |")
- print("| | ___ | |")
- print("| |__s_|_|____| |")
- print("| ? | |___________|")
- print("| | s]")
- print("| --------------|")
- print("| |")
- print("| |")
- print("| |")
- print("---------------------------")
- term.setCursorPos(posX,posY)
- print("o")
- end
- function Map2()
- local posX = Map2X + screenfixX
- local posY = Map2Y + screenfixY
- term.setCursorPos(1,mapStartPos)
- print("__________-________________")
- print("| |s| |")
- print("| | | ___________ |")
- print("| | |/___________\\ |")
- print("| | | |_ _| |")
- print("| | | |_| ___ |_| |")
- print("|________| |_|_s_|_|___|__|")
- print("[s s]")
- print("|------------------| |----|")
- print("| | | |")
- print("| | | |")
- print("| |s| |")
- print("--------------------_------")
- term.setCursorPos(posX,posY)
- print("o")
- end
- function OldMap1()
- local posX = Map1X + 14
- local posY = Map1Y + 8
- print("Cords: X: ",Map1X," Y: ",Map1Y)
- print("___________________________")
- print("|-------------------------|")
- print("|------_____________------|")
- print("|-----/_____________\\-----|")
- print("|------| ___ |------|")
- print("|------|____|_|____|------|")
- print("|-------------------------|")
- print("|-------------------------)")
- print("|-------------------------|")
- print("|-------------------------|")
- print("|-------------------------|")
- print("---------------------------")
- term.setCursorPos(posX,posY)
- print("o")
- term.setCursorPos(1,14)
- print(Remaining," steps remaining until reboot")
- term.setCursorPos(1,15)
- end
- function CurrentMap()
- term.clear()
- term.setCursorPos(1,1)
- Remaining = WalksRemaining - Walks
- if selectedMap == "Map1" then
- Map1()
- elseif selectedMap == "House1" then
- House1()
- elseif selectedMap == "Map2" then
- Map2()
- else
- selectedMap = "Map1"
- Map1()
- end
- menu()
- SaveSteps()
- Walks = Walks + 1
- end
- function menu()
- term.setCursorPos(29,menuPos)
- print("[---------------------]")
- term.setCursorPos(29,menuPos + 1)
- print("[- ",Username)
- term.setCursorPos(50,menuPos + 1)
- print("-]")
- term.setCursorPos(29,menuPos + 2)
- print("[---------------------]")
- term.setCursorPos(29,menuPos + 3)
- print("[- HP: ",HP)
- term.setCursorPos(50,menuPos + 3)
- print("-]")
- term.setCursorPos(29,menuPos + 4)
- print("[- Money: ", Money)
- term.setCursorPos(50,menuPos + 4)
- print("-]")
- term.setCursorPos(29,menuPos + 5)
- print("[---------------------]")
- end
- function NoPermWalking2()
- NoPermWalking()
- end
- function NoPermWalking()
- if maxInteger == integer then
- else
- if KeyPressed == W then
- if Map1X == Map1falseX[integer] and Map1Y == Map1falseY[integer] then
- Map1Y = Map1Y + 1
- elseif House1X == House1falseX[integer] and House1Y == House1falseY[integer] then
- House1Y = House1Y + 1
- elseif Map2X == Map2falseX[integer] and Map2Y == Map2falseY[integer] then
- Map2Y = Map2Y + 1
- end
- end
- if KeyPressed == S then
- if Map1X == Map1falseX[integer] and Map1Y == Map1falseY[integer] then
- Map1Y = Map1Y - 1
- elseif House1X == House1falseX[integer] and House1Y == House1falseY[integer] then
- House1Y = House1Y - 1
- elseif Map2X == Map2falseX[integer] and Map2Y == Map2falseY[integer] then
- Map2Y = Map2Y - 1
- end
- end
- if KeyPressed == A then
- if Map1X == Map1falseX[integer] and Map1Y == Map1falseY[integer] then
- Map1X = Map1X + 1
- elseif House1X == House1falseX[integer] and House1Y == House1falseY[integer] then
- House1X = House1X + 1
- elseif Map2X == Map2falseX[integer] and Map2Y == Map2falseY[integer] then
- Map2X = Map2X + 1
- end
- end
- if KeyPressed == D then
- if Map1X == Map1falseX[integer] and Map1Y == Map1falseY[integer] then
- Map1X = Map1X - 1
- elseif House1X == House1falseX[integer] and House1Y == House1falseY[integer] then
- House1X = House1X - 1
- elseif Map2X == Map2falseX[integer] and Map2Y == Map2falseY[integer] then
- Map2X = Map2X - 1
- end
- end
- integer = integer + 1
- NoPermWalking2()
- end
- end
- function Presser()
- local evt, key = os.pullEvent("key")
- KeyPressed = key
- if key == W then
- if selectedMap == "Map1" then
- if Map1maxY[2] == Map1Y - 1 then
- else
- Map1Y = Map1Y - 1
- end
- elseif selectedMap == "House1" then
- if House1maxY[2] == House1Y - 1 then
- else
- House1Y = House1Y - 1
- end
- elseif selectedMap == "Map2" then
- if Map2maxY[2] == Map2Y - 1 then
- if Map2X == -3 and Map2Y == -5 then
- Map2Y = Map2Y - 1
- end
- else
- Map2Y = Map2Y - 1
- end
- else
- selectedMap = "Map1"
- if Map1maxY[2] == Map1Y - 1 then
- else
- Map1Y = Map1Y - 1
- end
- end
- end
- if key == M then
- showMainMenu = true
- MainMenuY = -1
- Remaining = Remaining - 1
- end
- if key == S then
- if selectedMap == "Map1" then
- if Map1maxY[1] == Map1Y + 1 then
- else
- Map1Y = Map1Y + 1
- end
- elseif selectedMap == "House1" then
- if House1maxY[1] == House1Y + 1 then
- if House1X == 0 and House1Y == -2 then
- House1Y = House1Y + 1
- end
- else
- House1Y = House1Y + 1
- end
- elseif selectedMap == "Map2" then
- if Map2maxY[1] == Map2Y + 1 then
- if Map2X == 7 and Map2Y == 5 then
- Map2Y = Map2Y + 1
- end
- else
- Map2Y = Map2Y + 1
- end
- else
- selectedMap = "Map1"
- if Map1maxY[1] == Map1Y + 1 then
- else
- Map1Y = Map1Y + 1
- end
- end
- end
- if key == A then
- if selectedMap == "Map1" then
- if Map1maxX[2] == Map1X - 1 then
- else
- Map1X = Map1X - 1
- end
- elseif selectedMap == "House1" then
- if House1X == -8 and House1Y == -4 then
- House1X = House1X - 2
- elseif House1X == -10 and House1Y == -4 then
- House1X = House1X - 2
- else
- if House1maxX[2] == House1X - 1 then
- else
- House1X = House1X - 1
- end
- end
- elseif selectedMap == "Map2" then
- if Map2maxX[2] == Map2X - 1 then
- if Map2X == -12 and Map2Y == 1 then
- Map2X = Map2X - 1
- end
- else
- Map2X = Map2X - 1
- end
- else
- selectedMap = "Map1"
- if Map1maxX[2] == Map1X - 1 then
- else
- Map1X = Map1X - 1
- end
- end
- end
- if key == D then
- if selectedMap == "Map1" then
- if Map1maxX[1] == Map1X + 1 then
- if Map1X == 12 and Map1Y == 1 then
- Map1X = Map1X + 1
- end
- else
- Map1X = Map1X + 1
- end
- elseif selectedMap == "House1" then
- if House1X == -12 and House1Y == -4 then
- House1X = House1X + 2
- elseif House1X == -10 and House1Y == -4 then
- House1X = House1X + 2
- else
- if House1maxX[1] == House1X + 1 then
- else
- House1X = House1X + 1
- end
- end
- elseif selectedMap == "Map2" then
- if Map2maxX[1] == Map2X + 1 then
- if Map2X == 12 and Map2Y == 1 then
- Map2X = Map2X + 1
- end
- else
- Map2X = Map2X + 1
- end
- else
- selectedMap = "Map1"
- if Map1maxX[1] == Map1X + 1 then
- else
- Map1X = Map1X + 1
- end
- end
- end
- end
- function LoadSteps()
- if fs.exists("Map1X") then
- file = io.open("Map1X", "r")
- Map1X = tonumber(file:read())
- file:close()
- end
- if fs.exists("Map1Y") then
- file = io.open("Map1Y", "r")
- Map1Y = tonumber(file:read())
- file:close()
- end
- if fs.exists("House1X") then
- file = io.open("House1X", "r")
- House1X = tonumber(file:read())
- file:close()
- end
- if fs.exists("House1Y") then
- file = io.open("House1Y", "r")
- House1Y = tonumber(file:read())
- file:close()
- end
- if fs.exists("selectedMap") then
- file = io.open("selectedMap", "r")
- selectedMap = file:read()
- file:close()
- end
- if fs.exists("Money") then
- file = io.open("Money", "r")
- Money = tonumber(file:read())
- file:close()
- end
- if fs.exists("Username") then
- file = io.open("Username", "r")
- Username = file:read()
- file:close()
- end
- if fs.exists("HP") then
- file = io.open("HP", "r")
- HP = tonumber(file:read())
- file:close()
- end
- if fs.exists("Map2X") then
- file = io.open("Map2X", "r")
- Map2X = tonumber(file:read())
- file:close()
- end
- if fs.exists("Map2Y") then
- file = io.open("Map2Y", "r")
- Map2Y = tonumber(file:read())
- file:close()
- end
- if fs.exists("MainMenuY") then
- file = io.open("MainMenuY", "r")
- MainMenuY = tonumber(file:read())
- file:close()
- end
- if fs.exists("showMainMenu") then
- file = io.open("showMainMenu", "r")
- showMainMenu = file:read()
- file:close()
- end
- end
- function SaveSteps()
- file = io.open("Map1X", "w")
- file:write(tostring(Map1X))
- file:close()
- file = io.open("Map1Y", "w")
- file:write(tostring(Map1Y))
- file:close()
- file = io.open("Map2X", "w")
- file:write(tostring(Map2X))
- file:close()
- file = io.open("Map2Y", "w")
- file:write(tostring(Map2Y))
- file:close()
- file = io.open("House1X", "w")
- file:write(tostring(House1X))
- file:close()
- file = io.open("House1Y", "w")
- file:write(tostring(House1Y))
- file:close()
- file = io.open("selectedMap", "w")
- file:write(selectedMap)
- file:close()
- file = io.open("Money", "w")
- file:write(tostring(Money))
- file:close()
- file = io.open("HP", "w")
- file:write(tostring(HP))
- file:close()
- file = io.open("MainMenuY", "w")
- file:write(tostring(MainMenuY))
- file:close()
- file = io.open("showMainMenu", "w")
- file:write(showMainMenu)
- file:close()
- if Remaining == 0 then
- -- os.reboot() -- Laggy, but never crashes
- os.reboot()
- end
- end
- loadWithCords()
- LoadSteps()
- GetSteps()
- CurrentMap()
- giveMessage()
- term.setCursorPos(1,1)
- if ShowCords == true then
- if selectedMap == "Map1" then
- print("Cords: X: ",Map1X," Y: ",Map1Y)
- elseif selectedMap == "Map2" then
- print("Cords: X: ",Map2X," Y: ",Map2Y)
- elseif selectedMap == "House1" then
- print("Cords: X: ",House1X," Y: ",House1Y)
- else
- print("Cords: X: ",Map1X," Y: ",Map1Y)
- end
- end
- if ShowStepsReboot == true then
- term.setCursorPos(1,18)
- print(Remaining," steps remaining until reboot")
- end
- term.setCursorPos(1,19)
- if showMainMenu == "true" then
- mainMenu()
- else
- if HP == 0 then
- deathMessage()
- else
- StartUp()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement