|
poploco Beginner
Joined: 14 Oct 2003 Posts: 18 Location: Canada
|
Posted: 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 |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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 "". |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Feb 18, 2013 12:48 am |
That was solution 2
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
poploco Beginner
Joined: 14 Oct 2003 Posts: 18 Location: Canada
|
Posted: 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. |
|
|
|
poploco Beginner
Joined: 14 Oct 2003 Posts: 18 Location: Canada
|
Posted: 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!
|
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: 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>
|
|
|
|
|
poploco Beginner
Joined: 14 Oct 2003 Posts: 18 Location: Canada
|
Posted: Mon Feb 18, 2013 9:46 pm |
Yes :) seems to work thanks!
|
|
|
|
|
|