8 my $script = dirname
(abs_path
($0)) . "/print-colored.pl";
9 my $beep = dirname
(abs_path
($0)) . "/beep";
10 my $unpause = dirname
(abs_path
($0)) . "/unpause.sh";
13 #uncommented line below to use pc speaker
14 #my $beep = dirname(abs_path($0)) . "perl -e 'print \"\\a\"'";
19 ["has created a masterpiece", [""]],
20 ["has engraved a masterpiece", [""]],
21 ["has become a", [""]],
23 ["Drop-off inaccessible", [""]],
24 ["Job item misplaced", [""]],
25 ["Item inaccessible", [""]],
26 ["Equipment mismatch", [""]],
27 [" Getting something to ", [""]],
28 ["Needs unrotten body part", [""]],
29 ["Needs butcherable unrotten nearby item", [""]],
30 ["Seeking Infant", [""]],
32 ["tearing the brain", [$script . " green"]],
33 ["lower body(.+)and the severed part sails off in an arc", [$script . " green"]],
34 ["head(.+)and the severed part sails off in an arc", [$script . " green"]],
36 ["but the shot is blocked", [""]],
37 [" lightly tapping ", [""]],
39 ["latches on firmly", [""]],
42 [" scratches ", [""]],
43 [" tearing the fat", [""]],
44 [" bruising the ", [""]],
45 ["looks surprised", [""]],
46 ["counterstrikes", [""]],
48 ["knocked over", [""]],
52 ["even more sick", [""]],
53 ["trouble breathing", [""]],
57 [" tangle together", [""]],
62 [" gives in to pain", [""]],
63 [" become enraged", [""]],
64 [" knocked unconscious", [""]],
65 [" has been opened", [""]],
68 [" loses hold ", [""]],
71 [" tendon (.+) torn", [""]],
72 ["lodged firmly", [""]],
74 ["stolen", [$script . " magenta"]],
75 ["Dangerous terrain", [$script . " red", $beep]],
76 ["^An ambush! ", [$script . " red", $beep]],
77 ["^A vile force of ", [$script . " red", $beep]],
78 ["^The forgotten beast (.+) has come", [$script . " red", $beep]],
79 ["Interrupted by", [$script . " red", $beep]],
80 [" has bled to death.", [$script . " red", $beep]],
81 ["drowned", [$script . " red", $beep]],
82 [" died ", [$script . " red", $beep]],
83 ["^The (.+) struck", [$script . " magenta"]], #indicates that an unnamed being has been slaughtered/killed
84 ["^You have struck", [$script . " yellow"]], # some stone has been discovered
85 ["struck", [$script . " red", $beep]], #indicates that a named being has been struck down, most likely of our population.
86 [" is throwing a tantrum", [$script . " red", $beep]],
87 [" has gone berserk", [$script . " red", $beep]],
88 [" Went insane", [$script . " red", $beep]],
89 #game pausing/important events
90 ["(D|d)amp (S|s)tone", [$script . " yellow", $beep, $unpause]],
91 ["Praise the miners", [$script . " green", $beep]], #adamantine discovered
92 [" has bestowed the name ", [$script . " yellow", $beep, $unpause]], #named a weapon
94 ["will be leaving soon", [$script . " yellow", $beep]],
95 ["embarked", [$script . " yellow"]],
96 ["arrived", [$script . " yellow", $beep, $unpause]],
98 [" withdraws from society", [$script . " white", $beep, $unpause]],
99 [" fey mood", [$script . " white", $beep]],
100 [" posessed", [$script . " white", $beep]],
101 [" claimed ", [$script . " white", $beep, $unpause]], #remove the unpause tag in a fresh game, when its likely you dont have everything in stock urist mcmood wants.
102 [" begun a mysterious construction", [$script . " white", $beep]], #dont unpause, so you can still forbid stuff
103 [" has created ", [$script . " white", $beep]], #dont unpause, so you can look what he created
104 #damn, more dwarfes/pets -> lower fps.
105 [" has given birth to a (girl|boy)", [$script . " blue", $beep, $unpause]],
106 [" has given birth to ", [$script . " blue"]],
107 #other interesting info
108 ["has mandated ", [$script . " yellow", $beep]],
109 ["has imposed a ban ", [$script . " yellow", $beep]],
110 ["has grown to", [$script . " blue"]],
111 ["has been completed", [$script . " cyan"]],
112 [" suspended the", [$script . " yellow", $beep]]
116 #print; #uncomment to see which line may have caused an error.
118 foreach my $cond(@conditions) {
119 my $regex = $cond->[0];
120 my $cmds = $cond->[1];
121 if ($_ =~ /$regex/) {
122 for(my $i = 0; $i <= $#$cmds; $i++) {
123 my $cmd = $cmds->[$i];
124 my @args = split " ", $cmd;
125 system @args, $_ if $cmd ne "";
132 # TODO place code to print when no regex matched