From c5b14b892066ec31ee9e7f49f608f9b530b00c5b Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 29 Dec 2022 23:31:30 +0000 Subject: shop --- shop.lua | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/shop.lua b/shop.lua index 590a1de..772e93b 100644 --- a/shop.lua +++ b/shop.lua @@ -128,6 +128,31 @@ function run_topdisp() end end -parallel.waitForAny(run_shop, run_topdisp) +function run_sidedisp() + local m = peripheral.wrap("left") + local function printseq(q) + for _,v in ipairs(q) do + if type(v) == "number" then + m.setTextColor(m) + elseif type(v) == "table" then + m.setCursorPos(v[1],v[2]) + else -- str + m.write(v) + end + end + end + while true do + printseq { + {1,1}, colors.red, "UBQ323 DIAMOND STORE!!!", + {1,2}, colors.white, "Stock: ", colors.yellow, stock_amt(), + {1,3}, colors.white, "Price: ", colors.yellow, PRICE.."kst/item", + {1,6}, colors.green, "--> /pay d@ac.kst "..PRICE.." <--" + } + os.sleep(5) + + end +end + +parallel.waitForAny(run_shop, run_topdisp, run_sidedisp) -- end -- cgit v1.2.3