From 076f1ee6c8d7501c0f352e3fb7f0ae9ef074cf60 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Mon, 2 Jan 2023 02:07:39 +0000 Subject: shop2 --- shop2.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 shop2.lua diff --git a/shop2.lua b/shop2.lua new file mode 100644 index 0000000..9e0818a --- /dev/null +++ b/shop2.lua @@ -0,0 +1,35 @@ +local ourname = "ac.kst" + +local ITEMS = { + {"dmn", 5, "minecraft:diamond"}, + {"blz", 10, "minecraft:blaze_rod"}, + {"ely", 40, "minecraft:elytra"}, +} + +local function printseq(m) return function(q) + for _,v in ipairs(q) do + if type(v) == "number" then + m.setTextColor(v) + elseif type(v) == "string" then + m.write(v) + elseif type(v) == "table" then + if #v == 2 then + -- position + m.setCursorPos(v[1],v[2]) + else + error("unknown format") + end + end + end +end end + + +local function disp_shopscreen() + local m = peripheral.wrap"right" + m.clear() + printseq(m) { + {1,1}, colors.orange, "apionics consortium store !!!" + } +end + +disp_shopscreen() -- cgit v1.2.3