Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Setup
- mon = peripheral.wrap("back")
- mon.clear()
- local function load()
- local file = io.open("sharePrices.stocks")
- local stocks = textutils.unserialize(file.readAll())
- file.close()
- return stocks
- end
- -- How to Invest
- mon.setTextColor(colors.cyan)
- mon.setCursorPos(1,31)
- mon.write("-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-")
- mon.setCursorPos(30,32)
- mon.write("To invest: /pay GriffinHeileYT {Price of Shares} and")
- mon.setCursorPos(30,33)
- mon.write("tell me what stock you would like to invest in.")
- -- Share Worth
- mon.setCursorPos(2,1)
- mon.write("Formula for Share Worth: #.# x 100 + 100")
- mon.setCursorPos(1,2)
- mon.write("-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-=+=-")
- -- Stock Colors
- good = colors.green
- bad = colors.red
- still = colors.white
- function color(clr)
- mon.setTextColor(clr)
- end
- -- Stocks
- function stock(line, clr, name, abbreviation, performance, sales)
- mon.setCursorPos(1,line)
- mon.setTextColor(clr)
- mon.write(name)
- mon.setCursorPos(15,line)
- mon.setTextColor(colors.white)
- mon.write(abbreviation)
- mon.setTextColor(clr)
- mon.setCursorPos(20, line)
- mon.setTextColor(performance)
- mon.write(sales)
- end
- stock(4, colors.white, "IRON", "IRON", good, stocks.iron)
- stock(5, colors.orange, "GOLD", "GOLD", good, "0.100")
- stock(6, colors.gray, "COAL", "COAL", bad, "-0.100")
- stock(7, colors.red, "REDSTONE", "RDSN", good, "0.100")
- stock(8, colors.cyan, "DIAMOND", "DMND", still, "0.000")
- stock(9, colors.lightGray, "ALUMINUM", "ALMN", good, "0.10")
- stock(10, colors.white, "GLASS", "GLSS", good, "1.05")
- stock(11, colors.cyan, "GELID CRYO", "CRYO", good, "0.3")
- stock(12, colors.yellow, "SULFUR", "SLFR", bad, "-0.100")
- stock(13, colors.lightBlue, "TIN", "TIN", bad, "-0.100")
- stock(14, colors.lightGray, "QUARTZ DUST", "QRTZ", still, "0.000")
- stock(15, colors.lightBlue, "CERTUS QUARTZ", "CQTZ", still, "0.000")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement