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
Latent
Apprentice


Joined: 19 Aug 2002
Posts: 120
Location: USA

PostPosted: Fri Dec 26, 2003 9:38 pm   

Help on a trigger/alias
 
Ok, I get a chunk of text that looks like this when I type in a command, 'software':

You jack into the deck and retreive the following data:
MPCP 20 - Active Memory 6000 - Storage Memory 9073/10000
Hardening 10 - IO 4000 - Response Increase 3
Persona Programs:
Bod: 8 Masking: 9
Sensors: 8 Evasion: 8
Other Software:
Paydata Bryerson Medical Center - 30Mp Rating: 1072468163
Paydata Bryerson Medical Center - 120Mp Rating: 1072468163
a level five custom Browse utility program Rating: 5
a FoxFire 'Kitsune' Decrypt program Rating: 6
a FoxFire 'Kitsune' Analyze program Rating: 6
a Mitsuhama Medic program R:4 Rating: 4
a Transys Sleaze Eight Program Rating: 8
a Microdeck 'Titanium' Armour Program Rating: 2
a Microdeck 'Author' Read/Write Program Rating: 2
a Microdeck 'Trick' Deception Program Rating: 2
Attack-9 Program Rating: 9

[ 10P 10M ][ 3/3 ][ 9.05K 438831N ]

Now... the files under the "Other software" section are what matter, specifically the ones that start with "Paydata." I want to make an alias that will activate the 'software' command, gag the output from the mud, count the number of 'Paydata' files I have, and then show me... how would I get this done?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Dec 27, 2003 12:59 am   
 
#AL pd {#T+ Paydata;#VA Paydata 0;#GAGON;software}
#CLA Paydata disable
#TR {^Paydata } {#AD Paydata 1}
#TR { %dP %dM} {#T- Paydata;#GAGOFF;#SH {You have @Paydata Paydata files}) {} {prompt}
#CLA 0
#T- Paydata
Reply with quote
soldado_del_rey
Newbie


Joined: 23 Dec 2003
Posts: 7
Location: USA

PostPosted: Sat Dec 27, 2003 1:06 am   
 
I'm no expert, but try this.


#class software
#class 0
#alias sw {#t+ software;software;wait 500;#t- software;#ec You have @paydatas files.}
#tr {Paydata} {#add @paydatas 1} "software"
#tr {You jack into the deck} {#gag 20} "software"
Reply with quote
Latent
Apprentice


Joined: 19 Aug 2002
Posts: 120
Location: USA

PostPosted: Sat Dec 27, 2003 9:41 am   
 
#CLASS {Paydata} {disable}
#ALIAS pd {
#T+ Paydata
#VA Paydata 0
#GAGON
software
}
#TRIGGER {^Paydata } {#AD Paydata 1}
#TRIGGER { %dP %dM} {
#T- Paydata
#GAGOFF
#SH {You have @Paydata Paydata files}
} "" {prompt}
#CLASS 0


Now, whent I type "pd" I get this:


You have 0 Paydata files
You jack into the deck and retreive the following data:
MPCP 20 - Active Memory 6000 - Storage Memory 9223/10000
Hardening 10 - IO 4000 - Response Increase 3
Persona Programs:
Bod: 8 Masking: 9
Sensors: 8 Evasion: 8
Other Software:
a level five custom Browse utility program Rating: 5
a FoxFire 'Kitsune' Decrypt program Rating: 6
a FoxFire 'Kitsune' Analyze program Rating: 6
a Mitsuhama Medic program R:4 Rating: 4
a Transys Sleaze Eight Program Rating: 8
a Microdeck 'Titanium' Armour Program Rating: 2
a Microdeck 'Author' Read/Write Program Rating: 2
a Microdeck 'Trick' Deception Program Rating: 2
Attack-9 Program Rating: 9

[ 10P 10M ][ 3/3 ][ 71.12K 661371N ]

It's trying to show me how many paydata files I have before it even counts them, and it's not gagging the text
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Dec 27, 2003 7:33 pm   
 
I put commands in a specific order for specific reasons. They won't work in the order you rearranged them to.

The problem you describe is probably caused by the prompt trigger. Since I only used the "prompt" option, it can fire not only when received as a prompt but also when contained in a line. Unfortunately, when you send "pd", the return completes the line containing the previous prompt and fires the trigger. It can probably be fixed by adding the "nocr" option (or disabling Newline in the editor). However, the script still won't work if you put the alias which enables the class inside the class it enables.

#DELC Paydata
#AL pd {#T+ Paydata;#VA Paydata 0;#GAGON;software}
#CLA Paydata disable
#TR {^Paydata } {#AD Paydata 1}
#TR { %dP %dM} {#T- Paydata;#GAGOFF;#SH {You have @Paydata Paydata files}} {} {prompt|nocr}
#CLA 0
#T- Paydata

EDIT: Corrected typo in script
Reply with quote
Latent
Apprentice


Joined: 19 Aug 2002
Posts: 120
Location: USA

PostPosted: Sat Dec 27, 2003 9:56 pm   
 
One other problem I'm getting is I'm having to put the "#TR { %dP %dM} {#T- Paydata;#GAGOFF;#SH {You have @Paydata Paydata files}) {} {prompt|nocr}" part of the script in manually, because when I copy and paste the code into zmud, I get this:

(script copy and pasted in)

[ 10P 10M ][ 3/3 ][ 75.64K 618177N ]{You have 0 Paydata files}) prompt|nocr
{#T-

Edit:
#TR { %dP %dM} {#T- Paydata;#GAGOFF;#SH {You have @Paydata Paydata files}) {} {prompt|nocr}

Found that, fixed the problem:
#TR { %dP %dM} {#T- Paydata;#GAGOFF;#SH {You have @Paydata Paydata files}} {} {prompt|nocr}

I was wondering if you had to do anything to set up a certain line to be recognized as a prompt on zmud, because when I use the "pd" alias now, it keeps all of the text gagged until I hit enter, and then it just goes back to normal...

#CLASS {Paydata} {disable}
#TRIGGER {^Paydata } {#AD Paydata 1}
#TRIGGER { %dP %dM} {
#T- Paydata
#GAGOFF
#SH {You have @Paydata Paydata files}
} "" {nocr|prompt}
#CLASS 0
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Dec 28, 2003 7:56 pm   
 
In order for a line to be recognized as a "prompt", it has to be sent as a block which doesn't end with a newline character. That means, you will see the line, but the cursor will still be on that line, and the next thing you type will also be on that line (without typing ahead).

If that trigger doesn't work for you, try a blank-line trigger (similar to all the chat window scripts). I'm just making guesses about what your MUD does. I don't actually know if that line is a prompt or not. All you are looking for is a line which will tell you, "That's the end of the program listings, so you can go back to showing stuff in the window again". If you can't find a line which does that, or can't make a trigger which will do it after the listings instead of before them, then you will have to do three things (the same three things the trigger did).
1. Remove the #GAG commands. If zMUD doesn't know when to stop gagging, they aren't safe.
2. Send your own command to display the variable contents once you decide that all the "Paydata" lines have been received.
3. Disable the class until the next time you need it (optional)
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