diff options
Diffstat (limited to 'pad/nodes/(-984,10,-3329).lua')
| -rw-r--r-- | pad/nodes/(-984,10,-3329).lua | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/pad/nodes/(-984,10,-3329).lua b/pad/nodes/(-984,10,-3329).lua index e1a0de7..a25f6b8 100644 --- a/pad/nodes/(-984,10,-3329).lua +++ b/pad/nodes/(-984,10,-3329).lua @@ -1,7 +1,38 @@ if event.type == "punch" then - if S.acc[event.name] ~= nil then --- digiline_send("output", "You already own a transport\npass. You can use it at\nany station or top-up your\nrides at a selling point.") --- else - digiline_send("commit", event.name) + digiline_send("commit", {name, F.cac(name)}) +end + +if event.channel == "ack" then + local catch = event.msg + name = catch[1] + wm = catch[2] + + if F.ack2(name, wm) then + digiline_send("ack_r", S.acc[name][wm]) + else + digiline_send("ack_r", false) end +end + +if event.channel == "checkout" then + local catch = event.msg + name = catch[1] + wm = catch[2] + amount = catch[3] + + if F.ack2(name, wm) and amount ~= nil then + S.acc[name][wm] = S.acc[name][wm] + amount + digiline_send("checkout_r", true) + else + digiline_send("checkout_r", false) + end +end + +if event.channel == "create" then + local catch = event.msg + name = catch[1] + wm = catch[2] + am = catch[3] + + F.adc(name, wm, am) end
\ No newline at end of file |
