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
Tilar
Newbie


Joined: 03 Feb 2002
Posts: 9

PostPosted: Sun Feb 03, 2002 1:45 am   

Prompts in the way of triggers.
 
My MUD has a prompt which always comes up, which looks like this:

<16577/16577hp 5219/5249m 1539/1810mv 69a>

Sometimes when I'm sent a tell, it comes up after the prompt, like this:

<16577/16577hp 5219/5249m 1539/1810mv 69a> Bob tells you 'hi'.

Sometimes it doesn't come right after. Using the speach plugin, I want it to read any and all tells sent to me, but the problem is instead of storing the name as simply "Bob" it stores it as "<16577/16577hp 5219/5249m 1539/1810mv 69a> Bob" which means it reads the prompt out loud to me. Is there any way, using one trigger or two, to have it read the tells to me while ignoring the prompt? And while it is doing that, ALSO allow me to still have tells without the prompt read to me? Thanks for any help.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 03, 2002 1:31 pm   
 
I'm guessing that you are using a trigger with a pattern like this:
(*) tells you '(*)'.

A cheap fix would be to have two triggers:
#TRIGGER {^~<%d/%dhp %d/%dm %d/%dmv %da~> (*) tells you '(*)'.$} {#SPEAK {%1 tells you %2}}
#TRIGGER {^(*) tells you '(*)'.$} {#SPEAK {%1 tells you %2}}

I think that #SPEAK was the command to have MudReader say something

A better solution would be to separate what comes after your prompt from the prompt using this trigger:
#TRIGGER {^~<(%d)/(%d)hp (%d)/(%d)m (%d)/(%d)mv (%d)a~> (*)$} {#SUB {~<%1/%2hp %3/%4m %5/%6mv %7a~>%cr%8}}

Note: With this approach, the color, if any, from the prompt and tell will not be displayed.

Kjata
Reply with quote
Tilar
Newbie


Joined: 03 Feb 2002
Posts: 9

PostPosted: Sun Feb 03, 2002 7:05 pm   
 
Well, your first cheap fix kinda worked. THe only problem the second trigger is activated by the same thing that activated the first, so it ends up rereading that line and reading the prompt in the process. If you know a way to have that second trigger activate if and only if there is absolutely nothing behind it, I'd appreciate it.

And your second fix didn't work at all, though I'd rather not lose my color anyways :( Thanks a lot for trying though.

Tilar
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Feb 04, 2002 7:06 am   
 
If the tell command is limited to one-word names (or if you are willing to accept just the last word of multi-word names) you could use an unanchored trigger.

#TR {(%w) tells you '(*)'$} {#SPEAK %1 tells you %2}

LightBulb
All scripts untested unless otherwise noted
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Mon Feb 04, 2002 9:13 am   
 
Or a single trigger solution:

#TRIGGER {(%*) tells you '(%*)'.$} {#IF (%trigger =~ "~<%d/%dhp %d/%dm %d/%dmv %da> (%*) tells you '(%*)'") {#speak {%%1 tells you %%2}} {#speak {%1 tells you %2}}}

 - Charbal
Reply with quote
Tilar
Newbie


Joined: 03 Feb 2002
Posts: 9

PostPosted: Tue Feb 05, 2002 1:12 am   
 
Thanks Lightbulb, your solution works great :) Sorry, I didn't try the next one down cause it looks too complicated for my blood.
Reply with quote
heidi
Newbie


Joined: 04 May 2002
Posts: 1

PostPosted: Tue Apr 02, 2002 8:14 pm   
 
Hi:

I made a post to another thread that addressed this topic directly. It might help in this case also:

http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=5791&FORUM_ID=7&CAT_ID=1&Topic_Title=capture+problem&Forum_Title=zMUD+General+Discussion

e.g.

#Trigger {^~<%d/%dhp %d/%dm %d/%dmv %da~>{#nomap;#sub {%1%2>%{cr}}} "" {nocr|prompt}

In my limited testing this script does a pretty good job of putting the prompt on a line by itself. This allowed me to tighten down a few holes without having to create 2 triggers for each action I wanted (one with the prompt, one without).

Also, one thing to consider about LightBulb's script. What happens if someone tells you:

Bob tells you 'Ha Ha!;narr I'm nekked!;remove all;drop all;5w2s14e'
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