ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/playbook/statskmod-extract
Revision: 1.1.1.1 (vendor branch)
Committed: Fri Feb 3 07:12:39 2006 UTC (18 years, 4 months ago) by root
Branch: UPSTREAM
CVS Tags: UPSTREAM_2006_03_15, LAST_C_VERSION, STABLE, UPSTREAM_2006_02_22, difficulty_fix_merge_060810_2300, UPSTREAM_2006_02_03
Branch point for: difficulty_fix
Changes since 1.1: +0 -0 lines
Log Message:
initial import

File Contents

# User Rev Content
1 root 1.1
2     BEGIN {
3     # Read the array data from living.c
4     while ((getline buff < living_c) == 1) {
5     if (buff ~ /stat_exp_mult\[/) {
6     get_values(buff);
7     haf = (tind-1)/2;
8     for(i=1;i<=haf;i++)
9     printf("%d & %s & %d & %s \\\\\n",i,array[i],i+haf,array[i+haf]);
10     break;
11     }
12     }
13     close(living_c);
14     }
15    
16     function get_values (buff) {
17     tind = 0;
18     while (1) {
19     getline buff < living_c;
20     if (buff ~ /};/)
21     break;
22     gsub("[ \t]*\"", "", buff);
23     nr = split(buff, val, ",");
24     for (i = 1; i<=nr ; i++) {
25     if(val[i]!="") {
26     if(val[i] ~ "/") {
27     nmb = split(val[i], subval, "/");
28     if(subval[1] ~ " ")
29     array[tind++]=subval[1];
30     } else
31     array[tind++]=val[i];
32     }
33     }
34     }
35     }