-
Notifications
You must be signed in to change notification settings - Fork 99
/
printAutoDecays.sh
executable file
·47 lines (34 loc) · 1007 Bytes
/
printAutoDecays.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
for f in transitions/*; do
if [[ $f == transitions/*.txt ]];
then
if [ -e $f ]
then
actorID=$(echo "$f" | sed 's/.*\///' | sed 's/_.*//' );
targetID=$(echo "$f" | sed 's/.*\///' | sed 's/\..*//' | sed 's/[^_]*_//' );
newActorID=$(cat $f | sed 's/\s.*//' );
newTargetID=$(cat $f | sed 's/[^ ]* //' | sed 's/\s.*//' );
decayTime=$(cat $f | sed 's/[^ ]* //' | sed 's/[^ ]* //' | sed 's/\s.*//' );
lastUse=0
if [[ $targetID == *"L"* ]]; then
lastUse=1
targetID=$(echo "$targetID" | sed 's/_.*//' );
fi
decayString=""
if [[ $actorID == -1 ]];
then
decayString="($decayTime seconds)"
target=$(cat "objects/$targetID.txt" | sed -n 2p );
target="\"$target\"";
newTarget=""
if [[ $newTargetID == 0 ]];
then
newTarget="[NOTHING]"
else
newTarget=$(cat "objects/$newTargetID.txt" | sed -n 2p );
newTarget="\"$newTarget\"";
fi
echo "$target => $newTarget $decayString";
fi
fi
fi
done