|
dcb Novice
Joined: 02 Sep 2004 Posts: 42
|
Posted: 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. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Tue Nov 02, 2004 12:25 pm |
%n captures Plus, minus, commas (and I believe decimals)
^Hit:%d/%d MVS:%d/%d A:(%n) |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: 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. |
|
|
|
dcb Novice
Joined: 02 Sep 2004 Posts: 42
|
Posted: 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. |
|
|
|
|
dcb Novice
Joined: 02 Sep 2004 Posts: 42
|
Posted: 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? |
|
|
|
mr_kent Enchanter
Joined: 10 Oct 2000 Posts: 698
|
Posted: 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 |
|
|
|
|
|