summaryrefslogtreecommitdiff
path: root/shop.lua
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2022-12-29 22:38:15 +0000
committerubq323 <ubq323@ubq323.website>2022-12-29 22:38:15 +0000
commit8cd33d47363a8a180bdbd931c686e39c81398fbd (patch)
tree3e1b8c7d6366001ac762643fb0ce3d257cd91a23 /shop.lua
parent1b63923c98b94486ee59648e02ea4e0f4c0c82da (diff)
shop
Diffstat (limited to 'shop.lua')
-rw-r--r--shop.lua8
1 files changed, 7 insertions, 1 deletions
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