|
Capriole Newbie
Joined: 12 Dec 2006 Posts: 6
|
Posted: Tue Dec 12, 2006 7:41 am
Newb question - logging or database? |
Or perhaps it's a different term I'm looking for.
What I need is to capture the character that appears next to an asterisk whenever it appears and save those characters to a different file, all in a row, until I tell it to start over again on the next line. I've read some entries here that make it seem like it should be possible, but they don't quite apply, and while I can do the basic trigger/macro/alias/variable things, I don't have the understanding for the more esoteric things.
I would imagine a simple
#TRIGGER {~*(?)} {<command> %1} would be the basic concept to begin - but I don't know what command to use, or how the database works, or if a database is even when I need, or some form of logging, or ...?
Much thanks in advance for anyone who can help a lost soul out - I was fine fumbling in the shallow end of the pool but I'm over my head here.
[Edit: I was just doing another search, and remembered - Am I looking for an #ADDKEY sort of thing? Data record as opposed to database?] |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 8:03 am |
How are you looking to have the data stored? You use the words "capture" and "logging" and mention databases too. It's up to you how it's stored - could be in a .txt file on your computer, could be as a string in a variable. Once you've got the pattern firing properly, it's up to you what you do with it.
On that note, what exactly is the pattern you're looking for? You want to capture the entire line following an asterisk? Any asterisk? And should it be the entire line, or just what comes after the asterisk? An example of some MUD output you expect to set off the trigger would help :) |
|
|
|
Capriole Newbie
Joined: 12 Dec 2006 Posts: 6
|
Posted: Tue Dec 12, 2006 8:40 am |
I'm using a confusion of words because I'm confused as to what I want. :P
A .txt file on my computer would be perfect - the pattern will simply be a single character after an asterisk. For example, the game will show "v*F" and I'll want the 'F' to be sent to that text file. I reckon the trigger to grab that will be easy enough, with the ? as the single character wild card, right? But I'm not sure how to send it where I want it.
I'd want to be able to add each of the characters it grabs into a single line of a text file until I told it to start a new line in that same text file and then continue (not sure if that one is possible, but I think somehow a format command will do the first?)
Thanks for the quick reply and the patience! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 10:48 am |
Well, the way you want to store the data will depend on how you ultimately want to use it. Would a load of characters in a text file be useful to you in some way, or do you want zMUD to be able to process the characters in a future script?
The pattern's okay, yes :) |
|
|
|
Capriole Newbie
Joined: 12 Dec 2006 Posts: 6
|
Posted: Tue Dec 12, 2006 3:54 pm |
Quote: |
Would a load of characters in a text file be useful to you in some way, |
Precisely. All it has to do is sit in the text file and look pretty.
It's a rather dubious approach to mapping an overland, but I've fiddled with the auto-mapper and I can't make it work for the outside rooms. This way, if Zmud will nab anything right after an asterisk (which represents where you are) then the person mapping will just have to keep heading east - reach the end, enter whatever command to make the nabbed letters continue on the next line down, go back west, and start again.
[Edit] I think I found almost what I need! My latest thought was maybe the #WRITE command?
#File 1
#TRIGGER {~*(?)} {#WRITE 1 %1}
...but I don't know how to put that all on one line, that is,
vvFfp
instead of
v
v
F
f
p
...nor do I know how to make it begin again on a new line when needed.
Thanks so much Fang for the patient questions! I know it'd be easy to ignore the confused newb. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 12, 2006 3:58 pm |
#WRITE is what I was going to suggest you do if it just needed to be a text file. What you'll need to do is use a variable to store the values by using the %concat function, and then #WRITE them out at the end of row. So you'd want something like:
#trig {~*(?)} {#var WriteLine %concat(@WriteLine,%1)}
#alias EndLine {#write 1 @WriteLine;#var WriteLine ""} |
|
|
|
|
|