Useful Cleric Triggers

Scripts and support for your favorite MUD client.
Jhorr
Sojourner
Posts: 515
Joined: Sun Feb 25, 2001 6:01 am

Useful Cleric Triggers

Postby Jhorr » Mon Nov 15, 2004 8:11 am

Courtesy of Ridmar:

#CLASS {GHealMost}
#TRIGGER {(%n)~/(%n)%s hit, *{psp|man} (%w)} {#if ("%3"<>"a" and "%3"<>"Someone" and @ghealcmd="ghealmost") {#math ghealdiff %2-%1;#if (@ghealdiff > @mostsofar) {mostsofar=@ghealdiff;mostsofartarg=%3}} {#if (%1 < @mostsofar) {#math mostsofar %1;mostsofartarg=%3}}}
#TRIGGER { >} {ghealmostoff;#if (@mostsofartarg="the") {mostsofartarg=spirit};#if (@mostsofar > 200) {fh @mostsofartarg} {#if (@mostsofar > 80) {#echo heal @mostsofartarg}}} "" {nocr|prompt}
#CLASS 0

#CLASS {GHealMostGroup}
#TRIGGER {Group information for} {#t- GhealMostGroup;#t+ GhealMost}
#CLASS 0


#alias ghealmost {#t+ GhealMostGroup;#echo Healing Triggers ON; ghealcmd=ghealmost;group;mostsofar=0;mostsofartarg=}
#alias ghealmostoff {#t- GHealMost; #if (@ghealcmd="ghealmost") {#echo Healing Triggers OFF} {#echo gheal lowest off}}
#alias {fh} {c 'full heal'}
#alias {heal} {c 'heal'}

You can make the set use heals as well as full heals by changing {#echo heal @mostsofartarg} in the second trigger above to {heal @mostsofartarg}

FOR NEW GROUP LIST FORMAT:
Change this:

Code: Select all

#TRIGGER {(%n)~/(%n)%s hit, *{psp|man} (%w)} {#if ("%3"<>"a" and "%3"<>"Someone" and @ghealcmd="ghealmost") {#math ghealdiff %2-%1;#if (@ghealdiff > @mostsofar) {mostsofar=@ghealdiff;mostsofartarg=%3}} {#if (%1 < @mostsofar) {#math mostsofar %1;mostsofartarg=%3}}}

to THIS:

Code: Select all

#TRIGGER {* (%n)~/(%n)%s*hit - (%w)} {#if ("%3"<>"a" and "%3"<>"Someone" and @ghealcmd="ghealmost") {#math ghealdiff %2-%1;#if (@ghealdiff > @mostsofar) {mostsofar=@ghealdiff;mostsofartarg=%3}} {#if (%1 < @mostsofar) {#math mostsofar %1;mostsofartarg=%3}}}
Last edited by Jhorr on Thu Dec 22, 2005 12:15 am, edited 1 time in total.
Jhorr
Sojourner
Posts: 515
Joined: Sun Feb 25, 2001 6:01 am

Postby Jhorr » Mon Nov 15, 2004 8:15 am

Courtesy of Kuurg and Sarell:

#TRIGGER {(%d)~/(%d) %s hit,%s%d~/%d%smove,%s%d~/%d%spsp (%w)} {#key F@GroupIndex {c 'full heal' %3} {GroupHealTriggers};#math tmpvar (%1*100);#math HPPercent {@tmpvar/%2};#if (@HPPercent > @HPThreshold) {#if (@t = %3) {#STW + {F@GroupIndex %3 %1/%2hp [%ansi( yellow)]T[%ansi( def)]}} {#STW + {F@GroupIndex %3 %1/%2hp}}} {#if (@t = %3) {#STW + {[%ansi( high, red)]F@GroupIndex %3 %1/%2hp [%ansi( yellow)]T[%ansi( def)]}} {#STW + {[%ansi( high, red)]F@GroupIndex %3 %1/%2hp[%ansi( def)]}}};#math GroupIndex {@GroupIndex+1}}
#TRIGGER {Unsplit Coins:} {@GroupIndex = 1;#stwin @Notes %cr}
Jhorr
Sojourner
Posts: 515
Joined: Sun Feb 25, 2001 6:01 am

Autovit assigner

Postby Jhorr » Tue Nov 22, 2005 3:12 pm

NOTE: This works with new group list formatting...

I have had a lot of requests for my auto vit assigner. I'll post what I have currently even though it's functional but not quite complete.

All you have to do is type 'getgroup' and the trigger set does the following:

1. Performs a 'who' for all group members and stores name/class/and level in a temporary database.
2. Sorts the list according to class and level.
3. Prioritizes vit assigns in the following rule: tanks > mages > hitters > priests.
4. Gives best vits (cleric>shaman/druid) to the tanks, then mages, etc. according to #3.
5. Will currently assign up to 5 vits for each cleric and then will use shaman vits and then druid vits last.
6. Will echo results to users screen with 'echovits' alias, or gsay results to group with 'reportvits'.

To fine tune the assigns if necessary: click on 'FinalVits' in the variables list and you can add/subtract vits as necessary. Changes made there will show up with 'echovits' and 'reportvits'.

Known issues:
1. %% or anon group members will not be assigned a vit. In those cases I ask them to unanon briefly or add them by editing 'FinalVits' as above.
2. At one point, odd group numbers would result in one person not being assigned a vit. I can't remember if I fixed that yet or not.

The code is a tad redundant and could probably be streamlined but it works as is so why fix what ain't broken...

At last, here is the code:

Code: Select all

#CLASS {AUTOVITASSIGNER}
#ALIAS getgroup {cleargrouplist;clearvitters;#echo ----==== Acquiring Group Members ====----;#echo AUTOVITS(tm) coming up ....;tog paging;#t+ AddgroupTemp;group}
#ALIAS displdchars {#cr;#echo %%% CHARS;#echo ----------;#forall @ldchars {#echo %proper( %i)}}
#ALIAS makevitlist {getgroup;getvits;rankvitters;assignvits;revisevits;reportvits}
#ALIAS revisevits {#echo ---=== Current Vit Assignments ===---;echovits}
#ALIAS cleargrouplist {grouplist = "";#echo GROUP list - Cleared.}
#ALIAS clearvitters {vitterlist = "";#echo VITTER list - Cleared.}
#ALIAS addtogroup {#additem grouplist %1}
#ALIAS showgroup {#SA CURRENT GROUP LIST:;#forall {@grouplist} {#SA %{i}}}
#ALIAS delgroupmember {#var grouplist %delitem( %1, @grouplist);#SA %1 REMOVED FROM GROUP LIST}
#ALIAS addgroupmember {#additem grouplist %1;#SA %1 ADDED TO GROUP LIST}
#ALIAS whocapture {#T+ WhoCapture;initclasslists;#forall {@grouplist} {who %{i}};#wait 5000;#t- WhoCapture;tog paging;#echo Done;#math groupsize (%numitems( @tanks))+(%numitems( @priests))+(%numitems( @mages))+(%numitems( @rogues));showgroupdata;getvits}
#ALIAS initclasslists {#var mages "";#var priests "";#var tanks "";#var rogues "";#var magelevels "";#var priestlevels "";#var tanklevels "";#var roguelevels "";#var magetypes "";#var priesttypes "";#var tanktypes "";#var roguetypes "";#var anonchars "";#var ldchars ""}
#ALIAS showgroupdata {#echo ----==== Getting Group Data ====----;#echo Current Group Size: @groupsize;disptanks;#cr;disprogues;#cr;disppriests;#cr;dispmages;dispanonchars;displdchars}
#ALIAS dispanonchars {#cr;#echo ANON CHARS;#echo ----------;#forall @anonchars {#echo %i}}
#ALIAS cleargroup {grouplist = "";#echo GROUP list - Cleared.}
#ALIAS disptanks {#var disptankstemp 0;#echo TANKS;#echo -----;#while (@disptankstemp<%numitems( @tanks)) {#echo %item( @tanks, @disptankstemp+1): %item( @tanklevels, @disptankstemp+1) %item( @tanktypes, @disptankstemp+1);#add disptankstemp 1}}
#ALIAS disppriests {#var dispprieststemp 0;#echo PRIESTS;#echo -------;#while (@dispprieststemp<%numitems( @priests)) {#echo %item( @priests, @dispprieststemp+1): %item( @priestlevels, @dispprieststemp+1) %item( @priesttypes, @dispprieststemp+1);#add dispprieststemp 1}}
#ALIAS dispmages {#var dispmagestemp 0;#echo MAGES;#echo -----;#while (@dispmagestemp<%numitems( @mages)) {#echo %item( @mages, @dispmagestemp+1): %item( @magelevels, @dispmagestemp+1) %item( @magetypes, @dispmagestemp+1);#add dispmagestemp 1}}
#ALIAS disprogues {#var disproguestemp 0;#echo ROGUES;#echo ------;#while (@disproguestemp<%numitems( @rogues)) {#echo %item( @rogues, @disproguestemp+1): %item( @roguelevels, @disproguestemp+1) %item( @roguetypes, @disproguestemp+1);#add disproguestemp 1}}
#ALIAS getvits {#var tempvits "";#var vitprioritylist "";#var priestnum 0;#var maxclericvits 0;#var nonclericvits 0;#var clericlevels "";#var druidlevels "";#var shamanlevels "";#var maxvits "";#var nonclericlevels "";#var bestclerics "";#var bestclericslevel "";#var bestdruids "";#var bestdruidslevel "";#var bestshaman "";#var bestshamanlevel "";#var clerics "";#var nonclerics "";#var shaman "";#var druids "";#forall @tanks {#additem vitprioritylist %i};#forall @mages {#additem vitprioritylist %i};#forall @rogues {#additem vitprioritylist %i};#cr;#echo Vit target priority list: @vitprioritylist;#cr;#cr;#echo ---=== Analyzing Available Vitality Spells ===---;#forall @priests {#add priestnum 1;#var tmpvarname %concat( "KnownVits.", %item( @priesttypes, @priestnum));#var tmpvar 1;#if (%number( %item( @priestlevels, @priestnum))<%number( %word( %item( @{@tmpvarname}, @tmpvar), 1))) {#var tempvits %additem( 0, @tempvits);#echo %i has 0 Vits!!!;#addkey maxvits %i 0;#if (%item( @priesttypes, @priestnum)="Cleric") {#add maxclericvits 0;#additem clerics %i;#var clericlevels %additem( %item( @priestlevels, @priestnum), @clericlevels)} {#add nonclericvits 0;#if (%item( @priesttypes, @priestnum)="Druid") {#additem druids %i;#var druidlevels %additem( %item( @priestlevels, @priestnum), @druidlevels)} {shaman=%push( %i, @shaman);shamanlevels=%push( %item( @priestlevels, @priestnum), @shamanlevels)}}} {#while (@tmpvar < %eval( %numitems( @{@tmpvarname})+1)) {#if (%number( %item( @priestlevels, @priestnum))>=%number( %word( %item( @{@tmpvarname}, @tmpvar), 1)) and %number( %item( @priestlevels, @priestnum))<%number( %word( %item( @{@tmpvarname}, @tmpvar+1), 1))) {#var tempvits %additem( %eval( %word( %item( @{@tmpvarname}, @tmpvar), 2)), @tempvits);#echo %i gets %word( %item( @{@tmpvarname}, @tmpvar), 2) Vits at level %item( @priestlevels, @priestnum);#addkey maxvits %i %word( %item( @{@tmpvarname}, @tmpvar), 2);#if (%item( @priesttypes, @priestnum)="Cleric") {#add maxclericvits %number( %word( %item( @{@tmpvarname}, @tmpvar), 2));#additem clerics %i;#var clericlevels %additem( %item( @priestlevels, @priestnum), @clericlevels)} {#add nonclericvits %number( %word( %item( @{@tmpvarname}, @tmpvar), 2));#if (%item( @priesttypes, @priestnum)="Druid") {#additem druids %i;#var druidlevels %additem( %item( @priestlevels, @priestnum), @druidlevels)} {shaman=%push( %i, @shaman);shamanlevels=%push( %item( @priestlevels, @priestnum), @shamanlevels)}};#var tmpvar 10} {#add tmpvar 1}}}};#math totalvits @maxclericvits+@nonclericvits;#echo Total Available Vits = @totalvits (@maxclericvits Cleric Vits, @nonclericvits Noncleric Vits);#echo Total Vits Needed: %eval( %numitems( @vitprioritylist)+%numitems( @priests));#cr;#if (@totalvits<@groupsize) {#echo Error detected!!! %eval( @groupsize-@totalvits) group members will not have a vit!;#var toofewvits 1} {#var toofewvits 0};rankvitters}
#ALIAS rankvitters {#echo ---=== Ranking Vitters ===---;#additem bestclerics %item( @clerics, 1);#additem bestclericslevel %item( @clericlevels, 1);#var tmpvar 2;#while @tmpvar<=%numitems( @clerics) {#if (%number( %item( @clericlevels, @tmpvar))<%number( %item( @bestclericslevel, @tmpvar-1))) {#additem bestclerics %item( @clerics, @tmpvar);#var bestclericslevel %additem( %item( @clericlevels, @tmpvar), @bestclericslevel)} {bestclerics=%push( %item( @clerics, @tmpvar), @bestclerics);bestclericslevel=%push( %item( @clericlevels, @tmpvar), @bestclericslevel)};#add tmpvar 1};#additem bestdruids %item( @druids, 1);#additem bestdruidslevel %item( @druidlevels, 1);#var tmpvar 2;#while @tmpvar<=%numitems( @druids) {#if (%number( %item( @druidlevels, @tmpvar))<%number( %item( @bestdruidslevel, @tmpvar-1))) {#additem bestdruids %item( @druids, @tmpvar);#var bestdruidslevel %additem( %item( @druidlevels, @tmpvar), @bestdruidslevel)} {bestdruids=%push( %item( @druids, @tmpvar), @bestdruids);bestdruidslevel=%push( %item( @druidlevels, @tmpvar), @bestdruidslevel)};#add tmpvar 1};#additem bestshaman %item( @shaman, 1);#additem bestshamanlevel %item( @shamanlevels, 1);#var tmpvar 2;#while @tmpvar<=%numitems( @shaman) {#if (%number( %item( @shamanlevels, @tmpvar))<%number( %item( @bestshamanlevel, @tmpvar-1))) {#additem bestshaman %item( @shaman, @tmpvar);#var bestshamanlevel %additem( %item( @shamanlevels, @tmpvar), @bestshamanlevel)} {bestshaman=%push( %item( @shaman, @tmpvar), @bestshaman);bestshamanlevel=%push( %item( @shamanlevels, @tmpvar), @bestshamanlevel)};#add tmpvar 1};#echo Clerics Ranking: @bestclerics, Levels: @bestclericslevel;#echo Druids Ranking: @bestdruids, Levels: @bestdruidslevel;#echo Shaman Ranking: @bestshaman, Levels: @bestshamanlevel;assignvits}
#ALIAS assignvits {#cr;#echo ---=== Assigning Vits to Ranked Vitters ===---;#math vitsperpriest %round( %numitems( @vitprioritylist)+%numitems( @priests))/%numitems( @priests);#var vitspercleric 4;#math vitsperpriest %eval( ( @groupsize-(@vitspercleric*(%numitems( @bestclerics)))-(%numitems( @priests)))/%eval( %numitems( @priests)-%numitems( @bestclerics)));#var tmpvar %numitems( @bestclerics);#var tmpvarname "";#var FinalVits "";#var counter 1;#var counter2 1;#var counter3 1;#var clericslack 0;#while @tmpvar>0 {#var tmpvarname %concat( "FinalVits.", %item( @bestclerics, @counter));#var tmpvarname2 %concat( "maxvits.", %item( @bestclerics, @counter));#while @counter3<=@vitspercleric {#if (@counter3<=@{@tmpvarname2}) {#additem @tmpvarname %item( @vitprioritylist, @counter2);#add counter2 1;#add counter3 1} {#var clericslack %eval( @vitspercleric-@{@tmpvarname2}+%number( @clericslack));counter3=%eval( @vitspercleric+1)}};#echo %item( @bestclerics, @counter): @{@tmpvarname};#add tmpvar -1;#add counter 1;#var counter3 1};#echo clericslack: @clericslack;#echo SHAMAN NEXT;#var tmpvar %numitems( @bestshaman);#var counter 1;#var counter3 1;#var shamanslack 0;#while @tmpvar>0 {#var tmpvarname %concat( "FinalVits.", %item( @bestshaman, @counter));#var tmpvarname2 %concat( "maxvits.", %item( @bestshaman, @counter));#while @counter3<=@vitsperpriest {#if (@counter3<=@{@tmpvarname2}) {#additem @tmpvarname %item( @vitprioritylist, @counter2);#add counter2 1;#add counter3 1} {#var shamanslack %eval( @vitsperpriest-@{@tmpvarname2}+%number( @shamanlack));counter3=%eval( @vitsperpriest+1)}};#echo %item( @bestshaman, @counter): @{@tmpvarname};#add tmpvar -1;#add counter 1;#var counter3 1};#echo shamanslack: @shamanslack;#echo DRUIDS NEXT;#var tmpvar %numitems( @bestdruids);#var counter 1;#var counter3 1;#var druidslack 0;#while @tmpvar>0 {#var tmpvarname %concat( "FinalVits.", %item( @bestdruids, @counter));#var tmpvarname2 %concat( "maxvits.", %item( @bestdruids, @counter));#while @counter3<=@vitsperpriest {#if (@counter3<=@{@tmpvarname2}) {#additem @tmpvarname %item( @vitprioritylist, @counter2);#add counter2 1;#add counter3 1} {#var shamanslack %eval( @vitsperpriest-@{@tmpvarname2}+%number( @druidslack));counter3=%eval( @vitsperpriest+1)}};#echo %item( @bestdruids, @counter): @{@tmpvarname};#add tmpvar -1;#add counter 1;#var counter3 1};#echo druidslack: @druidslack;#echo Will assign targets beyond people in vitprioritylist;echovits}
#ALIAS charlookup { #if (%ismember( %2, @fighterclasses2)) {#VAR tanks %addItem( %3, @tanks);#VAR tanklevels %addItem( %1, @tanklevels);#VAR tanktypes %addItem( %2, @tanktypes)} {#if (%ismember( %2, @priestclasses)) {#VAR priests %addItem( %3, @priests);#VAR priestlevels %addItem( %1, @priestlevels);#VAR priesttypes %addItem( %2, @priesttypes)} {#if (%ismember( %2, @rogueclasses)) {#VAR rogues %addItem( %3, @rogues);#VAR roguelevels %addItem( %1, @roguelevels);#VAR roguetypes %addItem( %2, @roguetypes)} {#if (%ismember( %2, @mageclasses)) {#VAR mages %addItem( %3, @mages);#VAR magelevels %addItem( %1, @magelevels);#VAR magetypes %addItem( %2, @magetypes)} {#echo What class is %3?}}}}}
#ALIAS reportvits {gsay VIT ASSIGNMENTS:;gsay %expanddb( @FinalVits, " -+- ", "--")}
#ALIAS echovits {#echo VIT ASSIGNMENTS:;#echo %expanddb( @FinalVits, " -+- ", "--")}
#VAR mageClasses {Invoker|Enchanter|Elementalist|Necromancer|Psionicist|Illusionist|Lich}
#VAR priestClasses {Druid|Cleric|Shaman}
#VAR fighterClasses2 {Warrior|Ranger|Anti|Paladin|Dire}
#VAR rogueClasses {Rogue|Bard|Battlechanter}
#CLASS 0
#CLASS {AUTOVITASSIGNER|Add_Group} {disable}
#TRIGGER {$} {#T- Add_Group;#T- AddgroupTemp;#delitem grouplist copper;showgroup;whocapture}
#TRIGGER {* (%w)} {addtogroup %1}
#CLASS 0
#CLASS {AUTOVITASSIGNER|AddgroupTemp} {disable}
#TRIGGER {Unsplit coins} {#T+ Add_Group}
#CLASS 0
#CLASS {AUTOVITASSIGNER|WhoCapture}
#TRIGGER {~[(%d) (%w)*~] (%w)} {#echo captured;#if (%ismember( %2, @fighterclasses2)) {#VAR tanks %addItem( %3, @tanks);#VAR tanklevels %addItem( %1, @tanklevels);#VAR tanktypes %addItem( %2, @tanktypes)} {#if (%ismember( %2, @priestclasses)) {#VAR priests %addItem( %3, @priests);#VAR priestlevels %addItem( %1, @priestlevels);#VAR priesttypes %addItem( %2, @priesttypes)} {#if (%ismember( %2, @rogueclasses)) {#VAR rogues %addItem( %3, @rogues);#VAR roguelevels %addItem( %1, @roguelevels);#VAR roguetypes %addItem( %2, @roguetypes)} {#if (%ismember( %2, @mageclasses)) {#VAR mages %addItem( %3, @mages);#VAR magelevels %addItem( %1, @magelevels);#VAR magetypes %addItem( %2, @magetypes)} {#echo What class is %3?}}}}}
#TRIGGER {Sorry, but (%w) is not a valid option.} {#additem ldchars %1}
#TRIGGER {~[ Anon ~] (%w)} {#additem anonchars %1}
#CLASS 0
Last edited by Jhorr on Thu Dec 22, 2005 12:19 am, edited 1 time in total.
Alilsil
Sojourner
Posts: 29
Joined: Thu Jul 04, 2002 5:01 am
Location: Oslo

Postby Alilsil » Thu Dec 08, 2005 7:08 pm

nice nice :)
Kallinar
Sojourner
Posts: 564
Joined: Sun Nov 04, 2001 6:01 am
Location: C'ville Va.
Contact:

Postby Kallinar » Thu Dec 08, 2005 8:36 pm

Wow.
Kallinar goes MOO
Image
Confucious say: He who walk around with hand in pocket feel kockie all day.
Alilsil
Sojourner
Posts: 29
Joined: Thu Jul 04, 2002 5:01 am
Location: Oslo

Postby Alilsil » Thu Jan 26, 2006 1:18 am

just a question jhorr.. im testing this autovitter u got here:)
but can u post the value of knownvits to?
assume that is a variable data record or two:)

Return to “MUD Client Help”

Who is online

Users browsing this forum: No registered users and 12 guests