|
shadowsurfer Novice
Joined: 17 Dec 2004 Posts: 34
|
Posted: Fri Dec 28, 2007 8:49 pm
Name Sorter ? |
I play a mud that has the following output after typing in kills. I have a question:
Is there a way to create a trigger that when kills is typed, it comes back with two seperate lists... one would be the mud mobs and the other would be players I have killed? I would guess that I would have to manually put into a list the names of those I have killed but I just can't figure out how to create the trigger. As an example, Rastas is the only player I have killed. All the others are mud mobs.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Qreh Wandermens *** 123/123 50% Buzzing and Hustling kills
You have killed 71 monsters.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
rat spider xvart
snake bat zombie
skeleton orc bear
frog giant spider bee
kobold centipede hobgoblin
xvart shaman half-ogre steam mephit
rattlesnake sirith gnoll
patrol leader drow guard nerussa
gnome giant cockroach stag beetle
bandit goblin goblyn
goblin king blood hawk Ogre
kobold thief kobold mage kobold child
witch peryton kobold captain
water elemental fire beetle wererat
wereboar lesser basilisk deep ogre
malturkurk raider Peryton King
peryton guard snakeman concubine
gremishka knight head cook
spectre flind horse
guard displacer beast giant serpent
--More-- (86%)
priest banshee hill giant
alphonso gore cloaker
mountain giant ogre king rastas[/i] |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri Dec 28, 2007 10:59 pm |
Unfortunately, there's no easy way for zMUD to decide which are players and which are mobs. You can make a list of both as simply as:
PlayerList=""
#trig {(%w)$} {#additem PlayerList %1} |
|
|
|
shadowsurfer Novice
Joined: 17 Dec 2004 Posts: 34
|
Posted: Sun Dec 30, 2007 9:57 pm |
Please, you have to make this simple for me :) And if it IS simple, then I really suck.
So in the above code, how do I add a name to the list of non-mobs?
And then how do I incorporate this into the KILLS command I referenced? |
|
|
|
Progonoi Magician
Joined: 28 Jan 2007 Posts: 430
|
Posted: Sun Dec 30, 2007 11:08 pm |
Basically Fang already said that there's no way to distinguish which from the list are Mobs, which are Players.
That being said, however, I can't believe there really aren't any parts one could distinguish. Maybe number of words (player having a multi-worded pretitle before their name, for instance), or perhaps repeating word patterns in the names of the mobs. Something like that.
Without that information, its pretty much all someone can say, though. And if, no matter what, there are no ways to make a difference, I lack suggesting something other than Fang did above. Just make both lists manually (given you *can* make the difference in your mind).
Prog |
|
_________________ The Proud new owner of CMud.
--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
-------------------------------- |
|
|
|
shadowsurfer Novice
Joined: 17 Dec 2004 Posts: 34
|
Posted: Mon Dec 31, 2007 2:23 pm |
I know there is no easy way to do this. But I know it can be done. I am no good with scripts and all that, but I can envision me manually inputting names into a list (names of players I have killed) so that when I type the alias KILLERS and what I posted earlier comes back from the mud, it puts two lists into a seperate window.. one list of mobs killed and one list of players killed. I just can't believe it can't be done.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Dec 31, 2007 4:55 pm |
Ahh, I see now. You don't want zMUD to automatically distinguish between players and mobs. Perhaps this:
#var PlayerList ""
#var PlayersKilled ""
#var MobsKilled ""
#trig {(%w)$} {#if %ismember(@PlayerList,%1) {#additem PlayersKilled %1} {#additem MobsKilled %1}}
You add players to the list with #additem PlayerList name and remove them with #delitem PlayerList name. |
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Wed Jan 02, 2008 3:45 pm |
Or you could make a nice little alias...
Code: |
#ALIAS plrk {#additem PlayerList %1} |
With usage being:
plrk rastas
Or... a more complex version allowing for multiple args...
Code: |
#ALIAS plrk {#var temp %expand(%-1);#var temp %subchar(@temp, " ", "|");#loop %numitems(@temp) {#additem PlayerList %item(@temp,%i)}} |
With usage:
plrk rastas fang zuh noobian
adding all 4 characters to the list :) |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Wed Jan 02, 2008 5:36 pm |
I considered suggesting that, Ralgith, but I actually think it's simpler (less clutter) to use the built-in zScript commands - no alias, no temp variable, just a command that does the job. You can add a list with #forall fang|rastas {#additem playerlist %i} which is longer than the alias, but shorter than its code and you only need to do it once per person.
|
|
|
|
ralgith Sorcerer
Joined: 13 Jan 2006 Posts: 715
|
Posted: Wed Jan 02, 2008 11:57 pm |
this is true ;)
I'm just an alias freak, I try and cut my command line typing down by as much as possible... thus most of my aliases are 2-4 characters long. |
|
_________________ CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate |
|
|
|
|
|