Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fs.exists("BLUTD-resetinhibiter") then
- term.clear()
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO") -- 49 spaces across
- print("O O")
- print("O O")
- print("O OOO O O O OOOO OOOO OOOO OOO OOOO O")
- print("O O O O O O O OO OO O O O O")
- print("O OOOO O O O OOOO OO OO O O OOOO O")
- print("O O O O O O O OO OO O O O O")
- print("O OOO OOOO OOO OOOO OO OOOO OOO OOOO O")
- print("O O")
- print("O systems.inc O")
- print("O O")
- print("O loading O")
- print("O O")
- print("O O")
- print("O O")
- print("O Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO") -- 17 spaces down
- term.setCursorPos(27,12)
- write(".")
- sleep(0.7)
- write(".")
- sleep(0.7)
- write(".")
- sleep(0.7)
- print(".")
- sleep(3)
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(3,3)
- print("This is the Login page. Default settings are;")
- term.setCursorPos(3,4)
- print("username: newuser")
- term.setCursorPos(3,5)
- print("password: pass")
- term.setCursorPos(3,7)
- write("username: ")
- usernameinput = read()
- term.setCursorPos(49,7)
- print("O")
- filereader = fs.open("username", "r")
- username = filereader.readLine()
- filereader.close()
- filereader = fs.open("username2", "r")
- username2 = filereader.readLine()
- filereader.close()
- if (usernameinput == username or usernameinput == username2) then
- term.setCursorPos(3,8)
- write("password: ")
- passwordinput = read("*")
- term.setCursorPos(49,8)
- print("O")
- filereader = fs.open("password", "r")
- password = filereader.readLine()
- filereader.close()
- filereader = fs.open("password2", "r")
- password2 = filereader.readLine()
- filereader.close()
- if (passwordinput == password and usernameinput == username or passwordinput == password2 and usernameinput == username2) then
- if (usernameinput == username) then
- userloggedin = 1
- else
- userloggedin = 2
- end
- sleep(1)
- term.setCursorPos(3,15)
- write("loading")
- sleep(0.6)
- write(".")
- sleep(0.7)
- write(".")
- sleep(0.8)
- write(".")
- sleep(0.9)
- write(".")
- sleep(1)
- term.clear()
- x = 11
- y = 6
- while true do
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O O")
- print("O Menu O")
- print("O O")
- print("O O")
- print("O [ ] Run [ ] Options O")
- print("O O")
- print("O [ ] BlueVille [ ] Lock O")
- print("O O")
- print("O [ ] BlueWord [ ] Shutdown O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- v = y-5
- if v == 1 and x == 11 then
- term.setCursorPos(3,14)
- print("Run any program from here")
- elseif v == 3 and x == 11 then
- term.setCursorPos(3,14)
- print("A new rpg game to go with BlueTide OS")
- elseif v == 5 and x == 11 then
- term.setCursorPos(3,14)
- print("Edit create and delete your files/programs")
- elseif v == 1 and x == 29 then
- term.setCursorPos(3,14)
- print("Other BlueTide features")
- elseif v == 3 and x == 29 then
- term.setCursorPos(3,14)
- print("Lock the terminal")
- elseif v == 5 and x == 29 then
- term.setCursorPos(3,14)
- print("Shutdown or reboot the computer")
- end
- term.setCursorPos(3,2)
- filereader = fs.open("username", "r")
- username = filereader.readLine()
- filereader.close()
- filereader = fs.open("username2", "r")
- username2 = filereader.readLine()
- filereader.close()
- if userloggedin == 2 then
- print("welcome ", username2 )
- else
- print("Welcome ", username )
- end
- pcid = os.getComputerLabel()
- term.setCursorPos(33,2)
- print("computer: ", pcid)
- term.setCursorPos(3,2)
- filereader = fs.open("username", "r")
- username = filereader.readLine()
- print("Welcome ", username )
- pcid = os.getComputerLabel()
- term.setCursorPos(33,2)
- print("computer: ", pcid)
- term.setCursorPos(x,y)
- print("O")
- id, key = os.pullEvent()
- if key == 208 and y < 10 then
- y = y+2
- elseif key == 208 and y == 10 then
- y = 6
- elseif key == 200 and y > 6 then
- y = y-2
- elseif key == 200 and y == 6 then
- y = 10
- elseif key == 203 and x > 11 then
- x = x-18
- elseif key == 203 and x == 11 then
- x = 29
- elseif key == 205 and x < 29 then
- x = x+18
- elseif key == 205 and x == 29 then
- x = 11
- elseif key == 28 then
- if y == 6 and x == 11 then
- term.clear()
- term.setCursorPos(1,1)
- while true do
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O You are in the run program O")
- print("O Please select which program you would like O")
- print("O to run: O")
- print("O Type exit to exit O")
- print("O Please note that some programs will not allow O")
- print("O you to return directly here... O")
- print("O There is a 15 second window for you to run O")
- print("O most programs O")
- print("O Currently compatible Programs: O")
- print("O All Craft OS programs O")
- print("O Tutorial O")
- print("O Your programs O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(11,4)
- program = read()
- if program == "exit" then
- break
- elseif program == "tutorial" then
- m = 1
- term.clear()
- term.setCursorPos(1,1)
- print("O Tutorial Page 1 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O O")
- print("O BlueTide OS Tutorial O")
- print("O As this tutorial is in its early stages it O")
- print("O only covers basic door locks, please contact O")
- print("O the developer if you have any ideas or O")
- print("O suggestions regarding what to include in this O")
- print("O tutorial, thank you. Press backspace to exit O")
- print("O Tutorial 1: user input and printing-doorlocks O")
- print("O I have used - instead of speech marks O")
- print("O To print/write something to the page, type in O")
- print("O print(-whatever you want it to write-) O")
- print("O You might want it to say O")
- print("O please put in your password: O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(1,1)
- while true do
- event, key = os.pullEvent()
- if key == 203 then
- m = m - 1
- elseif key == 205 then
- m = m + 1
- elseif key == 14 then
- break
- end
- if m == 1 then
- term.clear()
- term.setCursorPos(1,1)
- print("O Tutorial Page 1 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O O")
- print("O BlueTide OS Tutorial O")
- print("O As this tutorial is in its early stages it O")
- print("O only covers basic door locks, please contact O")
- print("O the developer if you have any ideas or O")
- print("O suggestions regarding what to include in this O")
- print("O tutorial, thank you. O")
- print("O Tutorial 1: user input and printing-doorlocks O")
- print("O I have used - instead of speech marks O")
- print("O To print/write something to the page, type in O")
- print("O print(-whatever you want it to write-) O")
- print("O You might want it to say O")
- print("O please put in your password: O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- elseif m == 2 then
- term.clear()
- term.setCursorPos(1,1)
- print("O Tutorial Page 2 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O You would do this by typing print(-please O")
- print("O put in your password: -) O")
- print("O If you want their cursor to be after the word O")
- print("O password: , use write(-please put in your O")
- print("O password: -), i would recommend this. O")
- print("O To get user input you type password = read() O")
- print("O This would make password the variable O")
- print("O Then you can type if password == -your O")
- print("O password- then O")
- print("O Do things i.e. rs.setOutput(-side-, true/ O")
- print("O false ) or print(-password correct-) O")
- print("O if you want it to do some thing if they get O")
- print("O it wrong then you type else after the do O")
- print("O things part O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- elseif m == 3 then
- term.clear()
- term.setCursorPos(1,1)
- print("O Tutorial Page 3 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O For example print(-incorrect password-) O")
- print("O to make your computer reboot or shutdown type O")
- print("O os.reboot() or os.shutdown() O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O thankyou for using the bluetide os and O")
- print("O tutorial O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- end
- end
- else
- term.setCursorPos(1,1)
- term.clear()
- shell.run(program)
- sleep(15)
- print("hello")
- end
- end
- elseif y == 8 and x == 11 then
- term.clear()
- term.setCursorPos(3,2)
- print("BlueVille - A Game By Benedict Allen")
- sleep(2)
- term.clear()
- local xer=3
- local yer=4
- while true do
- print("+-----------------------------------------------+")
- print("| Welcome to BlueVille... |")
- print("+-----------------------------------------------+")
- print("| New game |")
- print("| Load game |")
- print("| Credits-coming soon... |")
- print("| Exit |")
- print("| |")
- print("| controls: |")
- print("| move = arrows |")
- print("| use item = u |")
- print("| exit = backspace |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(xer,yer)
- print("-")
- id, key = os.pullEvent()
- if key == 208 and yer ~= 7 then
- yer = yer+1
- elseif key == 208 and yer == 7 then
- yer = 4
- elseif key == 200 and yer ~= 4 then
- yer = yer-1
- elseif key == 200 and yer == 4 then
- yer = 7
- elseif key == 28 then
- if yer == 4 then
- burger=0
- coke=0
- water=0
- apple=0
- fruitbag=0
- house=0
- experience=0
- job=0
- borrowed=0
- x=2
- y=4
- money=0
- rest=840
- while true do
- items = burger+coke+water+apple+fruitbag
- if rest <= 0 then
- term.clear()
- term.setCursorPos(1,1)
- print("You died because you ran out of rest...how sad")
- break
- elseif rest > 840 then
- rest = 840
- else
- if y == 6 and x == 9 then
- shopmenu = 6
- x = 8
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("+-----------------------------------------------+")
- print("| The Shop |")
- print("+-----------------------------------------------+")
- print("| Items you can buy |")
- print("| |")
- print("| Burger 5 money |")
- print("| Coke 2 money |")
- print("| Water 1 money |")
- print("| Lottery Ticket 10 money |")
- print("| Apple 2 money |")
- print("| Fruit bag 5 money |")
- print("| |")
- print("| Exit |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(35,2)
- print("money: ",money)
- term.setCursorPos(3,shopmenu)
- print("-")
- id, key = os.pullEvent()
- if key == 200 and shopmenu > 6 and shopmenu ~= 13 then
- shopmenu = shopmenu-1
- elseif key == 200 and shopmenu == 6 then
- shopmenu = 13
- elseif key == 200 and shopmenu == 13 then
- shopmenu = 11
- elseif key == 208 and shopmenu < 11 then
- shopmenu = shopmenu+1
- elseif key == 208 and shopmenu == 11 then
- shopmenu = 13
- elseif key == 208 and shopmenu == 13 then
- shopmenu = 6
- elseif key == 28 then
- if shopmenu == 6 and money >= 5 then
- money = money-5
- burger = burger+1
- term.setCursorPos(3,2)
- print("You bought a burger")
- sleep(1)
- print("looping")
- elseif shopmenu == 7 and money >= 2 then
- money = money-2
- coke = coke+1
- term.setCursorPos(3,2)
- print("You bought a coke")
- sleep(1)
- print("looping")
- elseif shopmenu == 8 and money >= 1 then
- money = money-1
- water = water+1
- term.setCursorPos(3,2)
- print("You bought a bottle of water")
- sleep(1)
- print("looping")
- elseif shopmenu == 9 and money >= 10 then
- money = money-10
- randomnumber = math.random(1,10)
- term.setCursorPos(3,14)
- write("your lucky number is: ")
- luckynumber = tonumber(read())
- if luckynumber == randomnumber then
- term.setCursorPos(3,2)
- print("You won 100 money ")
- money = money+100
- sleep(1)
- print("looping")
- else
- term.setCursorPos(3,2)
- print("You lost, better luck next time... ")
- sleep(1)
- print("looping")
- end
- elseif shopmenu == 10 and money >= 2 then
- money = money-2
- apple = apple+1
- term.setCursorPos(3,2)
- print("You bought an apple")
- sleep(1)
- print("looping")
- elseif shopmenu == 11 and money >= 5 then
- money = money-5
- fruitbag = fruitbag+1
- term.setCursorPos(3,2)
- print("You bought a fruitbag")
- sleep(1)
- print("looping")
- elseif shopmenu == 13 then
- break
- else
- term.setCursorPos(3,2)
- print("you don't have enough money")
- sleep(1)
- print("looping")
- end
- end
- end
- elseif y == 12 and x == 36 then
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("+-----------------------------------------------+")
- print("| The Town Centre |")
- print("+-----------------------------------------------+")
- print("| |")
- print("| 1.Buy House 12 money |")
- print("| |")
- print("| 2.Borrow 5 money |")
- print("| |")
- print("| 3.Get a job here |")
- print("| |")
- print("| 4.Leave |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(3,13)
- something = read()
- if something == "1" and money >= 12 then
- money = money-12
- term.setCursorPos(3,14)
- print("house bought")
- house = 1
- sleep(2)
- print("looping")
- elseif something == "1" and money < 12 then
- term.setCursorPos(3,14)
- print("You need to go to work and get some money first")
- sleep(2)
- print("looping")
- elseif something == "2" and borrowed == 0 then
- money = money+5
- borrowed = borrowed+1
- elseif something == "2" and borrowed == 1 then
- print("Your money has been payed back by 20%...")
- moneydividedbyfive = money/5
- money = money-moneydividedbyfive
- sleep(2)
- print("looping")
- elseif something == "3" then
- job = 2
- elseif something == "4" then
- x = 35
- break
- else
- term.setCursorPos(3,14)
- print("something went wrong...")
- sleep(2)
- print("looping")
- end
- end
- elseif y == 13 and x == 16 and house == 1 then
- print("+-----------------------------------------------+")
- print("| Home |")
- print("+-----------+-----------------------------------+")
- print("| | |")
- print("| Bedroom | |")
- print("| 1 | |")
- print("| | |")
- print("| | |")
- print("+---+ +----+ |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(3,2)
- write("How many hours would you like to sleep for? ")
- sleeptime = tonumber(read())
- term.setCursorPos(49,2)
- print("|")
- if sleeptime ~= "0" then
- sleep(sleeptime)
- sleepmins = sleeptime*60
- rest = rest+sleepmins
- term.setCursorPos(3,2)
- print("done sleeping ")
- x = 15
- else
- x = 15
- end
- elseif y == 13 and x == 16 and house == 0 then
- x = 15
- elseif y == 16 and x == 3 then
- k = fs.open("gamesaveburger", "w")
- k.writeLine(burger)
- k.close()
- k = fs.open("gamesavecoke", "w")
- k.writeLine(coke)
- k.close()
- k = fs.open("gamesavewater", "w")
- k.writeLine(water)
- k.close()
- k = fs.open("gamesaveapple", "w")
- k.writeLine(apple)
- k.close()
- k = fs.open("gamesavefruitbag", "w")
- k.writeLine(fruitbag)
- k.close()
- k = fs.open("gamesavehouse", "w")
- k.writeLine(house)
- k.close()
- k = fs.open("gamesaveexperience", "w")
- k.writeLine(experience)
- k.close()
- k = fs.open("gamesavejob", "w")
- k.writeLine(job)
- k.close()
- k = fs.open("gamesaveborrowed", "w")
- k.writeLine(borrowed)
- k.close()
- k = fs.open("gamesavemoney", "w")
- k.writeLine(money)
- k.close()
- k = fs.open("gamesaverest", "w")
- k.writeLine(rest)
- k.close()
- term.clear()
- term.setCursorPos(1,1)
- break
- elseif y == 5 and x == 19 then
- if experience < 44 then
- job = 1
- term.setCursorPos(3,2)
- print("You are at work for 6 hours ")
- sleep(6)
- rest = rest-360
- earnt = experience+6
- money = money+earnt
- term.setCursorPos(3,2)
- print("You now have ", money, " money ")
- sleep(1)
- experience = experience+1
- else
- job = 1
- term.setCursorPos(3,2)
- print("You are at work for 6 hours ")
- sleep(6)
- rest = rest-360
- earnt = experience+6
- money = money+earnt
- term.setCursorPos(3,2)
- print("You now have ", money, " money ")
- sleep(1)
- end
- x = 18
- else
- term.clear()
- term.setCursorPos(1,1)
- print("+-----------------------------------------------+")
- print("| |")
- print("+-----------------------------------------------+")
- print("| +-------------+ +----------+ |")
- print("| +------+ Work | | | |")
- print("| Shop | + | | Town | |")
- print("| +-+ | | | | Hall | |")
- print("| | | +--------+ | | | |")
- print("| +----+ | | | | |")
- print("| +----+ | | |")
- print("| +--------+ + | |")
- print("| + | | |")
- print("| House | + | |")
- print("| + | | | |")
- print("| | | +----------+ |")
- print("|> <SAVE +--------+ |")
- print("+-----------------------------------------------+")
- displayrest = rest/60
- term.setCursorPos(3,2)
- print("Energy: ",displayrest," hours Money: ",money," You have ",items," items")
- term.setCursorPos(x,y)
- print("*")
- id, key = os.pullEvent()
- if key == 208 and y < 16 then
- y = y+1
- elseif key == 208 and y == 16 then
- y = 4
- elseif key == 200 and y > 4 then
- y = y-1
- elseif key == 200 and y == 4 then
- y = 16
- elseif key == 203 and x > 2 then
- x = x-1
- elseif key == 203 and x == 2 then
- x = 48
- elseif key == 205 and x < 48 then
- x = x+1
- elseif key == 205 and x == 48 then
- x = 2
- elseif key == 22 then
- invmenu = 5
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("+-----------------------------------------------+")
- print("| |")
- print("+-----------------------------------------------+")
- print("| Item Amount Use Item |")
- print("| Burger(s) [ ] |")
- print("| Coke(s) [ ] |")
- print("| Water bottle(s) [ ] |")
- print("| Apple(s) [ ] |")
- print("| Fruitbag(s) [ ] |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(41,invmenu)
- print("use")
- term.setCursorPos(3,2)
- print("Inventory...")
- term.setCursorPos(23,5)
- print(burger)
- term.setCursorPos(23,6)
- print(coke)
- term.setCursorPos(23,7)
- print(water)
- term.setCursorPos(23,8)
- print(apple)
- term.setCursorPos(23,9)
- print(fruitbag)
- id, key = os.pullEvent()
- if key == 200 and invmenu > 5 then
- invmenu = invmenu-1
- elseif key == 200 and invmenu == 5 then
- invmenu = 9
- elseif key == 208 and invmenu < 9 then
- invmenu = invmenu+1
- elseif key == 208 and invmenu == 9 then
- invmenu = 5
- elseif key == 28 then
- if invmenu == 5 and burger >= 1 then
- burger = burger-1
- rest = rest+180
- elseif invmenu == 6 and coke >= 1 then
- coke = coke-1
- rest = rest+120
- elseif invmenu == 7 and water >= 1 then
- water = water-1
- if rest < 5 then
- rest = rest+60
- else
- rest = rest+0
- end
- elseif invmenu == 8 and apple >= 1 then
- apple = apple-1
- rest = rest+120
- elseif invmenu == 9 and fruitbag >= 1 then
- fruitbag = fruitbag-1
- rest = rest+180
- else
- term.setCursorPos(3,2)
- print("you have none of that item")
- sleep(2)
- print("looping")
- end
- elseif key == 14 then
- break
- end
- end
- elseif key == 14 then
- term.clear()
- term.setCursorPos(1,1)
- break
- end
- end
- end
- end
- elseif yer == 5 then
- k = fs.open("gamesaveburger", "r")
- burgerraw = k.readLine(burger)
- k.close()
- k = fs.open("gamesavecoke", "r")
- cokeraw = k.readLine(coke)
- k.close()
- k = fs.open("gamesavewater", "r")
- waterraw = k.readLine(water)
- k.close()
- k = fs.open("gamesaveapple", "r")
- appleraw = k.readLine(apple)
- k.close()
- k = fs.open("gamesavefruitbag", "r")
- fruitbagraw = k.readLine(fruitbag)
- k.close()
- k = fs.open("gamesavehouse", "r")
- houseraw = k.readLine(house)
- k.close()
- k = fs.open("gamesaveexperience", "r")
- experienceraw = k.readLine(experience)
- k.close()
- k = fs.open("gamesavejob", "r")
- jobraw = k.readLine(job)
- k.close()
- k = fs.open("gamesaveborrowed", "r")
- borrowedraw = k.readLine(borrowed)
- k.close()
- k = fs.open("gamesavemoney", "r")
- moneyraw = k.readLine(money)
- k.close()
- k = fs.open("gamesaverest", "r")
- restraw = k.readLine(rest)
- k.close()
- burger = tonumber(burgerraw)
- coke = tonumber(cokeraw)
- water = tonumber(waterraw)
- apple = tonumber(appleraw)
- fruitbag = tonumber(fruitbagraw)
- house = tonumber(houseraw)
- experience = tonumber(experienceraw)
- job = tonumber(jobraw)
- borrowed = tonumber(borrowedraw)
- x=3
- y=16
- money = tonumber(moneyraw)
- rest = tonumber(restraw)
- while true do
- items = burger+coke+water+apple+fruitbag
- if rest <= 0 then
- term.clear()
- term.setCursorPos(1,1)
- print("You died because you ran out of rest...how sad")
- sleep(2)
- print("looping")
- break
- elseif rest > 840 then
- rest = 840
- else
- if y == 6 and x == 9 then
- shopmenu = 6
- x = 8
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("+-----------------------------------------------+")
- print("| The Shop |")
- print("+-----------------------------------------------+")
- print("| Items you can buy |")
- print("| |")
- print("| Burger 5 money |")
- print("| Coke 2 money |")
- print("| Water 1 money |")
- print("| Lottery Ticket 10 money |")
- print("| Apple 2 money |")
- print("| Fruit bag 5 money |")
- print("| |")
- print("| Exit |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(35,2)
- print("money: ",money)
- term.setCursorPos(3,shopmenu)
- print("-")
- id, key = os.pullEvent()
- if key == 200 and shopmenu > 6 and shopmenu ~= 13 then
- shopmenu = shopmenu-1
- elseif key == 200 and shopmenu == 6 then
- shopmenu = 13
- elseif key == 200 and shopmenu == 13 then
- shopmenu = 11
- elseif key == 208 and shopmenu < 11 then
- shopmenu = shopmenu+1
- elseif key == 208 and shopmenu == 11 then
- shopmenu = 13
- elseif key == 208 and shopmenu == 13 then
- shopmenu = 6
- elseif key == 28 then
- if shopmenu == 6 and money >= 5 then
- money = money-5
- burger = burger+1
- term.setCursorPos(3,2)
- print("You bought a burger")
- sleep(1)
- print("looping")
- elseif shopmenu == 7 and money >= 2 then
- money = money-2
- coke = coke+1
- term.setCursorPos(3,2)
- print("You bought a coke")
- sleep(1)
- print("looping")
- elseif shopmenu == 8 and money >= 1 then
- money = money-1
- water = water+1
- term.setCursorPos(3,2)
- print("You bought a bottle of water")
- sleep(1)
- print("looping")
- elseif shopmenu == 9 and money >= 10 then
- money = money-10
- randomnumber = math.random(1,10)
- term.setCursorPos(3,14)
- write("your lucky number is: ")
- luckynumber = tonumber(read())
- if luckynumber == randomnumber then
- term.setCursorPos(3,2)
- print("You won 100 money ")
- money = money+100
- sleep(1)
- print("looping")
- else
- term.setCursorPos(3,2)
- print("You lost, better luck next time... ")
- sleep(1)
- print("looping")
- end
- elseif shopmenu == 10 and money >= 2 then
- money = money-2
- apple = apple+1
- term.setCursorPos(3,2)
- print("You bought an apple")
- sleep(1)
- print("looping")
- elseif shopmenu == 11 and money >= 5 then
- money = money-5
- fruitbag = fruitbag+1
- term.setCursorPos(3,2)
- print("You bought a fruitbag")
- sleep(1)
- print("looping")
- elseif shopmenu == 13 then
- break
- else
- term.setCursorPos(3,2)
- print("you don't have enough money")
- sleep(1)
- print("looping")
- end
- end
- end
- elseif y == 12 and x == 36 then
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("+-----------------------------------------------+")
- print("| The Town Centre |")
- print("+-----------------------------------------------+")
- print("| |")
- print("| 1.Buy House 12 money |")
- print("| |")
- print("| 2.Borrow 5 money |")
- print("| |")
- print("| 3.Get a job here |")
- print("| |")
- print("| 4.Leave |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(3,13)
- something = read()
- if something == "1" and money >= 12 then
- money = money-12
- term.setCursorPos(3,14)
- print("house bought")
- house = 1
- sleep(2)
- print("looping")
- elseif something == "1" and money < 12 then
- term.setCursorPos(3,14)
- print("You need to go to work and get some money first")
- sleep(2)
- print("looping")
- elseif something == "2" and borrowed == 0 then
- money = money+5
- borrowed = borrowed+1
- elseif something == "2" and borrowed == 1 then
- print("Your money has been payed back by 20%...")
- moneydividedbyfive = money/5
- money = money-moneydividedbyfive
- sleep(2)
- print("looping")
- elseif something == "3" then
- job = 2
- elseif something == "4" then
- x = 35
- break
- else
- term.setCursorPos(3,14)
- print("something went wrong...")
- sleep(2)
- print("looping")
- end
- end
- elseif y == 13 and x == 16 and house == 1 then
- print("+-----------------------------------------------+")
- print("| Home |")
- print("+-----------+-----------------------------------+")
- print("| | |")
- print("| Bedroom | |")
- print("| 1 | |")
- print("| | |")
- print("| | |")
- print("+---+ +----+ |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(3,2)
- write("How many hours would you like to sleep for? ")
- sleeptime = tonumber(read())
- term.setCursorPos(49,2)
- print("|")
- if sleeptime ~= "0" then
- sleep(sleeptime)
- sleepmins = sleeptime*60
- rest = rest+sleepmins
- term.setCursorPos(3,2)
- print("done sleeping ")
- x = 15
- else
- x = 15
- end
- elseif y == 13 and x == 16 and house == 0 then
- x = 15
- elseif y == 16 and x == 3 then
- k = fs.open("gamesaveburger", "w")
- k.writeLine(burger)
- k.close()
- k = fs.open("gamesavecoke", "w")
- k.writeLine(coke)
- k.close()
- k = fs.open("gamesavewater", "w")
- k.writeLine(water)
- k.close()
- k = fs.open("gamesaveapple", "w")
- k.writeLine(apple)
- k.close()
- k = fs.open("gamesavefruitbag", "w")
- k.writeLine(fruitbag)
- k.close()
- k = fs.open("gamesavehouse", "w")
- k.writeLine(house)
- k.close()
- k = fs.open("gamesaveexperience", "w")
- k.writeLine(experience)
- k.close()
- k = fs.open("gamesavejob", "w")
- k.writeLine(job)
- k.close()
- k = fs.open("gamesaveborrowed", "w")
- k.writeLine(borrowed)
- k.close()
- k = fs.open("gamesavemoney", "w")
- k.writeLine(money)
- k.close()
- k = fs.open("gamesaverest", "w")
- k.writeLine(rest)
- k.close()
- term.clear()
- term.setCursorPos(1,1)
- break
- elseif y == 5 and x == 19 then
- if experience < 44 then
- job = 1
- term.setCursorPos(3,2)
- print("You are at work for 6 hours ")
- sleep(6)
- rest = rest-360
- earnt = experience+6
- money = money+earnt
- term.setCursorPos(3,2)
- print("You now have ", money, " money ")
- sleep(1)
- experience = experience+1
- else
- job = 1
- term.setCursorPos(3,2)
- print("You are at work for 6 hours ")
- sleep(6)
- rest = rest-360
- earnt = experience+6
- money = money+earnt
- term.setCursorPos(3,2)
- print("You now have ", money, " money ")
- sleep(1)
- end
- x = 18
- else
- term.clear()
- term.setCursorPos(1,1)
- print("+-----------------------------------------------+")
- print("| |")
- print("+-----------------------------------------------+")
- print("| +-------------+ +----------+ |")
- print("| +------+ Work | | | |")
- print("| Shop | + | | Town | |")
- print("| +-+ | | | | Hall | |")
- print("| | | +--------+ | | | |")
- print("| +----+ | | | | |")
- print("| +----+ | | |")
- print("| +--------+ + | |")
- print("| + | | |")
- print("| House | + | |")
- print("| + | | | |")
- print("| | | +----------+ |")
- print("|> <SAVE +--------+ |")
- print("+-----------------------------------------------+")
- displayrest = rest/60
- term.setCursorPos(3,2)
- print("Energy: ",displayrest," hours Money: ",money," You have ",items," items")
- term.setCursorPos(x,y)
- print("*")
- id, key = os.pullEvent()
- if key == 208 and y < 16 then
- y = y+1
- elseif key == 208 and y == 16 then
- y = 4
- elseif key == 200 and y > 4 then
- y = y-1
- elseif key == 200 and y == 4 then
- y = 16
- elseif key == 203 and x > 2 then
- x = x-1
- elseif key == 203 and x == 2 then
- x = 48
- elseif key == 205 and x < 48 then
- x = x+1
- elseif key == 205 and x == 48 then
- x = 2
- elseif key == 22 then
- invmenu = 5
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("+-----------------------------------------------+")
- print("| |")
- print("+-----------------------------------------------+")
- print("| Item Amount Use Item |")
- print("| Burger(s) [ ] |")
- print("| Coke(s) [ ] |")
- print("| Water bottle(s) [ ] |")
- print("| Apple(s) [ ] |")
- print("| Fruitbag(s) [ ] |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("| |")
- print("+-----------------------------------------------+")
- term.setCursorPos(41,invmenu)
- print("use")
- term.setCursorPos(3,2)
- print("Inventory...")
- term.setCursorPos(23,5)
- print(burger)
- term.setCursorPos(23,6)
- print(coke)
- term.setCursorPos(23,7)
- print(water)
- term.setCursorPos(23,8)
- print(apple)
- term.setCursorPos(23,9)
- print(fruitbag)
- id, key = os.pullEvent()
- if key == 200 and invmenu > 5 then
- invmenu = invmenu-1
- elseif key == 200 and invmenu == 5 then
- invmenu = 9
- elseif key == 208 and invmenu < 9 then
- invmenu = invmenu+1
- elseif key == 208 and invmenu == 9 then
- invmenu = 5
- elseif key == 28 then
- if invmenu == 5 and burger >= 1 then
- burger = burger-1
- rest = rest+180
- elseif invmenu == 6 and coke >= 1 then
- coke = coke-1
- rest = rest+120
- elseif invmenu == 7 and water >= 1 then
- water = water-1
- if rest < 5 then
- rest = rest+60
- else
- rest = rest+0
- end
- elseif invmenu == 8 and apple >= 1 then
- apple = apple-1
- rest = rest+120
- elseif invmenu == 9 and fruitbag >= 1 then
- fruitbag = fruitbag-1
- rest = rest+180
- else
- term.setCursorPos(3,2)
- print("you have none of that item")
- sleep(2)
- print("looping")
- end
- elseif key == 14 then
- break
- end
- end
- elseif key == 14 then
- term.clear()
- term.setCursorPos(1,1)
- break
- end
- end
- end
- end
- elseif yer == 6 then
- term.setCursorPos(3,8)
- print("coming soon...")
- sleep(3)
- print("looping")
- elseif yer == 7 then
- x = 11
- y = 6
- term.clear()
- term.setCursorPos(1,1)
- break
- end
- end
- end
- elseif y == 10 and x == 11 then
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O BlueWord-Edit a Program or Document O")
- print("O O")
- print("O Would you like to: O")
- print("O Look at file-problem for files 17 lines+ O")
- print("O Add to file O")
- print("O Edit line in file O")
- print("O Create New/Reset File O")
- print("O Delete File O")
- print("O Exit O")
- print("O Choice: O")
- print("O (First 2 words of choice) O")
- print("O O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(11,11)
- choice = read()
- term.setCursorPos(49,11)
- print("O")
- if choice == "exit" then
- break
- elseif choice == "look at" then
- term.setCursorPos(3,13)
- write("which file? ")
- filetolookat = read()
- if fs.exists(filetolookat) then
- fileopener = fs.open(filetolookat, "r")
- filereader = fileopener.readAll()
- fileopener.close()
- term.clear()
- term.setCursorPos(1,1)
- print(filereader)
- sleep(20)
- print("looping")
- else
- term.setCursorPos(3,14)
- print("file doesn't exist...")
- sleep(2)
- print("looping")
- end
- elseif choice == "delete file" then
- term.setCursorPos(3,13)
- write("File to delete: ")
- delete = read()
- if fs.exists(delete) then
- term.setCursorPos(3,14)
- write("are you sure? ")
- answer = read()
- if answer == "yes" then
- fs.delete(delete)
- else
- end
- else
- term.setCursorPos(3,14)
- print("file is non-existent...")
- sleep(2)
- print("looping")
- end
- elseif choice == "create new" then
- term.setCursorPos(3,13)
- write("What would you like the file to be called? ")
- term.setCursorPos(3,14)
- filename = read()
- term.setCursorPos(49,14)
- print("O")
- if filename ~= "cancel" then
- newfile = fs.open(filename, "w")
- newfile.close()
- else
- print("cancelled")
- sleep(1)
- print("looping")
- end
- elseif choice == "edit line" then
- term.clear()
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O File Editer - Credits to MysticT O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(3,4)
- write("Filename: ")
- local filename = read()
- term.setCursorPos(49,4)
- print("O")
- local file = fs.open(filename, "r")
- if file then
- local tLines = {}
- local sLine = file.readLine()
- while sLine do
- table.insert(tLines, sLine)
- sLine = file.readLine()
- end
- file.close()
- term.setCursorPos(3,5)
- write("Line Number: ")
- local nLine = tonumber(read())
- term.setCursorPos(49,5)
- print("O")
- if nLine then
- term.setCursorPos(3,6)
- print("New Text: ")
- term.setCursorPos(3,7)
- local s = read()
- if nLine > #tLines then
- for i = #tLines, nLine - 1 do
- tLines[i] = ""
- end
- end
- tLines[nLine] = s
- local file = fs.open(filename, "w")
- if file then
- for _,line in ipairs(tLines) do
- file.writeLine(line)
- end
- file.close()
- else
- print("Error opening file to save")
- end
- else
- print("Line has to be a number")
- end
- else
- print("No such file ", filename)
- end
- elseif choice == "add to" then
- term.setCursorPos(3,11)
- write("What file would you like to add to? ")
- p = read()
- if fs.exists(p) then
- while true do
- term.clear()
- term.setCursorPos(1,3)
- npcr = fs.open(p, "r")
- programprint = npcr.readAll()
- print(programprint)
- npcr.close()
- term.setCursorPos(1,2)
- print("Your current text:")
- npcw = fs.open(p, "a")
- term.setCursorPos(1,1)
- npw = read()
- if npw == "exit" then
- npcw.close()
- break
- else
- npcw.writeLine(npw)
- npcw.close()
- end
- end
- else
- file = fs.open(p, "w")
- file.close()
- term.setCursorPos(3,13)
- print("file created...")
- sleep(2)
- print("looping")
- end
- end
- end
- elseif y == 6 and x == 29 then
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O Please type in the the number of the option O")
- print("O you would like to choose and exit to bo back O")
- print("O O")
- print("O 1. Redstone setter 6.N/A FIle Browser O")
- print("O 2. Change account O")
- print("O 3. Label computer O")
- print("O 4. Monitor print O")
- print("O 5. Reboot O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(3,4)
- option = read()
- term.setCursorPos(49,4)
- print("O")
- if option == "1" then
- term.setCursorPos(3,10)
- print("Which side would you like to set an output")
- term.setCursorPos(3,11)
- write ("from? ")
- rsside = read()
- term.setCursorPos(3,12)
- write("how many seconds? ")
- rstime = read()
- rs.setOutput(rsside, true )
- sleep(rstime)
- rs.setOutput(rsside, false )
- sleep(0.5)
- print(" ")
- elseif option == "exit" then
- break
- elseif option == "2" then
- term.setCursorPos(3,10)
- print("Please put in your password: ")
- term.setCursorPos(3,11)
- passwordinput = read("*")
- filereader = fs.open("password", "r")
- password = filereader.readLine()
- filereader.close()
- filereader = fs.open("password2", "r")
- password2 = filereader.readLine()
- filereader.close()
- if (passwordinput == password or passwordinput == password2) then
- y = 5
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O Local User Account Control O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(17,y)
- print("<")
- term.setCursorPos(35,y)
- print(">")
- term.setCursorPos(19,5)
- print("Change username")
- term.setCursorPos(19,6)
- print("Change password")
- term.setCursorPos(20,7)
- print("Edit account 2")
- term.setCursorPos(19,8)
- print("Reset account 2")
- term.setCursorPos(20,9)
- print("Reset account")
- term.setCursorPos(24,10)
- print("Exit")
- id, key = os.pullEvent()
- if key == 200 and y ~= 5 then
- y = y-1
- elseif key == 200 and y == 5 then
- y = 10
- elseif key == 208 and y ~= 10 then
- y = y+1
- elseif key == 208 and y == 10 then
- y = 5
- elseif key == 28 then
- if y == 5 then
- term.setCursorPos(3,12)
- print("Please type in your new username")
- term.setCursorPos(3,13)
- write("username: ")
- usernameinput = read()
- term.setCursorPos(49,13)
- print("O")
- username = fs.open("username", "w")
- username.write(usernameinput)
- username.close()
- term.setCursorPos(3,13)
- print("username saved ")
- sleep(3)
- print("looping")
- elseif y == 6 then
- term.setCursorPos(3,12)
- print("Please type in your new password")
- term.setCursorPos(3,13)
- write("password: ")
- passwordinput = read()
- term.setCursorPos(49,13)
- print("O")
- password = fs.open("password", "w" )
- password.write(passwordinput)
- password.close()
- term.setCursorPos(3,13)
- print("password saved ")
- sleep(3)
- print("looping")
- elseif y == 7 then
- term.setCursorPos(3,12)
- write("what would you like the account to be called: ")
- term.setCursorPos(3,13)
- username2 = read()
- term.setCursorPos(3,13)
- print("O")
- newaccount = fs.open("username2", "w")
- newaccount.writeLine(username2)
- newaccount.close()
- term.setCursorPos(3,13)
- write("what would you like the password to be: ")
- term.setCursorPos(3,14)
- password2 = read()
- term.setCursorPos(3,14)
- print("O")
- newaccount = fs.open("password2", "w")
- newaccount.writeLine(password2)
- newaccount.close()
- term.setCursorPos(3,14)
- print("account created")
- sleep(2)
- print("looping")
- elseif y == 8 then
- term.setCursorPos(3,12)
- write("Are you sure? ")
- sure = read()
- if sure == "yes" then
- k = fs.open("username2")
- k.writeLine("newuser")
- k.close()
- k = fs.open("password2")
- k.writeLine("pass")
- k.close()
- term.setCursorPos(3,13)
- print("deleted...")
- sleep(2)
- print("looping")
- else
- term.setCursorPos(3,13)
- print("cancelling...")
- sleep(2)
- print("looping")
- end
- elseif y == 9 then
- term.setCursorPos(3,12)
- write("Are you sure? ")
- sure = read()
- if sure == "yes" then
- term.setCursorPos(3,13)
- print("resetting...")
- sleep(2)
- reset = fs.open("username", "w" )
- reset.writeLine("newuser")
- reset.close()
- reset = fs.open("password", "w" )
- reset.writeLine("pass")
- reset.close()
- else
- term.setCursorPos(3,13)
- print("cancelled...")
- sleep(2)
- print("looping")
- end
- elseif y == 10 then
- break
- end
- end
- end
- else
- term.setCursorPos(3,11)
- print("password incorrect...")
- sleep(2)
- print("looping")
- end
- elseif option == "3" then
- term.setCursorPos(3,10)
- print("what would you like to set the computer label")
- term.setCursorPos(3,11)
- write("to? ")
- label = read()
- os.setComputerLabel(label)
- elseif option == "4" then
- term.setCursorPos(3,10)
- print("what side is the monitor on")
- term.setCursorPos(3,11)
- side = read()
- term.setCursorPos(3,12)
- print("what do you want to print?, print nothing to")
- term.setCursorPos(3,13)
- write("clear... ")
- input = read()
- term.setCursorPos(3,13)
- print("type yes to continue...")
- term.setCursorPos(3,14)
- answer = read()
- if answer == "yes" then
- monitor = peripheral.wrap(side)
- term.redirect(monitor)
- term.clear()
- term.setCursorPos(1,1)
- print(input)
- term.restore()
- else
- term.setCursorPos(3,14)
- print("cancelled")
- sleep(1)
- print("looping")
- end
- elseif option == "5" then
- os.reboot()
- else
- term.setCursorPos(3,10)
- print("unrecognised command...")
- sleep(2)
- print("looping")
- end
- end
- elseif y == 8 and x == 29 then
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(3,3)
- print("This is the Login page. Default settings are;")
- term.setCursorPos(3,4)
- print("username: newuser")
- term.setCursorPos(3,5)
- print("password: pass")
- term.setCursorPos(3,7)
- write("username: ")
- usernameinput = read()
- term.setCursorPos(49,7)
- print("O")
- filereader = fs.open("username", "r")
- username = filereader.readLine()
- filereader.close()
- filereader = fs.open("username2", "r")
- username2 = filereader.readLine()
- filereader.close()
- if (usernameinput == username or usernameinput == username2) then
- term.setCursorPos(3,8)
- write("password: ")
- passwordinput = read("*")
- term.setCursorPos(49,8)
- print("O")
- filereader = fs.open("password", "r")
- password = filereader.readLine()
- filereader.close()
- filereader = fs.open("password2", "r")
- password2 = filereader.readLine()
- filereader.close()
- if (passwordinput == password and usernameinput == username or passwordinput == password2 and usernameinput == username2) then
- break
- else
- term.setCursorPos(3,9)
- print("incorrect password")
- sleep(2)
- print("nothing")
- end
- else
- term.setCursorPos(3,8)
- print("incorrect username")
- sleep(2)
- print("nope")
- end
- end
- elseif y == 10 and x == 29 then
- term.setCursorPos(11,5)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(10,6)
- print("O O")
- term.setCursorPos(10,7)
- print("O Are you sure you want to O")
- term.setCursorPos(10,8)
- print("O shutdown? O")
- term.setCursorPos(10,9)
- print("O Press enter to shutdown O")
- term.setCursorPos(10,10)
- print("O Press any key to cancel O")
- term.setCursorPos(10,11)
- print("O Press r to reboot O")
- term.setCursorPos(10,12)
- print("O O")
- term.setCursorPos(11,13)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- id, key = os.pullEvent()
- if key == 28 then
- os.shutdown()
- elseif key == 19 then
- os.reboot()
- else
- sleep(2)
- print("looping")
- end
- end
- end
- end
- else
- term.setCursorPos(3,9)
- print("incorrect password")
- sleep(2)
- print("nothing")
- end
- else
- term.setCursorPos(3,8)
- print("incorrect username")
- sleep(2)
- print("nothing")
- end
- end
- else
- y = 7
- c = 19
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- print("O Welcome to your new computer, there are O")
- print("O currently 2 known systems loaded. O")
- print("O Would you like to install and run BlueTide OS O")
- print("O O")
- print("O O")
- print("O Install O")
- print("O Uninstall O")
- print("O Quit O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O O")
- print("O BlueTide OS Made by: Benedict Allen O")
- print("OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO")
- term.setCursorPos(c,y)
- print(">")
- event, key = os.pullEvent()
- if key == 208 and y < 9 then
- y = y+1
- elseif key == 208 and y == 9 then
- y = 7
- elseif key == 200 and y > 7 then
- y = y-1
- elseif key == 200 and y == 7 then
- y = 9
- elseif key == 28 then
- if y == 7 then
- term.setCursorPos(3,6)
- write("checking left...")
- sleep(1)
- print("status: ", peripheral.isPresent("left"), ", type: ", peripheral.getType("left"))
- term.setCursorPos(3,7)
- write("checking right...")
- sleep(1)
- print("status: ", peripheral.isPresent("right"), ", type: ", peripheral.getType("right"))
- term.setCursorPos(3,8)
- write("checking back...")
- sleep(1)
- print("status: ", peripheral.isPresent("back"), ", type: ", peripheral.getType("back"))
- term.setCursorPos(3,9)
- write("checking bottom...")
- sleep(1)
- print("status: ", peripheral.isPresent("bottom"), ", type: ", peripheral.getType("bottom"))
- term.setCursorPos(3,10)
- write("checking top...")
- sleep(1)
- print("status: ", peripheral.isPresent("top"), ", type: ", peripheral.getType("top"))
- sleep(2)
- term.setCursorPos(3,11)
- print("peripherals assessed")
- term.setCursorPos(3,12)
- print("writing user files...")
- username2 = fs.open("username2", "w")
- username2.write("newuser")
- username2.close()
- password2 = fs.open("password2", "w")
- password2.write("pass")
- password2.close()
- username = fs.open("username", "w")
- username.write("newuser")
- username.close()
- password = fs.open("password", "w")
- password.write("pass")
- password.close()
- startup = fs.open("startup", "w")
- startup.write("shell.run(\"BlueTideOS-all-in-one\")")
- startup.close()
- term.setCursorPos(3,13)
- print("creating system files...")
- tutorial = fs.open("tutorial", "w")
- tutorial.writeLine("m = 1")
- tutorial.writeLine("term.clear()")
- tutorial.writeLine("term.setCursorPos(1,1)")
- tutorial.writeLine("print(\"O Tutorial Page 1 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O BlueTide OS Tutorial O\")")
- tutorial.writeLine("print(\"O As this tutorial is in its early stages it O\")")
- tutorial.writeLine("print(\"O only covers basic door locks, please contact O\")")
- tutorial.writeLine("print(\"O the developer if you have any ideas or O\")")
- tutorial.writeLine("print(\"O suggestions regarding what to include in this O\")")
- tutorial.writeLine("print(\"O tutorial, thank you. O\")")
- tutorial.writeLine("print(\"O Tutorial 1: user input and printing-doorlocks O\")")
- tutorial.writeLine("print(\"O I have used - insead of speech marks O\")")
- tutorial.writeLine("print(\"O To print/write something to the page, type in O\")")
- tutorial.writeLine("print(\"O print(-whatever you want it to write-) O\")")
- tutorial.writeLine("print(\"O You might want it to say O\")")
- tutorial.writeLine("print(\"O please put in your password: O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O BlueTide OS Made by: Benedict Allen O\")")
- tutorial.writeLine("print(\"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\")")
- tutorial.writeLine("term.setCursorPos(1,1)")
- tutorial.writeLine("while true do")
- tutorial.writeLine("event, key = os.pullEvent()")
- tutorial.writeLine("if key == 203 then")
- tutorial.writeLine("m = m - 1")
- tutorial.writeLine("elseif key == 205 then")
- tutorial.writeLine("m = m + 1")
- tutorial.writeLine("elseif key == 14 then")
- tutorial.writeLine("shell.run(\"bluetideos\")")
- tutorial.writeLine("end")
- tutorial.writeLine("if m == 1 then ")
- tutorial.writeLine("term.clear()")
- tutorial.writeLine("term.setCursorPos(1,1)")
- tutorial.writeLine("print(\"O Tutorial Page 1 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O BlueTide OS Tutorial O\")")
- tutorial.writeLine("print(\"O As this tutorial is in its early stages it O\")")
- tutorial.writeLine("print(\"O only covers basic door locks, please contact O\")")
- tutorial.writeLine("print(\"O the developer if you have any ideas or O\")")
- tutorial.writeLine("print(\"O suggestions regarding what to include in this O\")")
- tutorial.writeLine("print(\"O tutorial, thank you. O\")")
- tutorial.writeLine("print(\"O Tutorial 1: user input and printing-doorlocks O\")")
- tutorial.writeLine("print(\"O I have used - instead of speech marks O\")")
- tutorial.writeLine("print(\"O To print/write something to the page, type in O\")")
- tutorial.writeLine("print(\"O print(-whatever you want it to write-) O\")")
- tutorial.writeLine("print(\"O You might want it to say O\")")
- tutorial.writeLine("print(\"O please put in your password: O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O BlueTide OS Made by: Benedict Allen O\")")
- tutorial.writeLine("print(\"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\")")
- tutorial.writeLine("elseif m == 2 then")
- tutorial.writeLine("term.clear()")
- tutorial.writeLine("term.setCursorPos(1,1)")
- tutorial.writeLine("print(\"O Tutorial Page 2 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\")")
- tutorial.writeLine("print(\"O You would do this by typing print(-please O\")")
- tutorial.writeLine("print(\"O put in your password: -) O\")")
- tutorial.writeLine("print(\"O If you want their cursor to be after the word O\")")
- tutorial.writeLine("print(\"O password: , use write(-please put in your O\")")
- tutorial.writeLine("print(\"O password: -), i would recommend this. O\")")
- tutorial.writeLine("print(\"O To get user input you type password = read() O\")")
- tutorial.writeLine("print(\"O This would make password the variable O\")")
- tutorial.writeLine("print(\"O Then you can type if password == -your O\")")
- tutorial.writeLine("print(\"O password- then O\")")
- tutorial.writeLine("print(\"O Do things i.e. rs.setOutput(-side-, true/ O\")")
- tutorial.writeLine("print(\"O false ) or print(-password correct-) O\")")
- tutorial.writeLine("print(\"O if you want it to do some thing if they get O\")")
- tutorial.writeLine("print(\"O it wrong then you type else after the do O\")")
- tutorial.writeLine("print(\"O things part O\")")
- tutorial.writeLine("print(\"O BlueTide OS Made by: Benedict Allen O\")")
- tutorial.writeLine("print(\"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\")")
- tutorial.writeLine("elseif m == 3 then")
- tutorial.writeLine("term.clear()")
- tutorial.writeLine("term.setCursorPos(1,1)")
- tutorial.writeLine("print(\"O Tutorial Page 3 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\")")
- tutorial.writeLine("print(\"O For example print(-incorrect password-) O\")")
- tutorial.writeLine("print(\"O to make your computer reboot or shutdown type O\")")
- tutorial.writeLine("print(\"O os.reboot() or os.shutdown() O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O thankyou for using the bluetide os and O\")")
- tutorial.writeLine("print(\"O tutorial O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O O\")")
- tutorial.writeLine("print(\"O BlueTide OS Made by: Benedict Allen O\")")
- tutorial.writeLine("print(\"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\")")
- tutorial.writeLine("end")
- tutorial.writeLine("end")
- tutorial.close()
- z = fs.open("BLUTD-resetinhibiter", "w")
- z.close()
- sleep(2)
- term.setCursorPos(3,14)
- print("Thank you for installing BlueTide OS for ")
- term.setCursorPos(3,15)
- print("computercraft...")
- sleep(2)
- os.reboot()
- elseif y == 8 then
- fs.delete("bluetideos")
- fs.delete("setup")
- fs.delete("bluetideos-all-in-one")
- os.reboot()
- elseif y == 9 then
- term.clear()
- term.setCursorPos(1,1)
- break
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment