From 34512740e2bf5ea628a424ad3952f65dbf9afe8a Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Tue, 18 Nov 2014 13:56:47 +0100 Subject: [PATCH] Porzadki w statsach. --- arkadia/stats.tf | 75 +-------------------------------- common/start.tf | 2 +- common/{counter.tf => stats.tf} | 72 +++++++++++++++++++++++++++++++ nightal/start.tf | 1 + nightal/stats.tf | 22 ++++++++++ nightal/statusbar.tf | 2 +- 6 files changed, 99 insertions(+), 75 deletions(-) rename common/{counter.tf => stats.tf} (65%) create mode 100644 nightal/stats.tf diff --git a/arkadia/stats.tf b/arkadia/stats.tf index d15fcba..fde007f 100644 --- a/arkadia/stats.tf +++ b/arkadia/stats.tf @@ -93,7 +93,7 @@ /endif %;\ /let linia=$[strcat("| ",pad(j,-6)," ",pad(wyp_razem,5),"/",pad(x,-5)," [",pad(procent,3),"%%] |",linia)] %;\ /eval /echo -p %{linia}@{n} - + /def stat =\ /set wszystkie_parowania=0%;\ /echo -p +----[ Skutecznosc zbroi ]---+-----------[ Wyparowane przez ]---------+@{n}%;\ @@ -183,7 +183,7 @@ /def czysc_spece = /quote -S /unset `/listvar -s spec_* %; -; by thornag +; postepy /set _postepy_list=\ minimalne|\ nieznaczne|\ @@ -201,74 +201,3 @@ wspaniale|\ gigantyczne|\ niebotyczne - -/def _get_index = \ - /let __element=%{1}%; \ - /let __list=%{2}|%; \ - /let __i=-1%; \ - /while ({__list}!~"") \ - /let __i=$[{__i}+1]%; \ - /let __p=$[strstr({__list}, "|")]%; \ - /let __el=$[substr({__list},0,{__p})]%; \ - /if ({__el}=~{__element}) \ - /return %{__i}%; \ - /endif%; \ - /let __list=$[substr({__list},{__p}+1)]%; \ - /done%; \ - /return -1 - -/def _get_element = \ - /let __index=%{1}%; \ - /let __list=%{2}|%; \ - /let __i=-1%; \ - /while ({__list}!~"") \ - /let __i=$[{__i}+1]%; \ - /let __p=$[strstr({__list}, "|")]%; \ - /let __el=$[substr({__list},0,{__p})]%; \ - /if ({__i}=={__index}) \ - /return strcat({__el})%; \ - /endif%; \ - /let __list=$[substr({__list},{__p}+1)]%; \ - /done%; \ - /return "" - -/def -Fp500 -mregexp -t'Poczynil.s (.*) postepy, od momentu kiedy wszedles do gry\.' _postepy_lap = \ - /let __postep=%{2}%;\ - /let __index=$[_get_index({__postep}, {_postepy_list})]%;\ - /_postepy_zanotuj %{__index}%;\ - /_sub %__index/15 - - -/def _postepy_zanotuj = \ - /let __postep=%{1}%; \ - /if ({__postep}>{_postepy_current})\ - /set _postepy_czas_%{__postep}=$[ftime("%H:%M", time())]%;\ - /set _postepy_current=%{__postep}%;\ - /endif - -/def postepy = /_postepy_show_times - -/def _postepy_show_times = \ - /let __index=0%; \ - /echo -p @{n}------------------------%; \ - /echo | Postepy | Czas |%; \ - /echo -p @{n}---------------+--------%; \ - /while ({__index}<={_postepy_current}) \ - /let __postep=$[_get_element({__index}, {_postepy_list})]%; \ - /let __czas=$(/listvar -v _postepy_czas_$[strcat({__index})])%; \ - /if ({__czas} =~ "" )\ - /let __czas=??:??%;\ - /endif%;\ - /echo $[strcat("| ", pad({__postep},-13), "| ", {__czas}, " |")]%; \ - /let __index=$[{__index}+1]%; \ - /done%; \ - /if ({_postepy_current}==-1) \ - /echo -p @{n}| | |%; \ - /endif%; \ - /echo -p @{n}------------------------ - -/def _postepy_show = \ - /let __postep=%{2}%; \ - /let __index=$[_get_index({__postep}, {_postepy_list})]%; \ - /_postepy_zanotuj %{__index}%; \ - /test substitute(strcat("@{B}", {1}, " [",{__index},"/15]"),"",1) diff --git a/common/start.tf b/common/start.tf index ff333f9..07336cf 100644 --- a/common/start.tf +++ b/common/start.tf @@ -25,7 +25,6 @@ /load binds.tf /load colorscheme.tf /load combat.tf -/load counter.tf /load equipment.tf /load hunt.tf /load lists.tf @@ -35,6 +34,7 @@ /load movement.tf /load odmiana.tf /load people.tf +/load stats.tf /load substitute.tf /load team.tf /load testuj.tf diff --git a/common/counter.tf b/common/stats.tf similarity index 65% rename from common/counter.tf rename to common/stats.tf index fe53351..5de2fd7 100644 --- a/common/counter.tf +++ b/common/stats.tf @@ -112,3 +112,75 @@ /endif %;\ /echo -p #@{C%c_info}#@{n}# +%{linia1}----- W sumie: %{linia} %;\ /echo -p #@{C%c_info}#@{n}# +%{linia1}-------------------------+@{n} + +; by thornag +/def _get_index = \ + /let __element=%{1}%; \ + /let __list=%{2}|%; \ + /let __i=-1%; \ + /while ({__list}!~"") \ + /let __i=$[{__i}+1]%; \ + /let __p=$[strstr({__list}, "|")]%; \ + /let __el=$[substr({__list},0,{__p})]%; \ + /if ({__el}=~{__element}) \ + /return %{__i}%; \ + /endif%; \ + /let __list=$[substr({__list},{__p}+1)]%; \ + /done%; \ + /return -1 + +/def _get_element = \ + /let __index=%{1}%; \ + /let __list=%{2}|%; \ + /let __i=-1%; \ + /while ({__list}!~"") \ + /let __i=$[{__i}+1]%; \ + /let __p=$[strstr({__list}, "|")]%; \ + /let __el=$[substr({__list},0,{__p})]%; \ + /if ({__i}=={__index}) \ + /return strcat({__el})%; \ + /endif%; \ + /let __list=$[substr({__list},{__p}+1)]%; \ + /done%; \ + /return "" + +/def -Fp500 -mregexp -t'Poczynil.s (.*) postepy, od momentu kiedy wszedles do gry\.' _postepy_lap = \ + /let __postep=%{2}%;\ + /let __index=$[_get_index({__postep}, {_postepy_list})]%;\ + /_postepy_zanotuj %{__index}%;\ + /_sub %__index/15 + + +/def _postepy_zanotuj = \ + /let __postep=%{1}%; \ + /if ({__postep}>{_postepy_current})\ + /set _postepy_czas_%{__postep}=$[ftime("%H:%M", time())]%;\ + /set _postepy_current=%{__postep}%;\ + /endif + +/def postepy = /_postepy_show_times + +/def _postepy_show_times = \ + /let __index=0%; \ + /echo -p @{n}------------------------%; \ + /echo | Postepy | Czas |%; \ + /echo -p @{n}---------------+--------%; \ + /while ({__index}<={_postepy_current}) \ + /let __postep=$[_get_element({__index}, {_postepy_list})]%; \ + /let __czas=$(/listvar -v _postepy_czas_$[strcat({__index})])%; \ + /if ({__czas} =~ "" )\ + /let __czas=??:??%;\ + /endif%;\ + /echo $[strcat("| ", pad({__postep},-13), "| ", {__czas}, " |")]%; \ + /let __index=$[{__index}+1]%; \ + /done%; \ + /if ({_postepy_current}==-1) \ + /echo -p @{n}| | |%; \ + /endif%; \ + /echo -p @{n}------------------------ + +/def _postepy_show = \ + /let __postep=%{2}%; \ + /let __index=$[_get_index({__postep}, {_postepy_list})]%; \ + /_postepy_zanotuj %{__index}%; \ + /test substitute(strcat("@{B}", {1}, " [",{__index},"/15]"),"",1) diff --git a/nightal/start.tf b/nightal/start.tf index fa4347f..4953c42 100644 --- a/nightal/start.tf +++ b/nightal/start.tf @@ -7,6 +7,7 @@ /load money.tf /load movement.tf /load specs.tf +/load stats.tf /load statusbar.tf /load substitute.tf /load warn.tf diff --git a/nightal/stats.tf b/nightal/stats.tf new file mode 100644 index 0000000..44af5ca --- /dev/null +++ b/nightal/stats.tf @@ -0,0 +1,22 @@ +; postepy +/set _postepy_list=\ + znikome|\ + minimalne|\ + mizerne|\ + nieznaczne|\ + niewielkie|\ + bardzo male|\ + male|\ + nieduze|\ + znaczne|\ + istotne|\ + owocne|\ + duze|\ + pokazne|\ + bardzo duze|\ + trwale|\ + wspaniale|\ + wielkie|\ + ogromne|\ + kolosalne|\ + nieopisane diff --git a/nightal/statusbar.tf b/nightal/statusbar.tf index 17c5b6f..5c74c56 100644 --- a/nightal/statusbar.tf +++ b/nightal/statusbar.tf @@ -256,7 +256,7 @@ /eval /status_add -r1 "K: ":: kondycja:23 /eval /status_add -r1 "Z: ":: zmeczenie:20 /eval /status_add -r1 "M: ":: mana:20 -/eval /status_add -r1 "Hidden: ":: hide:4:C%c_main +/eval /status_add -r1 "Hidden: ":: hideshow:4:C%c_main /eval /status_add -r1 "Cover: ":: nxt_zaslona:3 /eval /status_add -r1 "Mail: ":: poczta_show:5:C%c_main /eval /status_add -r1 spacebreak::