ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/historic/playbook/treas1-extract
Revision: 1.1
Committed: Thu Sep 7 21:43:01 2006 UTC (17 years, 9 months ago) by pippijn
Branch: MAIN
CVS Tags: rel-2_82, rel-2_81, rel-2_80, rel-3_1, rel-3_0, rel-2_6, rel-2_7, rel-2_4, rel-2_5, rel-2_2, rel-2_3, rel-2_0, rel-2_1, rel-2_72, rel-2_73, rel-2_71, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_54, rel-2_55, rel-2_56, rel-2_79, rel-2_52, rel-2_53, rel-2_32, rel-2_90, rel-2_92, rel-2_93, rel-2_78, rel-2_61, rel-2_43, rel-2_42, rel-2_41, HEAD
Log Message:
Moved documents to doc/historic

File Contents

# Content
1 # stats-extract - parse the archetypes-file and output the
2 # player's stats in a structured format.
3
4 /^Object/ {
5 randomitems = "";
6 name = obj = $2;
7 type = 0;
8 }
9
10 /^type/ { type = $2 }
11 /^randomitems/ { randomitems = $2 }
12 /^name/ { name = substr($0, 6) }
13
14 /^end/ {
15 if (type == 1) { # Players
16 printf("%s,%s\n", decapitalize(name), randomitems);
17 }
18 }
19
20 END {
21 close("items");
22 }
23
24 function decapitalize(str) {
25 return tolower (substr(str, 1, 1)) substr(str, 2);
26 }