Mercurial > hg > batmud > ggrtf
changeset 975:1a2e40de61f9
Bugfix the weight getting code.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 27 Mar 2009 10:56:18 +0000 |
parents | 0c1fc48bd056 |
children | 50c662d0e408 |
files | gm-identify.tf |
diffstat | 1 files changed, 15 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/gm-identify.tf Fri Mar 27 10:53:46 2009 +0000 +++ b/gm-identify.tf Fri Mar 27 10:56:18 2009 +0000 @@ -47,7 +47,7 @@ /def -i -F -p9999 -mregexp -t"^The following messages seem to vibrate from (.+):$" gidentify_start =\ /msq Collecting information ...%;\ - /if (opt_havebelt=~"on") @@weigh %{P1}%;/endif%;\ + /if (opt_havebelt=~"on") /set idc_getweight=1%;@@weigh %{P1}%;/endif%;\ /set idc_item=%{P1}%;/set idc_st=1%;/set idc_kgw=UNKNOWN%;\ /set idc_imp=%;/set idc_age=%;/set idc_cond=%;/set idc_handles=%;\ /set idc_maxcond=%;/set idc_cond=%;/set idc_name=%;/set idc_quality=%;\ @@ -55,45 +55,44 @@ /set idc_material=UNKNOWN%;/set idc_fwd=%;/set idc_worn=%;/set idc_wielded=%;\ /repeat -2 1 /gidentify_output -/def -i -F -E(idc_st>=1) -ag -p9999 -mregexp -t"^: *([0-9]+\.[0-9]+) " gidentify_weight =\ - /set idc_st=$[idc_st+1]%;\ - /if (opt_havebelt=~"on") /set idc_kgw=%{P1}%;/endif +/def -i -F -Eidc_getweight==1 -ag -p9999 -mregexp -t"^: *([0-9]+\.[0-9]+) " gidentify_weight =\ + /set idc_getweight=0%;/set idc_kgw=%{P1} -/def -i -F -E(idc_st>=1) -p9999 -mregexp -t"^It is called (.+) and identified as (.+)\.$" gidentify_handles =\ +/def -i -F -Eidc_st>=1 -p9999 -mregexp -t"^It is called (.+) and identified as (.+)\.$" gidentify_handles =\ /set idc_st=$[idc_st+1]%;/set idc_name=%{P1}%;/set idc_handles=%{P2} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"^It takes the following slots: (.*)\.$" gidentify_slots =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^It takes the following slots: (.*)\.$" gidentify_slots =\ /set idc_st=$[idc_st+1]%;/set idc_slots=%{P1} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"^It will (.+)\.$" gidentify_sksp =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^It will (.+)\.$" gidentify_sksp =\ /set idc_st=$[idc_st+1]%;/set idc_imp=%{idc_imp} $[replace(" ","_",{P1})] -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"^([A-Z][A-Za-z, ]+) did the heroic deed to bring" gidentify_i1 =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^([A-Z][A-Za-z, ]+) did the heroic deed to bring" gidentify_i1 =\ /set idc_names=%{P1} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"has been in the game for ([0-9a-z, ]+)\." gidentify_i2 =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"has been in the game for ([0-9a-z, ]+)\." gidentify_i2 =\ /set idc_age=%{P1} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"It is ([A-Za-z -]+), ([A-Za-z -]+)," gidentify_i3 =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"It is ([A-Za-z -]+), ([A-Za-z -]+)," gidentify_i3 =\ /set idc_weight=%{P1}%;/set idc_size=%{P2} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"in ([A-Za-z '-]+) condition, ([A-Za-z '-]+)" gidentify_i4 =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"in ([A-Za-z '-]+) condition, ([A-Za-z '-]+)" gidentify_i4 =\ /set idc_cond=%{P1}%;/set idc_maxcond=$[gidentify_maxcond({P2})] -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"of ([A-Za-z ]+) quality" gidentify_i5 =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"of ([A-Za-z ]+) quality" gidentify_i5 =\ /set idc_quality=%{P1} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"worth ([0-9]+)" gidentify_i6 =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"worth ([0-9]+)" gidentify_i6 =\ /set idc_worth=%{P1} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"made of,? ?(.+?), (feather|worth)" gidentify_i7 =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"made of,? ?(.+?), (feather|worth)" gidentify_i7 =\ /set idc_material=%{P1} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"featherweighted for (.+), worth" gidentify_i8 =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"featherweighted for (.+), worth" gidentify_i8 =\ /set idc_fwd=%{P1} -/def -i -F -E(idc_st>=2) -p9999 -mregexp -t"^It (has|hasn't) been (worn|wielded) by (.+)\.$" gidentify_worn =\ +/def -i -F -Eidc_st>=2 -p9999 -mregexp -t"^It (has|hasn't) been (worn|wielded) by (.+)\.$" gidentify_worn =\ /if ({P1}=~"has") /set idc_%{P2}=%{P3}%;/endif%;\ /def -i gidentify_list =\