|
Raksasas Novice
Joined: 09 Aug 2001 Posts: 39 Location: USA
|
Posted: Sun May 12, 2002 11:28 pm
Capturing Names? |
Is it posible to capture names like when they log on and log off and in the Who?
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun May 12, 2002 11:29 pm |
quote:
Is it posible to capture names like when they log on and log off and in the Who?
Yep, this is clearly possible.
li'l shmoe of Dragon's Gate MUD |
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Mon May 13, 2002 5:53 am |
You'll have to give us a bit more info as to how you receive this information or else we can't really help you other than what MattLofton said.
Iljhar |
|
|
|
Galakoth Beginner
Joined: 01 Dec 2000 Posts: 11
|
Posted: Fri Aug 16, 2002 6:07 pm |
I am not the original poster here, but I need the same kind of help. My problem is really difficult tho. Below is the Who list output from my mud:
-------------------------======] Final Realms [======------------------------
Fri Aug 16 06:17:13 2002
----------------------------------] Mortals [----------------------------------
Akaelin (Newbie) the male gnome
Beastmaster (Newbie) the male human
Benomi Stonereaver the male dwarf (Idle: 2)
Drain (Newbie) the female lizard-man (Idle: 10)
Fandral D'Loner the male goblin
Garock D'Blooddrinker the male duergar
Houndaer the male drow
Justus (Newbie) the male duergar
Morphelle the female human
Ogrim (Newbie) the male orc (Idle: 6)
Railz WitchBlade the male drow
Shimergloom MistShroud the male goblin
Solid Megiltura the male drow (Idle: 8)
Tartooof (Newbie) the male dwarf
Taz Stonereaver the male dwarf
Vengence Lodotten the male duergar
Xar Brodahl the male drow (Idle: 13)
Zhaoyun the male human
---------> There are eighteen mortals on Final Realms MUD right now. <---------
I need to capture the names into different variables based on race. Variables are Friends, Enemies, and Neutrals. Right off drow, duergar go into Enemies, no problem there. And Elves,Dwarves got into Friends. It gets tricky with the rest of the races, most goblins and orcs are evil so they go into Enemies, but there are a few that are Neutral so they go to neutral. The same is true for halfling,gnomes, and humans. Most are good, so they go to the good Variable. Some humans are Anti-Paladins so they go to Enemies.
I have all the triggers to capture the basic info, but is puts everyone into one of the 3 variables based on race. I need to be able to move them to the correct variable, and not overwrite that with the next who command.
The last problem I have is once I capture these names into Variable I use a trigger to color the names. But all the every time there is a name that is common in room descriptions it is color too. Like Solid, if the word solid is in a room desc it gets the same color as the players name does. Is there a way to fix that?
this is how I capture the data into a variable.
#TRIGGER {^%s(%w) the (%w) dwarf} {#if %ismember( %1, @friends) {#noop} {#additem friends %1};#if %ismember( %1, @enemies) {enemies=%delitem( %1, @enemies)}} "race"
Any thoughts? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat Aug 17, 2002 9:36 am |
First, change your triggers so they don't make changes once someone has been assigned to either variable. (There's not much point moving someone from one group to the other if your trigger will just move them back)
#TR {^%s(%w) the (%w) dwarf} {#IF (%ismember(%1,@friends) OR (%ismember(%1,@enemies)) {#NOOP} {#ADDITEM friends %1}} "race"
#TR {^%s(%w) * the (%w) dwarf} {#IF (%ismember(%1,@friends) OR (%ismember(%1,@enemies)) {} {#ADDITEM friends %1}} "race"
Next add a couple aliases so you can easily switch people from one variable to the other.
#AL friend {#ADDITEM friends %1;#DELITEM enemies %1}
#AL enemy {#ADDITEM enemies %1;#DELITEM friends %1}
As for the last problem: No, there's no way to prevent that. You can reduce it by making the #CW/#COLOR triggers case-sensitive, but you'll still get the occasional sentence that starts with "Solid" and matches the trigger.
"Solid clouds make a path to walk on in this city in the sky."
LightBulb
Senior Member |
|
|
|
|
|
|
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
|
|