;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Ticker ;; by Noose ;; ;; Ticker usage: ;; tickset - show and modify settings ;; ticksave - save settings (you need to have a folder named "tf-data") ;; tickrep - toggle tick reporting ;; fatirep - toggle fatigue reporting ;; ;; Parameters for tickset: ;; help - show help ;; fill - set fill characters for graphical echo ;; type - set ticker type (spr/hpr/off) ;; echo - set echo type (graph/numbers/simple/off) ;; hpr - set hpr (these must be set if you're using hpr as count type) ;; spr - set spr (these must be set if you're using spr as count type) ;; ;; WARNING: THIS IS NOT A FOOLPROOF TICKER. You have been warned, etc. ;; I've tried to make this highly customizable. ;; If you have something to correct/fix, contact me via tells. ;; ;; Oh right, and search for "INSERT YOUR NAME HERE" and do what it says. ;; ;; //Noose ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Needed files /load tick_echo.tf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; settings ;; general /set tick_type spr /set tick_echotype numbers /set tickrep 1 /set ticksoon_time 25 ;; for graphical echo /set sc_rowlength 20 /set sc_rowfill 62 /set sc_rowfill2 45 ;; if you are not a dk /set fati_tick 1 ;; default regens /set nakedhpr 0 /set nakedspr 0 /set eqspr 0 /set eqhpr 0 ;; default hp/sp /set oldhp 0 /set oldsp 0 /set oldhpmax 0 /set oldspmax 0 ;; default fatigue stuff /set oldfati 0 /set fatirep 0 ;; default fatigue string to use in visual mode /set fatistr none ;; load settings /load tf-data/tickerstat ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; BASE TRIGGERS /def -mregexp -F -ag -t"^hp: ([0-9\-]+)\(([0-9\-]+)\) sp: ([0-9\-]+)\(([0-9\-]+)\)" hpspcount = /ticker_count %P1 %P2 %P3 %P4 ;; INSERT YOUR NAME HERE /def -mregexp -F -ag -t"^Noose (\[|\{|\<)party(\]|\}|\>): hp: ([0-9\-]+) \(([0-9\-]+)\) sp: ([0-9\-]+) \(([0-9\-]+)\)" hpspcount2 = /ticker_count %P3 %P4 %P5 %P6 party ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SETTINGS MACROS /def -mregexp -h'send ^tickset' tickset = \ /if (%-1=~"") \ /echo -p @{n}--@{B}Ticker@{n}-@{B}settings:@{n}--------------%;\ /echo -p @{BCred}Hpregen:@{n} naked: @{B}$[pad(%{nakedhpr},-5)]@{n} \ w/ eq: @{B}$[pad(%{eqhpr},-5)]%;\ /echo -p @{BCblue}Spregen:@{n} naked: @{B}$[pad(%{nakedspr},-5)]@{n} w/ \ eq: @{B}$[pad(%{eqspr},-5)]%;\ /echo -p Count type: @{B}%{tick_type}%;\ /echo -p Delay : @{B}%{ticksoon_time}%;\ /echo -p Echo type : @{B}%{tick_echotype}%;\ /echo -p Row fill 1: @{B}$[char(sc_rowfill)]@{n}%;\ /echo -p Row fill 2: @{B}$[char(sc_rowfill2)]@{n}%;\ /test echo("--------------------------------")%;\ /echo Type "tickset help" for help.%;\ /elseif (%2=~"help") \ /echo -aB Tickset has following parametric commands available:%;\ /echo -p @{n} - fill (set the fill characters in graphical short score)%;\ /echo -p @{n} - type (set the count type of ticker)%;\ /echo -p @{n} - time (set the delay for tick inform)%;\ /echo -p @{n} - echo (set the echo type of ticker)%;\ /echo -p @{n} - spr (set your spr)%;\ /echo -p @{n} - hpr (set your hpr)%;\ /echo -p @{B}Example@{n}: "tickset spr 230 500"%;\ /echo -p @{B}Example@{n}: "tickset type hpr"%;\ /elseif (%2=~"fill") \ /if (%3=~"" | %4=~"") \ /ticker_error Set fill with: tickset fill %;\ /else \ /set sc_rowfill $[ascii(%3)]%;/set sc_rowfill2 $[ascii(%4)]%;\ /endif%;\ /elseif (%2=~"time") \ /if (%{3}!~"") \ /set ticksoon_time %{3}%;\ /echo -aBCgreen Tick inform after: %{tick_type}s%;\ /else \ /ticker_error Set time with: tickset time .%;\ /endif%;\ /elseif (%2=~"type") \ /if (%{3}=~"hpr" | %{3}=~"spr" | %{3}=~"off") \ /set tick_type %{3}%;\ /echo -aBCgreen Tick type: %tick_type%;\ /else \ /ticker_error Set type with: tickset type . must be "hpr", "spr" or "off" !%;\ /endif%;\ /elseif (%2=~"echo") \ /if (%{3}=~"numbers" | %{3}=~"graph" | %{3}=~"simple" | %{3}=~"off") \ /set tick_echotype %{3}%;\ /echo -aBCgreen Tick echo type: %tick_echotype%;\ /else \ /ticker_error Set echo with: tickset echo . must be "numbers", "graph", "simple", or "off" !%;\ /endif%;\ /elseif (%2=~"hpr") \ /if (%{3}=~"" | %{4}=~"") \ /ticker_error Set hpregen with: tickset hpr %;\ /else \ /set nakedhpr %{3}%;/set eqhpr %{4}%;\ /endif%;\ /elseif (%2=~"spr") \ /if (%{3}=~"" | %{4}=~"") \ /ticker_error Set spregen with: tickset spr %;\ /else \ /set nakedspr %{3}%;/set eqspr %{4}%;\ /endif%;\ /else \ /echo -aB Type "tickset help" for help.%;\ /endif /def -h'send ticksave' ticksave = \ /let wfile $[tfopen("tf-data/tickerstat", "w")]%;\ /test $[tfwrite(wfile, strcat("/set nakedhpr ",{nakedhpr}))]%;\ /test $[tfwrite(wfile, strcat("/set nakedspr ",{nakedspr}))]%;\ /test $[tfwrite(wfile, strcat("/set eqhpr ",{eqhpr}))]%;\ /test $[tfwrite(wfile, strcat("/set eqspr ",{eqspr}))]%;\ /test $[tfwrite(wfile, strcat("/set tick_type ",{tick_type}))]%;\ /test $[tfwrite(wfile, strcat("/set tick_echotype ",{tick_echotype}))]%;\ /test $[tfclose(wfile)]%;\ /echo Saved to tf-data/tickerstat. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; BASIC MACROS /def -h'send tickrep' tickrep = /toggle tickrep%;/echo_variable tickrep /def echosc = /if (idle()<300) /echo_misc blue sc %*%;/endif /def echofati = /echo_misc blue fatigue %* /def ticker_error = /echo_misc red error %* /def inform_tick = \ /if ($[time()-last_tick]>20) \ /set last_tick $[time()]%;\ /echosc Ticked%;\ /if (tickrep & !healing_trance) !think tick.%;/endif%;\ /delay_ticksoon%;\ /endif /def delay_ticksoon = /repeat -%ticksoon_time 1 /ticker_ticksoon /def ticker_ticksoon = /echosc Tick soon%;/set ticking 1%;/repeat -20 1 /set ticking 0 /def ticker_endtick = /if (ticking) /set last_tick $[time()]%;/set ticking 0%;/endif /def ticker_count = \ /let newhp %1%;\ /let newhpmax %2%;\ /let newsp %3%;\ /let newspmax %4%;\ /let hpdiff $[newhp-oldhp]%;\ /let hpmaxdiff $[newhpmax-oldhpmax]%;\ /let spdiff $[newsp-oldsp]%;\ /let spmaxdiff $[newspmax-oldspmax]%;\ /if (tick_type=~"spr") \ /if (((spdiff<(eqspr+50)) & (spdiff>(eqspr-50))) | ((spdiff<(nakedspr+10)) & (spdiff>(nakedspr-10))) & (time()-last_tick)>26) \ /inform_tick%;\ /ticker_endtick%;\ /endif%;\ ;; using tick count type as hpr isn't accurate%;\ /elseif (tick_type=~"hpr") \ /if (((hpdiff<(eqhpr+30)) & (hpdiff>(eqhpr-30))) | (hpdiff=nakedhpr) & $[time()-last_tick]>26 ) \ /inform_tick%;\ /endif%;\ /endif%;\ ;; tick echo %;\ /if (idle()<360 & (abs(spdiff)>2 | abs(hpdiff)>2 | spdiff=0 | hpdiff=0)) \ /tick_echo -h"%newhp" -i"%newhpmax" -j"%hpdiff" -k"%hpmaxdiff" -s"%newsp" -t"%newspmax" -u"%spdiff" -v"%spmaxdiff" -f"%visfatistr" -l"%last_tick" -c"%5" -e"%tick_echotype"%;\ /endif%;\ ;; set old stats%;\ /set oldhp %{newhp}%;\ /set oldhpmax %{newhpmax}%;\ /set oldsp %{newsp}%;\ /set oldspmax %{newspmax}%;\ ;; short score for visual mode%;\ /set visual_sc $[strcat(pad(decode_attr(oldhp, get_scale_color(oldhp, oldhpmax)),4),"/",pad(decode_attr(oldsp, get_scale_color(oldsp, oldspmax)),-4))]%;\ /set visual_graphhp $[strrep("<",trunc(newhp/(newhpmax/sc_rowlength)))]%;\ /set visual_graphsp $[strrep(">",trunc(newsp/(newspmax/sc_rowlength)))]%;\ /def -ag -t'You sizzle with magical energy.' sizzle = /echosc SP FULL /def -ag -t'You feel fully healed.' healed = /echosc HP FULL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; FATIGUE STUFF /def -h'send fatirep' fatirep = /toggle fatirep%;/echo_variable fatirep /def -mregexp -ag -t"^(Fatigue changed: )?You (feel|are) (fully rested|almost fully rested|a bit tired|tired|exhausted)." fatigue = \ /test_fatigue 1 %P3 /def test_fatigue = \ /let teststr %-1%;\ /if (%teststr=~"fully rested") /let newfati 0%;/set visfatistr FUL%;/set fatistr Fully%;\ /elseif (%teststr=~"almost fully rested") /let newfati 1%;/set visfatistr ALM%;/set fatistr Almost%;\ /elseif (%teststr=~"a bit tired") /let newfati 2%;/set visfatistr BIT%;/set fatistr Bit tired%;\ /elseif (%teststr=~"tired") /let newfati 3%;/set visfatistr TIR%;/set fatistr Tired%;\ /elseif (%teststr=~"exhausted") /let newfati 4%;/set visfatistr EXH%;/set fatistr Exhausted%;\ /endif%;\ /if (%1) /report_fatigue%;/endif%;\ /if (newfati %fatistr%;\ /else /echofati %fatistr%;\ /endif%;\ /set oldfati %{newfati}%;\ /set oldfatistr %fatistr /def report_fatigue = \ /if (fatirep & !healing_trance) \ /if (newfati=0) !think fully%;\ /elseif (newfati=1) !think almost%;\ /elseif (newfati=2) !think bit tired%;\ /elseif (newfati=3) !think tired%;\ /elseif (newfati=4) !think exhausted!!%;\ /else \ !think Help! Something's wrong with my fatigue trig.%;\ /set fatistr ERR%;\ /endif%;\ /endif