TF rescue stuff

Scripts and support for your favorite MUD client.
digov
Sojourner
Posts: 38
Joined: Thu Sep 19, 2002 5:01 am

TF rescue stuff

Postby digov » Tue Sep 24, 2002 12:14 am

I need a tinyfugue rescue set. Complete with rescue list. I'm hoping someone has one, rather than having to write one from scratch and I did see some discussion about it before.

If you have it, post please Image or talk to me in game. Thanks!

Digov
voin
Sojourner
Posts: 6
Joined: Mon Aug 06, 2001 5:01 am

Postby voin » Wed Sep 25, 2002 10:05 am

Here's something to give you a general idea, so you don't have to write everything from scratch.

;
; group.tf, rescue.tf
;
; Quick usage note:
; Load in config with /load -q group.tf
; rset -- sets initial group listing/group head
; Note: group listing is automatically updated by macro
; so it should be called only when joining group
; first time
; rwho -- displays rescue lists and rescue status
; /addhitter -- defines group member as a hitter, and adds him to hitter
; listing (call gset after this command to refresh lists)
; /noresc -- defines group member who should not be rescued unless slammed
; (call gset after this command to refresh lists)
; Note: use /noresc to define disguised thieves or
; "ultimate tanks" like anti with DR, bio and inertia
; rstop -- suspends all auto-rescue attempts until r1,r2 or rstart alias
; is called
; rstart -- resumes auto-rescue attempts
; r1 -- alias for rescuing all casters minus those specified by noresc
; r2 -- alias for rescuing all hitters minus those specified by noresc
; rt -- alias for rescuing current tank ( < T: Krecik TP: sta ... )
; Last modification: 19.04.01

; This character name, should be set in the calling configuration
/set ThisChar=Voin


; Manual setting of tanks that should not be rescued
/set Tanks_norescue=|

/def noresc0 = /set Tanks_norescue=|
/def noresc = /set Tanks_norescue=$[strcat(Tanks_norescue,{1},"|")]

; List of known hitters and its maintenance
/set GTanks=|Cherzra|Halk|Kler|Sashin|Kagrack|Xanth|Tronok|Yens|Kalz|Ravok|Plut|Hod|Straker|Syrinx|Lesnik|Exl|
/def addhitter = /set GTanks=$[strcat(GTanks,{1},"|")]
/def addtank = /addhitter %{*}

; functions
/def -i is_group = /return (strstr({group_list},strcat("|",{1},"|")) > -1)
/def -i is_gcaster = /return (strstr({group_casters},strcat({1},"|")) > 0)
/def -i is_ghitter = /return (strstr({group_tanks},strcat({1},"|")) > 0)

; Maintaining group lists
/def -i group_reset = \
/set group_leader= %;\
/set group_list=| %;\
/set group_tanks=| %;\
/set group_casters=| %;\
/set group_tanks_r=/resc_reset %;\
/set group_casters_r=/resc_reset

; initial reset
/group_reset

/def -i group_add = \
/if ( ({ThisChar} !~ {1}) & !(is_group({1})) & (" a an the Halfling " !/ strcat("* ",{1}," *")) ) \
/set group_list=$[strcat(group_list,{1},"|")]%; \
/if (GTanks =/ strcat("*|",{1},"|*")) \
/if (Tanks_norescue !/ strcat("*|",{1},"|*")) \
/set group_tanks=$[strcat(group_tanks,{1},"|")]%; \
/set group_tanks_r=$[strcat(group_tanks_r,"%;rescue ",{1})]%; \
/alias r2 %{group_tanks_r}%; \
/endif%; \
/else \
/set group_casters=$[strcat(group_casters,{1},"|")]%; \
/set group_casters_r=$[strcat(group_casters_r,"%;rescue ",{1})]%; \
/alias r1 %{group_casters_r}%; \
/endif %; \
/endif


; Fetch group info
/set group_fetching=0

/alias gset /set group_fetching=1%;/group_reset%;group%;save
/alias rset gset

;/def -E(group_fetching=1) -i -F -aBCwhite -mregexp \
; -t"^Your group consists"

/def -E(group_fetching=1) -i -F -mregexp \
-t"^\(( Head|Front|Back )\)[ ]+([-0-9]+)\/([0-9]+).*hit,.*move " group_fetch2 = \
/if ({P1} =~ " Head") \
/set group_leader=%{PR}%; \
/endif %; \
/group_add %{PR}

/def -E(group_fetching=1) -i -F -mregexp \
-t"^\(( Head|Front|Back )\)[ ]+([^ ]+)$" group_fetch3 = \
/if ({P1} =~ " Head") \
/set group_leader=%{P2}%; \
/endif %; \
/group_add %{P2}

/def -E(group_fetching=1) -i -F -mregexp \
-t"^Saving" fetch_group3 = \
rwho %; \
/set group_fetching=0

/def -i -mregexp -aCcyan -t" is now a member of ([^ ]+)'s group\." group_fetch4 = \
/if ({P1} =~ {group_leader}) \
/group_add %{PL}%; \
/endif

/def -i -mregexp -aCcyan -t" is now a member of your group\." group_fetch5 = \
/group_add %{PL}


; Macro for setting current tank according to battle prompt and rescuing him
; mostly useful in zones
/def -F -mregexp -t"T: ([^ ]+) T(P|C):" act_set_tank = /set curr_tank=%{P1}
/alias rt rescue %{curr_tank}

; Rescue settings

/set resc_suspend=0
; rescue mode: 0 - don't rescue, 1 - rescue casters, 2 - rescue warriors too
/set resc_mode=1
/def rmode = /set resc_mode=%1%;rwho

/set resc_last=
/set resc_fired=0

; how many rescues should be stacked tops
/set resc_max=3
/def rmax = /set resc_max=%1%;rwho

; Fetch current position so we don't try rescuing while sitting
/set this_pos=standing
/def -F -mregexp -t'^< .* Pos: (standing|kneeling|sitting|on your ass) >' fetch_pos = \
/set this_pos=%{P1}

/def resc_reset = /set resc_suspend=0%;/set resc_fired=0

/alias rstop /set resc_suspend=1%;rwho
/alias rstart /set resc_suspend=0%;rwho

/alias rwho /echo -p -a @{Cgreen}-=== Rescue: @{BCwhite}$[({resc_suspend}==1)?"Suspended ":"Active @{xCgreen}==="]@{xCgreen}== Mode @{Cwhite}%{resc_mode}@{Cgreen} == Max @{Cwhite}%{resc_max}@{Cgreen} ===========-%;/echo -p -a @{Cgreen}(r1)Casters:@{BCwhite}%{group_casters}%;/echo -p -a @{Cgreen}(r2)Hitters:@{BCwhite}%{group_tanks}%;/echo -p -a @{Cgreen}-====================================================-%;
/alias resc /set resc_fired=$[{resc_fired}+1]%;/echo -a -p @{BCgreen}Trying to rescue %{1}%;rescue %{1}%;

; eval_rescue gets 2 parameters: group member name and event:
; events: 1 - fighting/missed bash, 2 - bashed/wallkicked/stunned, 3 - slammed
/def eval_rescue = \
; ;/echo -p Evaluating rescue for %{1}%; \
/if ({resc_suspend}!=0) \
/break%; \
/endif%; \
; ; position check
/if (({this_pos} =~ "on your ass") | (({2} != 3) & ({this_pos} !~ "standing"))) \
/break%; \
/endif%; \
/if ((resc_mode > 0) & ({2} == 3)) \
; ; always double rescue groupies on slam if not on the ass
/set resc_last=%{1}%; \
resc %{1}%; \
resc %{1}%; \
/break%; \
/endif%; \
; ; check if we already fired some rescues on this person
/if ( ({resc_last} =~ {1}) & ({resc_fired} > 0) )\
; ;/echo -p Already rescuing %{1}%; \
/break%; \
/endif%; \
; ; mode 1: rescue casters
/if ( ((resc_mode >= 1) & (is_gcaster({1}))) | \
; ; mode 2: rescue hitters on bash/wallkick
((resc_mode >= 2) & ({2} == 2) & (is_ghitter({1}))) | \
; ; mode 3: rescue hitters when they tank too
((resc_mode >= 3) & (is_ghitter({1}))) ) \
; ; check if we already spammed too many rescues
/if ({resc_fired} >= {resc_max}) \
/echo -a -p @{Cyellow}Too lagged to rescue %{1}!%; \
/else \
/set resc_last=%{1}%; \
resc %{1}%; \
/endif%; \
/endif

; eval_rescue() is triggered by one of the following:

; successful slam on groupie
/def -E(resc_mode>0) -F -aBCyellow -mregexp -t'suddenly looks a bit dumb, and madly slams at ([^ ]+)!' act_resc1 = \
/if (is_group({P1})) /eval_rescue %{P1} 3%;/endif
; wallkick on groupie
/def -E(resc_mode>0) -F -aBCyellow -mregexp -t'sends ([^ ]+) crashing into the wall!' act_resc2 = \
/if (is_group({P1})) /eval_rescue %{P1} 2%;/endif
; bash on groupie
/def -E(resc_mode>0) -F -aBCyellow -mregexp -t'sends ([^ ]+) sprawling with a powerful bash\.' act_resc3 = \
/if (is_group({P1})) /eval_rescue %{P1} 2%;/endif
; failed bash on groupie
/def -E(resc_mode>0) -F -mregexp -t'^([^ ]+) avoids being bashed by' act_resc4 = \
/if (is_group({P1})) /eval_rescue %{P1} 1%;/endif
; looking at room
/def -E(resc_mode>0) -F -mregexp -t'here, fighting ([^ ]+)\.' act_resc5 = \
/if (is_group({P1})) \
; ; Check if it is groupie fighting groupie
/if (is_group(substr({PL},0,strstr({PL}," ")))) \
/echo -p @{Cyellow}Group fight, no rescue%; \
/break%; \
/endif%; \
/eval_rescue %{P1} 1%;\
/endif
; stab on groupie
/def -E(resc_mode>1) -F -mregexp -t'places a black steel dagger in the back of ([^ ]+), resulting in some strange noises and some blood\.' act_resc6 = \
/if (is_group({P1})) /eval_rescue %{P1} 1%;/endif
; failed slam on groupie
/def -E(resc_mode>0) -F -aBCyellow -mregexp -t'haste to slam ([^ ]+) around, .* slips and falls!' act_resc7 = \
/if (is_group({P1})) /eval_rescue %{P1} 1%;/endif


; reduce stacked rescue count on successful/failed rescue
/def resc_done = /if ({resc_fired}>0) /set resc_fired=$[{resc_fired}-1]%;/endif

; resc_done() triggers

/def -F -msimple -aBCwhite -t'Banzai! To the rescue...' act_rdone1 = /resc_done
/def -F -msimple -aCyellow -t'But nobody is fighting him?' act_rdone2 = /resc_done
/def -F -msimple -aCyellow -t'But nobody is fighting her?' act_rdone2a = /resc_done
/def -F -msimple -aCyellow -t'Who do you want to rescue?' act_rdone3 = /resc_done
/def -F -msimple -aBCred -t'You fail the rescue.' act_rdone4 = /resc_done

; standing should reset number of rescues fired
/def -F -msimple -t'You clamber to your feet.' act_rdone5 = /set resc_fired=0
/def -F -msimple -t'You rise to your feet.' act_rdone6 = /set resc_fired=0

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 1 guest