From 8cd33d47363a8a180bdbd931c686e39c81398fbd Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 29 Dec 2022 22:38:15 +0000 Subject: shop --- shop.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shop.lua b/shop.lua index ae6acc8..bfa819c 100644 --- a/shop.lua +++ b/shop.lua @@ -3,6 +3,8 @@ key=assert(settings.get"krist.pkey","please set private key") -- d@ac.kst our_name = {"d","ac"} +PRICE = 5 + sres =textutils.unserializeJSON( http.post("https://krist.dev/ws/start","privatekey="..key).readAll()) assert(sres.ok,"not ok") @@ -35,7 +37,10 @@ function proctrans(tr) if tr.to ~= our_addr then return end if tr.type ~= "transfer" then return end if not (tr.sent_metaname == our_name[1] and tr.sent_name == our_name[2]) then return end - return parsemeta(tr.metadata) + local meta = parsemeta(tr.metadata) + + + end while true do @@ -49,6 +54,7 @@ while true do m.write(our_addr) end if msg.type == "event" and msg.event == "transaction" then + print(msgtxt) require"cc.pretty".pretty_print(proctrans(msg.transaction)) end end -- cgit v1.2.3