Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local computer = require("computer")
- local event = require("event")
- local inet = require("internet")
- local osv = "1.051"
- function prdon ()
- print(" __n__n__\n .------`-\00/-'\n / ## ## (oo)\n / ## __ ./\n |//YY |/\n ||| |||")
- end
- function prdontab ()
- print("---------------------------------")
- print(" Don Tablet OS ")
- print("---------------------------------")
- end
- function randomad ()
- local adc = math.random(0, 5)
- if (adc == 0) then
- print("Want your ad here? Go to the Don Shack and ask us about our ad system!")
- elseif (adc == 1) then
- print("Have you ever needed an item but you cant spend the time to get it yourself?\nThen use The Don ordering system! select option 1 at your main menu today!")
- elseif (adc == 2) then
- print("Have you ever wants a computer program like your neighbor bob?\nThen order from Don Shack! select option 3 at your main menu today!")
- elseif (adc == 3) then
- print("go to the record store and buy songs please my family needs food!")
- elseif (adc == 4) then
- print("Want your own ordering app for your store?\nSelect Don shack under shops!")
- elseif (adc == 5) then
- print("Want some pizza? Order some now! Select Don Pizzeria under shops!")
- end
- print("---------------------------------")
- end
- function checkforupdate ()
- local response = inet.request("http://secondary.infinity-servers.com:9000/version/get", "0")
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- if (body == osv) then
- print("OS is up to date")
- else
- print("Current OS:" .. osv .. " Available OS:" .. body)
- end
- end
- function getnewannouncements ()
- local response = inet.request("http://secondary.infinity-servers.com:9000/announcement/get", "0")
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- if (body == "") then
- io.write()
- else
- print(body)
- end
- end
- function printexception ()
- print("Current exemptions:")
- print("No Pets from the mods inventory pets!")
- print("No Red Matter or Dark Matter!")
- print("Nothing from Mystical Agriculture")
- print("Nothing from Evilcraft")
- print("No Fluids")
- print("")
- end
- function adminstuff ()
- tmprun2 = "True"
- while (tmprun2 == "True") do
- os.execute("cls")
- print("select and option")
- print("1) Make new OS Current Version")
- print("2) Make new OS an input version")
- print("3) New Announcement")
- print("4) back")
- local choice = io.read()
- if (choice == "1") then
- local response = inet.request("http://secondary.infinity-servers.com:9000/version/set", tostring(osv))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- print(body)
- os.sleep(5)
- elseif (choice == "2") then
- print("current OS version:" .. osv)
- print("enter new OS version")
- local temp = io.read()
- local response = inet.request("http://secondary.infinity-servers.com:9000/version/set", tostring(temp))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- elseif (choice == "3") then
- print("enter new Announcement")
- local temp = io.read()
- local response = inet.request("http://secondary.infinity-servers.com:9000/announcement/set", tostring(temp))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- elseif (choice == "4") then
- tmprun2 = "False"
- end
- end
- end
- local tname = ""
- runcheck = "True"
- while (runcheck == "True") do
- os.execute("cls")
- print("Welcome " .. tname)
- prdontab()
- prdon()
- print("Please press enter to login.")
- local e = {event.pull("key_down")}
- for k, v in pairs(e) do
- if (k == 5) then
- tname = v
- end
- end
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseget/" .. tname)
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- if (body == "User not in system. Make sure it was spelled correctly") then
- print("User not in system. Make contact buttercheetah!")
- os.sleep(2)
- else
- print("Login Succsesfull")
- os.sleep(1)
- runcheck = "False"
- end
- end
- while (1 == 1) do
- os.execute("cls")
- print("Welcome " .. tname)
- checkforupdate()
- getnewannouncements()
- prdontab()
- prdon()
- randomad()
- print("1) The Don Services")
- print("2) Shops")
- print("3) Mobile Banking")
- print("4) settings")
- local usersel = io.read()
- if (usersel == "admin") then
- adminstuff()
- elseif (usersel == "1") then
- local tmprun4 = "True"
- while (tmprun4 == "True") do
- os.execute("cls")
- print("Welcome " .. tname)
- prdontab()
- prdon()
- print("1) Order")
- print("2) Message Don")
- print("3) Message other player")
- print("4) Read your messages")
- print("5) back")
- local choice = io.read()
- if (choice == "1") then
- os.execute("cls")
- print("Thank you for your intrest in the Don Ordering System!\nWould you like to take a minute to read our item exemptions?")
- print("Y/n")
- local readsel = io.read()
- if (readsel == n) then
- os.execute("cls")
- else
- os.execute("cls")
- printexception()
- print("click enter to return")
- io.read()
- os.execute("cls")
- end
- print("Please input the item wanted! ex: apple")
- local titem = io.read()
- print("Please input the quantity wanted! ex: 10 stacks or 5 items")
- local tquantity = io.read()
- print("Please input delivery location! ex: My base or x=123 z=456")
- local tloc = io.read()
- print("Please input any notes. leave blank if none")
- local tnote = io.read()
- if (tnote == "") then
- tnote = "none"
- end
- os.execute("cls")
- prdontab()
- print("Getting ready to order " .. tquantity .. " of " .. titem .. " at " .. tloc .. " With the note: " .. tnote)
- print("please note you CANNOT cancel this order. would you like to continue?\nY/n")
- local confirmitation = io.read()
- if (confirmitation == "n") then
- print("Canceling order")
- else
- local response = inet.request("http://secondary.infinity-servers.com:9000/webhook/mcorder", tostring(tname .. " ordered " .. tquantity .. " of " .. titem .. " at " .. tloc .. " With the note: " .. tnote))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- print("Sent Order")
- end
- elseif (choice == "2") then
- os.execute("cls")
- print("Please input your message!")
- local tmess = io.read()
- os.execute("cls")
- prdontab()
- print("Getting to send: " .. tname .. ": " .. tmess)
- print("please note you CANNOT unsend this message. would you like to continue?\nY/n")
- local confirmitation = io.read()
- if (confirmitation == "n") then
- print("Canceling")
- else
- local response = inet.request("http://secondary.infinity-servers.com:9000/webhook/mcorder", tostring(tname .. ": " .. tmess))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- print("Sent Message!")
- end
- elseif (choice == "3") then
- os.execute("cls")
- print("Please input name of player you wish to send a message to")
- local sname = io.read()
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseget/" .. sname)
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- if (body == "User not in system. Make sure it was spelled correctly") then
- print(body)
- os.sleep(2)
- else
- os.execute("cls")
- print("Please input your message")
- local smessage = io.read()
- local response = inet.request("http://secondary.infinity-servers.com:9000/message/set", tostring(sname .. "|" .. tname .. ": " .. smessage))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- end
- elseif (choice == "4") then
- os.execute("cls")
- print("Messages:")
- local response = inet.request("http://secondary.infinity-servers.com:9000/message/get", tostring(tname))
- local messages = ""
- for chunk in response do
- messages = messages .. chunk
- end
- for i=0,#messages,1 do
- tmp = string.sub(messages,i,i)
- if (tmp == "|") then
- print("")
- else
- io.write(tmp)
- end
- end
- print("To erase your messages enter [1] otherwise press enter")
- local tsel = io.read()
- if (tsel == "1") then
- local response = inet.request("http://secondary.infinity-servers.com:9000/message/delete", tostring(tname))
- end
- elseif (choice == "5") then
- tmprun4 = "False"
- end
- end
- elseif (usersel == "2") then
- local tmprun4 = "True"
- while (tmprun4 == "True") do
- os.execute("cls")
- print("Welcome " .. tname)
- prdontab()
- prdon()
- print("1) Don Shack")
- print("2) PapaDons")
- print("3) Dragons Record Store")
- print("9) back")
- local choice = io.read()
- if (choice == "1") then
- os.execute("cls")
- print("Please input your order! \nex: a program to open and close a iron door witha password")
- local tmess = io.read()
- os.execute("cls")
- prdontab()
- print("Getting to order: " .. tname .. " wants a program to: " .. tmess)
- print("please note you CANNOT unsend this order. would you like to continue?\nY/n")
- local confirmitation = io.read()
- if (confirmitation == "n") then
- print("Canceling")
- else
- local response = inet.request("http://secondary.infinity-servers.com:9000/webhook/mcorder", tostring(tname .. " wants a program to: " .. tmess))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- print("Sent Message!")
- end
- elseif (choice == "2") then
- local tmprun2 = "True"
- local pizzas = ""
- local totalcost = 0
- while (tmprun2 == "True") do
- os.execute("cls")
- io.write("Your cart: ")
- if (pizzas == "") then
- print("Empty")
- else
- print(pizzas)
- end
- print("Please select an option!")
- print("1) Add Pizza")
- print("2) Checkout")
- print("3) Quit")
- local choice = io.read()
- if (choice == "1") then
- local tmprun3 = "True"
- while (tmprun3 == "True") do
- os.execute("cls")
- io.write("Your cart: ")
- if (pizzas == "") then
- print("Empty")
- else
- print(pizzas)
- end
- print("Please select an option!\nPlease Note once you add a pizza you wont be able to remove it\n")
- print("1) Add Cheese Pizza - $2")
- print("2) Add Supreme Pizza - $3")
- print("3) Add Meat Feast Pizza - $4")
- print("4) Go back")
- local choice = io.read()
- if (choice == "1") then
- print("\nHow many pizzas would you like")
- local count = io.read("*l")
- pizzas = pizzas .. "Cheese Pizza x" .. count .. "|"
- totalcost = totalcost + 2
- elseif (choice == "2") then
- print("\nHow many pizzas would you like")
- local count = io.read("*l")
- pizzas = pizzas .. "Supreme Pizza x" .. count .. "|"
- totalcost = totalcost + (count * 3)
- elseif (choice == "3") then
- print("\nHow many pizzas would you like")
- local count = io.read("*l")
- pizzas = pizzas .. "Meat Feast Pizza x" .. count .. "|"
- totalcost = totalcost + 4
- elseif (choice == "4") then
- tmprun3 = "False"
- end
- end
- elseif (choice == "2") then
- io.write("Your cart: ")
- if (pizzas == "") then
- print("Empty")
- else
- print(pizzas)
- end
- print("Total cost: " .. totalcost)
- print("Is the total ok?")
- print("NOTE: pressing y will immediatly charge your account and place the order.\nPressing n will immediatly cancel this transaction and kick you to the main menu")
- print("\nY/n")
- local choice = io.read()
- if (choice == "n" or choice == "N") then
- print("Canceling order.")
- os.sleep(5)
- tmprun2 = "False"
- else
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseset", tostring(tname .. "|Pizza purchase" .. "|1|" .. totalcost))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseset", tostring("Don|Don Pizza Payment" .. "|1|" .. -totalcost))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- local response = inet.request("http://secondary.infinity-servers.com:9000/webhook/mcorder", tostring(tname .. " ordered " .. pizzas .. " !Note this order has been paid for!"))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- tmprun2 = "False"
- end
- elseif (choice == "3") then
- tmprun2 = "False"
- end
- end
- elseif (choice == "3") then
- os.execute("cls")
- print("Please input the name of your song. \nNOTE: This is the name that will appear on the disk!")
- local tdiskname = io.read()
- os.execute("cls")
- print("Please input the youtube URL. \nNOTE: press the ins or insert key to paste")
- local tURL = io.read()
- os.execute("cls")
- prdontab()
- print("Getting to send: " .. tname .. " Ordered the song (" .. tdiskname .. ")\nURL: " .. tURL)
- print("\nplease note you CANNOT unsend this order.\nThe Don and his associates can not garentee the timely delivery of this order\nas this shop is not controlled by the Don.\nWould you like to continue?\nY/n")
- local confirmitation = io.read()
- if (confirmitation == "n") then
- print("Canceling")
- else
- local response = inet.request("http://secondary.infinity-servers.com:9000/dragonrecordorder", tostring(tname .. " Ordered the song (" .. tdiskname .. ") URL: " .. tURL))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- print("Sent Message!")
- end
- elseif (choice == "9") then
- tmprun4 = "False"
- end
- end
- elseif (usersel == "3") then
- local function getuserbal ()
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseget/" .. tname)
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- local Value = tonumber(body)
- if (Value > 0) then
- Value = -Value
- elseif (Value < 0) then
- Value = Value * -1
- end
- return Value
- end
- local tmprun2 = "True"
- while (tmprun2 == "True") do
- local cbal = getuserbal()
- os.execute("cls")
- print("Current account balance: " .. tostring(cbal))
- print("1) Send money to another account")
- print("2) return")
- local choice = io.read()
- if (choice == "1") then
- if (cbal > tonumber(0)) then
- print("Please input name of other account!")
- local oac = io.read()
- print("Please Input amount to transfer!\nNOTE:ONLY ENTER NUMBERS! If letters are written, many things may break.")
- local transfer = io.read()
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseget/" .. oac)
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- if (body == "User not in system. Make sure it was spelled correctly") then
- print(body)
- os.sleep(2)
- else
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseset", tostring(tname .. "|Balance Transfer to " .. oac .. "|1|" .. transfer))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- local response = inet.request("http://secondary.infinity-servers.com:9000/databaseset", tostring(oac .. "|Balance Transfer from" .. tname .. "|1|" .. -tonumber(transfer)))
- local body = ""
- for chunk in response do
- body = body .. chunk
- end
- end
- else
- print("Your balance is in the negative!")
- os.sleep(5)
- end
- elseif (choice == "2") then
- tmprun2 = "False"
- end
- end
- elseif (usersel == "4") then
- os.execute("cls")
- prdon()
- prdontab()
- print("OSV:" .. osv .. "\nUptime:" .. computer.uptime() .. "\nTotal Memory:" .. computer.totalMemory() .. "\nCPU:Don-APU-d7-1700m\n0)close\n1)update OS\n2)Reboot\n3)Shutdown")
- local usersel2 = io.read()
- if (usersel2 == "1") then
- os.execute("pastebin get -f qkhT3vTk tabletos")
- os.execute("reboot")
- end
- if (usersel2 == "2") then
- os.execute("reboot")
- end
- if (usersel2 == "3") then
- os.execute("shutdown")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement