|
winkerbeaner Newbie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Wed Sep 24, 2003 9:54 pm
automation process |
I'm looking to find a way to automate the identification of player characters versus non player characters (what's worse is I'm totally ignorant on anything beyond a basic trigger or alias)
when I enter a room I want to successfully capture the contents of the room and compare it to known non player characters and then identify what isn't in that list
What makes it difficult is the varying format and double worded names on some mobs compared to single worded. Here's an example of the mud output after I move into a room (ignorning ansi colors):
A Blackened Corridor
This corridor has been scarred by the fires of of the Great Molocanda, who's fury and might know no bounds. the floors, barely remaining, are nothing more than charred timbers. Step carefully, for not only is the floor unstable, but there appears to be a darkened pit in the center of the aisle.
Obvious exits are north, south, east, west, stairs, pit
slime blob
two black cats
four purple bulldogs
>
The greater than sign isn't always consistent in showing up at the bottom of the room description after a move but is there most of the time. If I were to see non player characters in the room it might look something like any of the following examples:
example 1:
A Blackened Corridor
This corridor has been scarred by the fires of of the Great Molocanda, who's fury and might know no bounds. the floors, barely remaining, are nothing more than charred timbers. Step carefully, for not only is the floor unstable, but there appears to be a darkened pit in the center of the aisle.
Obvious exits are north, south, east, west, stairs, pit
Necromancer Aexilesters, Ranger of Magic
Arcmagician Baubilus, Semiramus' evil acolyte.
Bargwalgian, Baubilus' slave dog
slime blob
two black cats
four purple bulldogs
>
EXAMPLE 2
A Blackened Corridor
This corridor has been scarred by the fires of of the Great Molocanda, who's fury and might know no bounds. the floors, barely remaining, are nothing more than charred timbers. Step carefully, for not only is the floor unstable, but there appears to be a darkened pit in the center of the aisle.
Obvious exits are north, south, east, west, stairs, pit
slime blob
Arcmagician Baubilus, Semiramus' evil acolyte.
two black cats
four purple bulldogs
Necromancer Aexilesters, Ranger of Magic
>
EXAMPLE 3:
A Blackened Corridor
This corridor has been scarred by the fires of of the Great Molocanda, who's fury and might know no bounds. the floors, barely remaining, are nothing more than charred timbers. Step carefully, for not only is the floor unstable, but there appears to be a darkened pit in the center of the aisle.
Obvious exits are north, south, east, west, stairs, pit
slime blob
two black cats
four purple bulldogs
Necromancer Aexilesters, Ranger of Magic
Arcmagician Baubilus, Semiramus' evil acolyte.
Bargwalgian, Baubilus' slave dog
>
Sorry for the length here but trying to give an idea. the rooms are not a consistent size as far as lines. the mud output varies according to how many different items/characters are in the room. also the numbers are monitored differently. If the numbers of a single item or mobs exceed 20 the classification changes to just "many"
(i.e. "many purple bulldogs")
If someone could point me in the right direction as to which files, to read for help, examples, etc. I'd appreciate it. Thanks. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Sep 25, 2003 4:16 am |
Looks like the best test is simply to check and see if the first character is a capital letter. Read the help on %left and %isupper
|
|
|
|
winkerbeaner Newbie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Thu Sep 25, 2003 10:45 am |
Ok, there is a way to cause each item/character to list individually. the "look all" command. after pouring through the help files and online manual I came up with the following which only works partially:
#ONINPUT "roomlist" {look all} {#VAR inroom "";#var nummobs 0;#TEMP {$>} {#STATE roomlist 0}} "WholeRoom"
#COND {} {#ADDITEM inroom %line;#add nummobs 1} {looplines|param=99}
For the most part this seems to cause it to pick everything up properly with the following exceptions (problems):
1) It captures the command echo as the first line. This is no huge problem as I can always start comparing at inroom.2 instead of inroom.1 but would be nice to know the proper solution. I tried telling it to skip a line and tried parameters 0 and 1 but neither worked (it skipped both the echo AND the next line)
2) when the room lists 3 of the same item/character it inserts only 1 into the list. How do I force it to insert repetative text?
Thank you for your previous response and your continued help. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Sep 25, 2003 4:36 pm |
1) Just delete the first item after you've finished adding everything
2) To add a duplicate item to a list, use the %additem function.
#ONINPUT "roomlist" {look all} {#VAR inroom "";#var nummobs 0;#TEMP {$>} {#STATE roomlist 0;#DELN inroom 1}} "WholeRoom"
#COND {} {#VAR inroom {%additem("%line", @inroom)};#add nummobs 1} {looplines|param=99}
I haven't tested this, but it should work. |
|
|
|
winkerbeaner Newbie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Thu Sep 25, 2003 9:00 pm |
Thanks. this works perfectly. Also, I realized that there's really no need to include duplicate items if I can find a way to determine the number of records in the list without physically opening it. Is there a way to do this? If so I can get rid of my counter variable.
The %left and isupper are both helping me in checking things. thanks agian, and again I apologize for my ignorance. |
|
|
|
winkerbeaner Newbie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Thu Sep 25, 2003 9:00 pm |
Thanks. this works perfectly. Also, I realized that there's really no need to include duplicate items if I can find a way to determine the number of records in the list without physically opening it. Is there a way to do this? If so I can get rid of my counter variable.
The %left and isupper are both helping me in checking things. thanks agian, and again I apologize for my ignorance. |
|
|
|
winkerbeaner Newbie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Thu Sep 25, 2003 9:11 pm |
I just answered my last question. I'm sorry for being so slow. I got the idea to maximize search options in zmud help and searched to find list and looked under "Function Reference" and found the "lists" reference. it has everything I need. thanks so much again for all your help
|
|
|
|
winkerbeaner Newbie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Thu Sep 25, 2003 9:40 pm |
well I guess I'm really showing my ignorance now. I posted before I tested the function. This is what I put down
#var listnumber %numitems(inroom)
I can have 5 items in the list but it will only assign the firstone. any suggestions? sorry to keep being such a bother. |
|
|
|
winkerbeaner Newbie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Fri Sep 26, 2003 5:01 am |
One last question
This is what I ended up coming up with through experimenting with the different functions in the lists section. Is this the most efficient way to find out how many items are in a list? (where inroom is the list being parsed and tempnumvar is the variable used for the max to loop through the list and compare it to a database of known non player characters).
#var tempnumvar %numitems(%expandlist(@inroom,"|"))
Thanks. |
|
|
|
winkerbeaner Newbie
Joined: 24 Sep 2003 Posts: 8
|
Posted: Fri Sep 26, 2003 5:01 am |
One last question
This is what I ended up coming up with through experimenting with the different functions in the lists section. Is this the most efficient way to find out how many items are in a list? (where inroom is the list being parsed and tempnumvar is the variable used for the max to loop through the list and compare it to a database of known non player characters).
#var tempnumvar %numitems(%expandlist(@inroom,"|"))
Thanks. |
|
|
|
|
|
|
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
|
|