|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Sat Apr 05, 2003 8:04 pm
Help with Prompt and Healing Trigger |
Hello,
I just started to play Imperian. Ok, my problem is 2 fold.
1. Here is the prompt H:57 M:67 <eb p>
E is Equilibrium, b is balance, p is prone. Is there a way to get it so I can use this prompt to help in determinging if I have balance or not instead of triggering a ton of things to check.
2. I am having trouble with a simple script to drink health or mana when needed. The catch is, you can drink one or the other during a balance. I am trying to avoid a double sip. The small snippet I have been working with has been this
#if (@healthbalance AND @hits<40) {drink health}
#if (@healthbalance AND @mana<35) {drink mana}
two seperate #IF commands. I know that I would need to prioritize Health and such, but is it possible to have it as a single IF command? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Apr 06, 2003 3:09 am |
1. Sure. Just make sure all the letters you want are there and any you don't want aren't there.
2. Use nested #IFs to avoid double sips
#TR {H:(%n) M:(%n) ~<(*)~>} {#VAR hits %1;#VAR mana %2;#IF (%pos( e, %3) AND %pos( b, %3) AND %pos( p, %3)) {#VAR balance 1} {#VAR balance 0};#IF (@healthbalance) {#IF (%1 < 40) {#VAR healthbalance 0;drink health} {#IF (%2 < 35) {#VAR healthbalance 0;drink mana}}}}
LightBulb
Advanced Member |
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Sun Apr 06, 2003 10:17 am |
sorry also want to check to see if prone and equilibrium as well. So would I just add in
{#var equibrium 1} {#var equilibrium 0}
{#var prone 1} {#var prone 0}
and would I just nestle it in with the balance one? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Apr 06, 2003 4:26 pm |
It's in there already. I assumed you need all three since you mentioned all three in your question.
#TR {H:(%n) M:(%n) ~<(*)~>} {#VAR hits %1;#VAR mana %2;#IF (%pos( e, %3) AND %pos( b, %3) AND %pos( p, %3)) {#VAR balance 1} {#VAR balance 0};#IF (@healthbalance) {#IF (%1 < 40) {#VAR healthbalance 0;drink health} {#IF (%2 < 35) {#VAR healthbalance 0;drink mana}}}}
Actually, I'd guess you need to NOT be prone, but you didn't say. If that is the case, change the condition to:
(%pos( e, %3) AND %pos( b, %3) AND (%pos( p, %3) = 0))
LightBulb
Advanced Member |
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Mon Apr 07, 2003 2:16 am |
For some reason its still not working. Its not picking up when I am prone or standing from the prompt. The rest of the stuff you gave me works great. I think I wasn't clear on exactly what I am hoping to do with it.
Basically, I want to be able to just catch the sybmols of eb p from the display prompt to register in the variables @balance for balance, @equilibrium for equlibrium and @prone if prone. As it stands now, the trigger as it is set up will not pick up the symbol prompts for these three. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Apr 07, 2003 4:34 am |
Then change the condition to match what you want for balance and add additional #IF statements to pick up equilibrium and prone. #IF is quite easy, it's just
#IF (this condition is true) {then do this} {else do this instead}
#TR {H:(%n) M:(%n) ~<(*)~>} {#VAR hits %1;#VAR mana %2;#IF%pos( b, %3) {#VAR balance 1} {#VAR balance 0};#IF %pos( e, %3) {#VAR equilibrium 1} {#VAR equilibrium 0};#IF %pos( p, %3) {#VAR prone 1} {#VAR prone 0};#IF (@healthbalance) {#IF (%1 < 40) {#VAR healthbalance 0;drink health} {#IF (%2 < 35) {#VAR healthbalance 0;drink mana}}}}
Since this is triggering on your prompt, you should probably find the trigger in the editor, and enable Trigger on Prompt on the Options tab.
LightBulb
Advanced Member |
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Wed Apr 09, 2003 2:25 am |
Thanks a mil, it works beautifully.
|
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Thu Apr 07, 2005 1:16 am |
ok, here is my prompt
H:303 M:392 E:1415 W:1862 <eb db>
I have it set to get balance from the prompt
e = equilibrium
b = balance
d = deafness
b = blindness
Thing is, when I have blindness it thinks I have balance as well. I was wondering if there was a way to fix that?
here is the relative code so you know what I got:
#IF %pos( b, %5) {#VAR balance 1} {#VAR balance 0}
#IF %pos( e, %5) {#VAR equilibrium 1} {#VAR equilibrium 0}
#IF %pos( p, %5) {#VAR prone 1} {#VAR prone 0}
#IF %pos( s, %5) {#VAR stunned 1} {#VAR stunned 0} |
|
_________________ When in doubt,
Blow it up. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Apr 07, 2005 11:34 pm |
What's the specific behavior of your effect string? Is it always 5 characters (ebsdb, using spaces for NOT effects--ie, e = equilibrium, space = no equilibrium), or does the length change when certain effects are not present? Do certain letters share positions (ie, p for prone might share with t for sitting, k for kneeling, etc)?
If you have a static length for this portion of the pattern, you could change your wildcard from (*) to the necessary number of (?) to isolate each position in the string. Then, all you'd have to do is test that one character. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Fri Apr 08, 2005 2:32 pm |
H:289 M:249 E:1300 W:849 <eb pdb>
These are the ones that I am aware of and can get. There is also S for stunned and F for flying.
How would I do what you suggested.?
My entire trigger is like this:
H:(%n) M:(%n) E:(%n) W:(%n) ~<(*)~>
#if (@prone AND @balance AND @equilibrium AND NOT @asleep AND NOT @stunned AND NOT @aeon) {stand}
#VAR hits %1
#VAR mana %2
#Var end %3
#VAR will %4
#IF %pos( b, %5) {#VAR balance 1} {#VAR balance 0}
#IF %pos( e, %5) {#VAR equilibrium 1} {#VAR equilibrium 0}
#IF %pos( p, %5) {#VAR prone 1} {#VAR prone 0}
#IF %pos( s, %5) {#VAR stunned 1} {#VAR stunned 0}
#IF (@healthbalance AND NOT @anorexia AND NOT @asleep AND NOT @aeon AND NOT @transfixed) {#IF (%1 < @minhealth) {#var healthbalance 0;drink health} {#IF (%2 < @minmana) {#var healthbalance 0;drink mana}}}} "" {nocr|prompt} |
|
_________________ When in doubt,
Blow it up. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sun Apr 10, 2005 3:26 am |
Here is a nudge in the right direction using %word to break apart EB and PSB Quote your strings for starters (while not always needed there are MANY times when it helps to have them quoted so why write sloppy code in the first place)
H:(%n) M:(%n) E:(%n) W:(%n) ~<(*)~>
#IF %pos( "b", %word(%5,1)) {#VAR balance 1} {#VAR balance 0} //in first word %5
#IF %pos( "e", %word(%5,1)) {#VAR equilibrium 1} {#VAR equilibrium 0}
#IF %pos( "p", %word(%5,2)) {#VAR prone 1} {#VAR prone 0} //in second word of %5
#IF %pos( "b", %word(%5,1)) {#VAR blind 1} {#VAR blind 0}
#IF %pos( "s", %word(%5,2)) {#VAR stunned 1} {#VAR stunned 0} |
|
|
|
Dagnimaer Wanderer
Joined: 05 Apr 2003 Posts: 60 Location: USA
|
Posted: Sun Apr 10, 2005 3:38 pm |
It looks like that did it. Thanks!
|
|
_________________ When in doubt,
Blow it up. |
|
|
|
Xhado Newbie
Joined: 11 Apr 2005 Posts: 2
|
Posted: Mon Apr 11, 2005 4:44 pm Making variables optional |
Sorry if this has already been covered. I glanced over a ton of posts but didn't see anything that fits what I need. I used this topic since it is already about Prompts, hope someone sees this and can help me out. I am new to scripting, and I need a trigger that fires on prompt, but makes certain variables optional. For example:
H:2367 M:3264 E:12400 W: 16300 B:100% [dbs e-]
H being health, M being mana, E being endurance, W being willpower, B being blood level, and everything inside '[ ]' showing certain defenses, and whether you have equilibrium or balance. I would like everything inside of '[ ]' to be optional, but make a difference if they are. For example: if the optional part says '[dbs e-]', I would like it to set the deaf, blind, and sileris variables to 1, as well as equilibrium to 0, and balance to 1. Also, since there is an optional defense missing (C - Cloak), I would like it to record cloak as being 0. Hope this is a clear enough problem to understand, and thanks to anyone that replies. |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Mon Apr 11, 2005 9:39 pm |
It is usually best to start a new topic, Secondly read the pattern matching help file. With just a FEW adjustments to you would have been able to write your own from this topic. (not it still might need some tweaks)
#TRIGGER "prompt" {H:(%d) M:(%d) E:(%d) W:(%d) B:(%d)~% ~[(*)~]} {
hp=%1
ma=%2
end=%3
will=%4
blood=%5
#IF %pos( "d", %word(%6,1)) {#VAR deaf 1} {#VAR deaf 0}
#IF %pos( "b", %word(%6,1)) {#VAR blind 1} {#VAR blind 0}
#IF %pos( "s", %word(%6,1)) {#VAR sileris 1} {#VAR sileris 0}
#IF %pos( "e", %word(%6,1)) {#VAR equilib 1} {#VAR equilib 0}
#IF %pos( "c", %word(%6,2)) {#VAR cloak 1} {#VAR cloak 0}
} {prompt|nocr} |
|
|
|
|
|