]> Pileus Git - ~andy/rhawk/blob - remind.sh
Save game after flipping the table
[~andy/rhawk] / remind.sh
1 # Testing
2 cat <<EOF > /tmp/test.awk
3         BEGIN {
4                 offset = 0;
5                 FROM   = "andy";
6         }
7
8         function reply(msg) {
9                 print "\t" FROM ": " msg
10         }
11
12         function say(msg) {
13                 print "\t" msg
14         }
15
16         // {
17                 printf("%s", \$1)
18         }
19
20         /^\.wait +[0-9]+\$/ {
21                 offset += \$2;
22         }
23
24         /^\.atclr\$/ {
25                 delete remind;
26                 json_save("var/remind.json", remind);
27                 say("all jobs cleared");
28         }
29 EOF
30
31 awk -f /tmp/test.awk -f remind.awk <<-EOF
32         .atclr
33         .in   "1 min" hello october
34         .in   "2 min" hello november
35         .atq
36         .wait 60
37         .atq
38         .atq!
39         .atc  3
40         .atc  1
41         .atrm 1
42         .atrm 1
43         .atq
44         .atq!
45 EOF