;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; REINC TAX COUNTER ;; ;; 2008-02-22: ;; Whee. Did some fixing, reinc tax is now ;; checked by using mktime(), so it should ;; give quite accurace results. It also ;; removes any need for doing year checks. ;; ;; Usage: ;; Just type "score" ;; Get it from http://www.utanet.fi/~divine/zombie/ /require expconv.tf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SETTINGS /set reinctax_worth 0 /set reinc_daysneeded 40 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; FETCH YOUR WORTH ;; plaque /def -mregexp -i -t"^\|([0-9 ]+).\| ([A-z ]+)\| \*([0-9 ]+)\* \|([ ]*)([0-9]*)G ([0-9]*)M" getworth = \ /set reinctax_worth $[strcat(%P5,%P6,"000")] /def -mregexp -i -t"^\|([0-9 ]+).\| ([A-z ]+)\| \*([0-9 ]+)\* \|([ ]*)([0-9]*)M" getworth2 = \ /set reinctax_worth $[strcat(%P5,"000")] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; EW stuff /def reset_ew = /unset ew_after_string%;/unset ew_cost_string%;/unset ew_cost_min%;/unset ew_tax_min%;/unset ew_tax_string ;; Reset the counter if your worth has changed /def -mregexp -ag -t"^Total worth exactly:([ ]*)([0-9]*) exp" reinctax_ew1 = \ /set reinctax_worth $[substr(%P2,0,(strlen(%P2)-3))]%;\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; CALCULATIONS AND STUFF /def reinctax_calc_days = \ /let r_v %1%;\ /let r_pv %3%;\ /if (%2=~"Jan") /let r_kk 1%;\ /elseif (%2=~"Feb") /let r_kk 2%;\ /elseif (%2=~"Mar") /let r_kk 3%;\ /elseif (%2=~"Apr") /let r_kk 4%;\ /elseif (%2=~"May") /let r_kk 5%;\ /elseif (%2=~"Jun") /let r_kk 6%;\ /elseif (%2=~"Jul") /let r_kk 7%;\ /elseif (%2=~"Aug") /let r_kk 8%;\ /elseif (%2=~"Sep") /let r_kk 9%;\ /elseif (%2=~"Oct") /let r_kk 10%;\ /elseif (%2=~"Nov") /let r_kk 11%;\ /elseif (%2=~"Dec") /let r_kk 12%;\ /endif%;\ /let time_reinced $[mktime(%r_v, %r_kk, %r_pv)]%;\ /let day_diff $[trunc((time()-time_reinced)/(60*60*24))]%;\ /return %day_diff /def -mregexp -ag -i -t'TP: (.*)Reinced: ([A-z]*) ([0-9]*) ([0-9]*)$' reincdatecatch =\ /reinctax_calc_tax %P4 %P2 %P3%;\ /reinctax_echotoscore /def reinctax_calc_tax = \ /let days_in_reinc $[reinctax_calc_days(%1, %2, %3, time())]%;\ /set days_left $[reinc_daysneeded-days_in_reinc]%;\ /set reinc_tax $[5-(days_in_reinc*((4*1.0)/reinc_daysneeded))]%;\ /if (reinc_tax<1) \ /set reinc_tax 1%;\ /endif%;\ /def reinctax_echotoscore = \ /echo -p @{n}%{PL}TP: %P1%;\ /echo -p @{n} Reinced: %P2 %P3 %P4 Days: %{days_left} Tax: $[substr(%{reinc_tax},0,4)]\%%;\ /echo -p @{n} Before: $[trunc(reinctax_worth/1000)]M \ After: $[trunc((reinctax_worth*(100-reinc_tax)/100)/1000)]M \ Tax: $[trunc(reinctax_worth/1000)-trunc((reinctax_worth*(100-reinc_tax)/100)/1000)]M