Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --FILE: items
- return {
- ["Basic Electronics/Machinery"] = {
- ["Macerator"] = {
- io = 1,
- price = 25
- },
- ["Furnace"] = {
- io = 2,
- price = 15
- }
- },
- ["Advanced Electronics/Machinery"] = {
- ["Mass Fabricator"] = {
- io = -1,
- price = 2000
- }
- },
- ["Power Generation/Storage"] = {
- ["BatBox"] = {
- io = 3,
- price = 10
- },
- ["MFE"] = {
- io = 4,
- price = 50
- },
- ["MFSU"] = {
- io=5,
- price = 150
- }
- },
- ["Building"] = {
- ["Dirt"] = {
- io = 6,
- price = 1
- }
- },
- ["Tools/Weapons"] = {
- ["Packaxe"] = {
- io = 7,
- price = 20
- }
- },
- ["Armor"] = {
- ["Diamond"] = {
- ["Diamond Helmet"] = {
- io = -1,
- price = 100
- },
- ["Diamond Chestplate"] = {
- io = -1,
- price = 100
- },
- ["Diamond Leggings"] = {
- io = -1,
- price = 100
- },
- ["Diamond Boots"] = {
- io = -1,
- price = 100
- }
- }
- },
- ["Item Storage"] = {
- ["Chest"] = {
- io = 8,
- price = 6
- }
- },
- ["Equivalent Exchange"] = {
- ["MKIII Collector"] = {
- io = 9,
- price = 120000000
- }
- },
- ["Other"] = {
- ["A life"] = {
- io = 666,
- price = 168776513246545
- }
- }
- }
- --FILE: a
- shell.run("rm", "shop")
- shell.run("pastebin", "get", "mnt3pJ4K", "shop")
- shell.run("shop")
- --FILE: shop
- items = loadfile("items")()
- rs.setBundledOutput("right", 0)
- rs.setBundledOutput("left", 0)
- local function cprint(text, y)
- local w, h = term.getSize()
- local ox, oy = term.getCursorPos()
- y = y or oy
- term.setCursorPos(math.ceil((w / 2)-(text:len() / 2)),y)
- write(text)
- end
- local function getItems(side, color, amount)
- for i=1, amount do
- shell.run("redset", side, color, true)
- sleep(0.1)
- shell.run("redset", side, color, false)
- sleep(0.1)
- i = i+1
- end
- end
- function makePurchase(iname, idata)
- print("YOU JUST GOT "..iname.." ON IO "..idata.io.." FOR "..idata.price.." CREDITS, FUCK OFF :D")
- end
- function printMenu(items)
- term.clear()
- term.setCursorPos(1,1)
- print("################QTech Industries################")
- print("#################Automatic Shop#################")
- cprint("Make a selection", 4)
- term.setCursorPos(1,5)
- i = 1
- names = {}
- choices = {}
- for cat, contents in pairs(items) do
- print("["..i.."] "..cat)
- names[i] = cat
- choices[i] = contents
- i=i+1
- end
- choice = tonumber(io.read())
- if type(choice) == "number" then
- if choice >= 1 and choice <= #choices+1 then
- if choices[choice]["io"] or choices[choice]["price"] then
- makePurchase(names[choice], choices[choice])
- return
- else
- printMenu(choices[choice])
- end
- --return choices[choice]
- end
- end
- end
- --while true do
- printMenu(items)
- --FILE: packed
- --FILE: g
- while true do
- print(redstone.getInput("bottom"))
- sleep(0)
- end
- --FILE: startup
- parallel.waitForAny(function() while not redstone.getInput("bottom") do sleep(0) end end, function() shell.run("shop") end)
- --os.shutdown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement