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
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Tue Nov 02, 2004 6:35 am   

help with prompt trigger
 
I'm having some difficulties getting my align to display correctly in a variable.

my align will go from -1000 to 1000

my current setup is as follows:

^Hit:%d/%d MVS:%d/%d A:{-|}(%d)

#IF (%1>325) {#IF (%1>@LastAlign) {#echo {Warning! You are losing neutrality!)}}}
LastAlign=%1

my varialbe for lastalign always shows a positive number.
i need it to also display in the var if it's a neg number as well.

any help is appriciated.
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Nov 02, 2004 12:25 pm   
 
%n captures Plus, minus, commas (and I believe decimals)

^Hit:%d/%d MVS:%d/%d A:(%n)
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Tue Nov 02, 2004 12:29 pm   Re: help with prompt trigger
 
dcb wrote:

^Hit:%d/%d MVS:%d/%d A:{-|}(%d)

#IF (%1>325) {#IF (%1>@LastAlign) {#echo {Warning! You are losing neutrality!)}}}
LastAlign=%1

my varialbe for lastalign always shows a positive number.
i need it to also display in the var if it's a neg number as well.

any help is appriciated.


From Pattern Matching under References in zMud help:

%d match any number of digits (0-9)
%n match a number that starts with a + or - sign

I believe your trigger could be rewritten to something like

^Hit:%d/%d MVS:%d/%d A:(%n)

#IF (%abs(%1) > 325 OR %abs(%1) > %abs(@LastAlign)) {#echo Warning! You are losing neutrality!} {}
LastAlign=%1

This is untested, but it should work. If not, reply again and I or someone else will try to give a better answer.
Reply with quote
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Wed Nov 03, 2004 5:07 am   Re: help with prompt trigger
 
Well it didn't work :( actually using this method it cuts off the last digit in the align so if my align is -728 the var lastalign would show 72.

Thanks for helping.

mr_kent wrote:
dcb wrote:

^Hit:%d/%d MVS:%d/%d A:{-|}(%d)

#IF (%1>325) {#IF (%1>@LastAlign) {#echo {Warning! You are losing neutrality!)}}}
LastAlign=%1

my varialbe for lastalign always shows a positive number.
i need it to also display in the var if it's a neg number as well.

any help is appriciated.


From Pattern Matching under References in zMud help:

%d match any number of digits (0-9)
%n match a number that starts with a + or - sign

I believe your trigger could be rewritten to something like

^Hit:%d/%d MVS:%d/%d A:(%n)

#IF (%abs(%1) > 325 OR %abs(%1) > %abs(@LastAlign)) {#echo Warning! You are losing neutrality!} {}
LastAlign=%1

This is untested, but it should work. If not, reply again and I or someone else will try to give a better answer.
Reply with quote
dcb
Novice


Joined: 02 Sep 2004
Posts: 42

PostPosted: Wed Nov 03, 2004 5:52 am   
 
okay scratch that i got the - to show up finally.

Now what i need is this.

if lastalign >325 #echo you are going good
if lastalign <-325 #echo you are going evil

possible?
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Wed Nov 03, 2004 7:05 am   
 
^Hit:%d/%d MVS:%d/%d A:(%n)

#IF (%abs(%1) > 325 OR %abs(%1) > %abs(@LastAlign)) {#echo Warning! You are losing neutrality!;#IF (%1 > 0) {#echo you are going good} {#echo you are going evil}} {}
LastAlign=%1
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