Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: Mon Feb 18, 2013 12:13 am   

Need help with gag prompt please
 
Hello I am trying to setup a gag so that my prompt works with the status bar.

I know how to setup the status bar part, but I need help with the actual gag trigger codes. IT should work, but CMUD's giving me a headache.

now what I need to capture and gag would be this line

$ADMIN 30944 -

Now keep in mind there might be more chars appearing infront of the dollar sign, and 30944 is just a room number.
The hyphen/dash would stay as is or turn into a number with a star infront of it, for example *655

Any help is appreciated
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Feb 18, 2013 12:28 am   
 
Could you please explain exactly what you mean? "setup a gag so that my prompt works with the status bar" does not make any sense. Your prompt should work with the status bar without any gagging.

Perhaps you mean that you want to gag the prompt so that you don't see it on the mud output, and only see the prompt data in the status bar? The difficulty with this is that generally a prompt does not end with a carriage return--the cursor waits after the prompt for the next output. Gagging will gag the entire line (including any other mud output after the prompt), and only works after a carriage return. There are two solutions, and they both involve the #SUB command. Solution 1 is to add a carriage return after the prompt, and in a subsequent trigger use #GAG to gag the prompt line. Solution 2 is to simply replace the entire prompt with something else, perhaps ">" or just "".
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon Feb 18, 2013 12:43 am   
 
You don't need to #SUB in a carriage return after the prompt. If you're using #SUB, just #SUB it to {} and it'll wipe out the triggered pattern.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Feb 18, 2013 12:48 am   
 
That was solution 2
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Feb 18, 2013 3:53 am   
 
#GAG can be given a numeric parameter (ie, #GAG 0) to specify how many lines to gag. When you do this, it happens immediately.

One thing to look for is that game developers aren't too hung up on following standards. You'll likely find that some lines come with an extra linefeed either before or after the text you're aiming for, or even not have that extra linefeed, making it look like CMud is leaving blank lines all over the place.
_________________
EDIT: I didn't like my old signature
Reply with quote
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: Mon Feb 18, 2013 1:52 pm   
 
When I talk about a gag prompt, yes I want that line not to show on the screen, but only in the status bar.

I do have a code in my prompt at the end that is invisible and causes a carriage return. I can always remove it if I want.
Reply with quote
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: Mon Feb 18, 2013 7:51 pm   
 
So anyone who can help me setup the status bar prompt so it works and actually gags that line of text? Pretty please!
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon Feb 18, 2013 9:34 pm   
 
I think this is what you are wanting.

Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <var name="promptVar" usedef="true" copy="yes">$ADMIN 30944 -</var>
  <trigger priority="20" regex="true" newline="false" prompt="true" copy="yes">
    <pattern>^(\$ADMIN \d+ [\*\-\d]*)</pattern>
    <value>#gag
promptVar = %1</value>
  </trigger>
  <stat name="PromptValue" priority="10" copy="yes">
    <value>@promptVar</value>
  </stat>
</cmud>
Reply with quote
poploco
Beginner


Joined: 14 Oct 2003
Posts: 18
Location: Canada

PostPosted: Mon Feb 18, 2013 9:46 pm   
 
Yes :) seems to work thanks!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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