Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Mon Jul 14, 2003 11:11 am   

Report Alias for Massive Triggers
 
#TRIGGER {[DEATH INFO]: (%1) was killed by (%2) in (%3)((%4)).}
{#ADDKEY {PCDeaths} {%1} {%eval( %db( @deaths, "%1") + 1)}
#ADDKEY {PainfulMobs} {%2} {%eval( %db( @deaths, "%1") + 1)}} {Death Info}



My problem lies in that the information is displayed for pattern:

[DEATH INFO]: Kelrin was killed by A painful guy in A room somewhere(7382).

shows this when i display the variables:

PCDeath - Kelrin1
PainfulMobs - A Painful guy1

what i WANT it to do is seperate the alpha with the numerics. I want to display:
PCDeath - Kelrin was killed 1 time(s).
PainfulMobs - A Painful guy killed a pc 1 time(s).

How do I do this? HELP?!
Reply with quote
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Mon Jul 14, 2003 11:14 am   
 
Oh yea, and also - this will be creating MANY different parts of the @PainfulMobs and @PCDeath vars. that is why i created a list, to keep it organized. If you can help, keep that in mind with the alias. 20-30 creatures with different numbers for kills(or pcs and deaths...)

Thanks!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Jul 14, 2003 1:11 pm   
 
The variable inside of the %db should be the same one used for the #ADDKEY. Also, you should use the same %n as the key arguemnt to that specific #ADDKEY. Finally, don't use %n in the pattern itself because it can lead to unexpected results. Instead, use the wildcards that zMUD has available. In the end, your trigger should look more like:
#TRIGGER {~[DEATH INFO~]: (%w) was killed by (*) in *~(%d~).} {#ADDKEY {PCDeaths} {%1} {%eval( %db( @PCDeaths, "%1") + 1)};#ADDKEY {PainfulMobs} {%2} {%eval( %db( @PainfulMobs, "%2") + 1)}} {Death Info}

Note the use of ~ before the []'s and the ()'s. Since these have special meaning in a pattern, they need the ~ before them so that zMUD will match them. Also, notice that the place where the person was killed as well as the room number was not enclosed in parenthesis in the pattern. Sicne you are not doing anything with this information in the trigger, there is no need to store these values to %3 and %4.
Reply with quote
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Tue Jul 15, 2003 7:27 am   
 
Thank you very Much :) I'll see how well that works :)
Reply with quote
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Tue Jul 15, 2003 9:27 am   
 
That all worked out great..stored everything, but still with the same problem. I have the report alias:

#Alias {drep} {gtell @PCDeaths;gtell @PainfulMobs} {Death Info}

and it reports this verbatim:

gtell Tara42Bob76
gtell Demios in42Crap76

You tell the group 'Tara42Bob76'

You tell the group 'Demios in42Crap76'
I want (for PCDeaths):
Bob 76 Tara 42
(for PainfulMobs)
Crap 76 Demios 42

I want to try to get them in order of number, if possible. And in the end I want it to say (in pretty colors):

Bob was killed 72 times. Tara was killed 42 times.
Crap killed 72 people. Demios killed 42 people.

Any more help would be GREATLY appriciated!!





In the mean time...it is about 4:30 am (I'm NOT a mud addict...i cut back, now i am only mudding for 23 hours a day!!) so i am going to bed...And thanx in advance for whatever help you could give me :)
Reply with quote
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Tue Jul 15, 2003 9:29 am   
 
Also - amount of triggers/variables, aliases(what is the plurar, Alii?) doesn't matter to me...I have enough triggers to lead the best hunt in a mud without even having to be at the keyboard *evilgrin*...
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Jul 15, 2003 12:08 pm   
 
These issues were discussed in a very recent thread. I'll just post the link to it here.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jul 15, 2003 2:00 pm   
 
The thread Kjata referenced covers sorting. Display is simply a matter of formatting the information instead of using the variable verbatim. There are many ways of doing so, I've demonstrated one below.

#AL drep {gtell %expanddb( @PCDeaths, " times. ", " was killed ") times.}
Reply with quote
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Thu Jul 17, 2003 4:05 am   
 
i see the %sort command, that only sorts it alphabettically. . . what about numerically?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jul 17, 2003 4:10 am   
 
That was covered in Kjata's link.
Reply with quote
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Thu Jul 17, 2003 4:37 am   
 
and the %expanddb worked great, thank you
:)
Reply with quote
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Sun Jul 20, 2003 6:35 pm   
 
Anyone tell me how to sort the variables in numerical order? %sort only does alphabetic of the first part of the info(IE player name, Mobile name) I need te second part ordered o_O

again, thanx for all the help so far
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 20, 2003 7:58 pm   
 
%sort sorts by alphabetical, not numerical, order.

That means, in order to sort numerically you'll need to convert all your numbers to strings of the same length.
10 comes before 2 (1 is before 2)
02 comes before 10 (0 is before 1)

This was all covered in the topic Kjata linked to (didn't I already say that?)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 20, 2003 8:16 pm   
 
Actually, unless your character is connected to the MUD whenever it's online, your data will be meaningless anyway. This sort of task should be handled by the MUD itself, not by some character who may not be online when people die.
Reply with quote
Kelrin
Beginner


Joined: 13 Jul 2003
Posts: 10
Location: USA

PostPosted: Tue Jul 22, 2003 6:32 am   
 
that is not a problem, i am online idling most of the time
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net