summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-01-02 02:46:41 +0000
committerubq323 <ubq323@ubq323.website>2023-01-02 02:46:41 +0000
commit96f5a4351db8c9650cd3406de3f066f2847f0a73 (patch)
tree008f048e62be71a1f0e1ae511601acfef12cc4b8
parent7937536cf6e4458604422850832bd153540cbb5f (diff)
shop
-rw-r--r--shop2.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/shop2.lua b/shop2.lua
index 40e0e59..aeb1b66 100644
--- a/shop2.lua
+++ b/shop2.lua
@@ -30,6 +30,11 @@ local function pad(s,n)
local p = string.rep(" ",math.max(0,n-l))
return p..s
end
+local function centre(s,w)
+ s=tostring(s)
+ local l = #s
+ local p = math.floor(math.max(0,w-l)/2))
+ return string.rep(" ",p)..s
local function disp_shopscreen()
local m = peripheral.wrap"left"
@@ -59,6 +64,12 @@ local function disp_shopscreen()
fmt_row(m,ix+2,i[5],i[2],i[1],i[4])
end
+ local w,h = m.getSize()
+
+ printseq(m) {
+ {1,h-1}, colors.blue, centre("/pay <adr>@ac.kst <amount>",w)
+ }
+
end