Prompt question

by Vesar

Back to Mechanic's Corner.

Vesar2005-09-26 03:02:41
So I want to add something at the end of my prompt to look like:

3420h, 5580m, 4770e, 10p esSix- (something here)

How would I get it there, vice making it a new line?

And I don't really want to have to replace the whole prompt....

Any ideas?
Ixion2005-09-26 03:44:37
What do you want there? Like health/mana/ego difference values? if you want that I can give you it

You use zmud right? Go to the trigger you want echoed or whatever, and click the 'options' tab. There will be a check box with 'newline' or 'prompt'. Unselect the newline and select the prompt, which means the echo or whatev will trigger on the same line as the prompt itself.
Soll2005-09-26 06:11:57
Something like:

#trigger {^(%d)h, (%d)m, (%d)e, (%d)p (%5)-) {#echop } {nocr|prompt}
Gregori2005-09-26 06:46:08
Actually you want to use #SAYPROMPT in zMUD

#ECHO will force a linefeed at the end of every prompt and cause epileptic seizures overtime...


Edited to show the right command.
Vesar2005-09-26 11:58:57
With "prompt" selected, the pattern tests good, but the trigger won't fire any more...
Ekard2005-09-26 12:28:56
Try
#sayp %ansi(color)"<"What you want to see"> "

It works for me.
Vesar2005-09-26 13:19:18
Let me just show what I have....

CODE

#TRIGGER {^(%d)h, (%d)m, (%d)e, (%d)p ()} {#sayprompt %ansi( gray)~(%if( @HealthDifference < 0, %ansi( red)@HealthDifference, %if( @HealthDifference = 0, %ansi( gray)@HealthDifference, %ansi( green)@HealthDifference))h, %if( @ManaDifference < 0, %ansi( red)@ManaDifference, %if( @ManaDifference = 0, %ansi( gray)@ManaDifference, %ansi( green)@ManaDifference))m, %if( @EgoDifference < 0, %ansi( red)@EgoDifference, %if( @EgoDifference = 0, %ansi( gray)@EgoDifference, %ansi( green)@EgoDifference))e%ansi( gray)~)} "" {nocr|prompt}


I know the code itself works, but right now, this trigger isn't firing at all.
Gregori2005-09-26 17:26:43
CODE
#CLASS Prompt_Trigger
#FUNCTION promptcolor {%if( (@variation%{1}!=0), %if( @variation%{1}>0, %ansi( high, green), %ansi( high, red)), %ansi( grey))}
#REGEX {^(?LastHealth:\\d+)h\\, (?LastMana:\\d+)m\\, (?LastEgo:\\d+)e\\, (?CurrentPower:\\d+)p\\, (?CurrentEndurance:\\d+)en\\, (?CurrentWillpower:\\d+)w (?PromptFlags:*)\\-} {#MATH variationhealth (@lasthealth - @currenthealth);#MATH variationmana (@lastmana - @currentmana);#MATH variationego (@lastego - @currentego);#VARIABLE CurrentHealth %1;#VARIABLE CurrentMana %2;#VARIABLE CurrentEgo %3;#SAYPROMPT %ansi( grey)~ ~ ~ (@promptcolor(health)@variationhealth~h%ansi( grey), @promptcolor(mana)@variationmana~m%ansi( grey), @promptcolor(ego)@variationego~e%ansi( grey)) ~} "" {nocr|prompt}
#CLASS 0


This is what I use. You can see if it helps you any.
Atreus2005-09-29 03:39:38
Kinda funny that this came up because I'm having the exact same problem.... Here's the code I use that's causing the same problem of not echoing on the same line.

CODE

#TR {^(%d)h, (%d)m, (%d)e, (%d)p* ()} {#IF {@Health != %1} {#echop %ansi( %if( %1<@Health, red, green)) ~(%eval( %1-@Health)h~)}
#VAR Health %1
#IF {@Mana != %2} {#echop %ansi( %if( %2<@Mana, red, green)) ~(%eval( %2-@Mana)~m)}
#VAR Mana %2
#IF (@HealingBalance = 0 AND @Health < 3200) {
 Sip Health
 #VAR HealingBalance 1
 }
}

And it outputs like this:
3902h, 2036m, 2540e, 10p ex-
insomnia

You are already an insomniac.
3902h, 1936m, 2540e, 10p ex-
(-100m)


Help?
Terenas2005-09-29 04:30:52
I just use this-

CODE
#REGEX {^(\\d+)h, (\\d+)m,} {#IF (%1=@CurrentHealth) {} {#IF (%1>@CurrentHealth) {#MATH HealthAdjust %1-@CurrentHealth;#sayprompt %ansi( bright, cyan)~};#IF (%1<@CurrentHealth) {#MATH HealthAdjust @CurrentHealth-%1;#sayprompt %ansi( bright, cyan)~}};#IF (%2=@CurrentMana) {} {#IF (%2>@CurrentMana) {#MATH ManaAdjust %2-@CurrentMana;#sayprompt %ansi( bright, cyan)~};#IF (%2<@CurrentMana) {#MATH ManaAdjust @CurrentMana-%2;#sayprompt %ansi( bright, cyan)~}};Health=%1;Mana=%2;CurrentHealth=@health;CurrentMana=@mana;#if @todisplay=1 {#sayprompt ~;#va todisplay 0;#va display 0};#if @ticktimer=1 {#sayprompt ~}} "" {nocr|prompt}
Unknown2005-09-29 05:23:57
Forgive my ignorance, but what does #REGEX do?
Atreus2005-09-29 06:03:23
This:
QUOTE(terenas @ Sep 28 2005, 11:30 PM)

{^(\\d+)h, (\\d+)m,} 


Doesn't work. When it comes through on the MUD it doesn't fire, even though when I enter my prompt into the 'test' tab on the actual trigger window, it says it works fine.
Atreus2005-09-29 06:15:32
QUOTE(Atreus @ Sep 28 2005, 10:39 PM)
Kinda funny that this came up because I'm having the exact same problem.... Here's the code I use that's causing the same problem of not echoing on the same line.

CODE

#TR {^(%d)h, (%d)m, (%d)e, (%d)p* ()} {#IF {@Health != %1} {#echop %ansi( %if( %1<@Health, red, green)) ~(%eval( %1-@Health)h~)}
#VAR Health %1
#IF {@Mana != %2} {#echop %ansi( %if( %2<@Mana, red, green)) ~(%eval( %2-@Mana)~m)}
#VAR Mana %2
#IF (@HealingBalance = 0 AND @Health < 3200) {
 Sip Health
 #VAR HealingBalance 1
 }
}

And it outputs like this:
3902h, 2036m, 2540e, 10p ex-
insomnia

You are already an insomniac.
3902h, 1936m, 2540e, 10p ex-
(-100m)


Help?
194860



This is annoying the crap out of me, especially because on Achaea this has NO problem working as it should.
Unknown2005-09-29 13:52:52
Do you have the emulation of GA/EOR for prompts enabled in your zMUD profile settings? That will cause extra blank lines, but it ensures that prompts fire properly and that no messages get tacked onto prompts. I'd recommend using #PSUB instead of #ECHOPROMPT, though. The prompt echo/say/show commands ensure that it doesn't -end- with a newline, but they don't guarantee that it won't -begin- on a newline, especially if you use the GA/EOR emulation.
Vesar2005-09-29 19:24:53
#psub is working.. but not how I want. I'm able to get it to replace my current health, mana, etc with the change tracker, but when I try to place it at the end it ends up gagging too much.