From a9f8b9ba4abf65d18387f8bfc73b7f4c273cb9df Mon Sep 17 00:00:00 2001 From: Andy Spencer Date: Sat, 25 Oct 2014 17:30:59 +0000 Subject: [PATCH] Improve email message format Show both current bids and current cards played This could be improved more actually to show tricks taken, etc. --- spades.awk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spades.awk b/spades.awk index 013f373..fee8950 100644 --- a/spades.awk +++ b/spades.awk @@ -760,11 +760,12 @@ sp_state == "play" && if (/!!/ && (sp_state == "bid" || sp_state == "play")) { if (sp_player in sp_notify) { - mail_send(sp_notify[sp_player], \ - (sp_state == "bid" ? "It is your bid!" : "") \ - (sp_state == "play" ? "It is your turn!" : ""), \ - (sp_state == "bid" ? "Bids: " _bids : "") \ - (sp_state == "play" ? "Pile: " _pile : "")) + if (!_bids) _bids = "none" + if (!_pile) _pile = "none" + mail_send(sp_notify[sp_player], \ + "It is your " sp_state "!", \ + "Bids so far: " _bids "\n" \ + "Cards played: " _pile) say("Notified " sp_player " at " sp_notify[sp_player]) } else { say("No email address for " sp_player) -- 2.43.2