|
Murphy2868 Newbie
Joined: 15 Aug 2007 Posts: 4
|
Posted: Wed Aug 15, 2007 7:22 am
Having some trouble with double-firing and alarms shorter than 1 second (luster) |
Hey guys. I've been working on this all day. Cmud keep doublefiring my focus trigger, i only want it to fire once but it'll always fire twice when i cure off the prompt.
Here's the code for my prompt trigger.
pattern: ^(¤tHp)h, (¤tMana)m, (¤tEgo)e, (¤tPower)p (&prompt)<>-
Code: |
#IF (@currentHp != 0) {
#if (@failSafe = 0) {
#execute @lastcure~off
failSafe = 1
}
lastPower = @currentPower
affCure = 0
lastCure = 'none'
#IF (%pos( x, @prompt) AND %pos( l, @prompt) AND %pos( r, @prompt)) {balance = 1} {balance = 0}
#If (@checkEpilepsy) {#IF (!(%pos( x, prompt))) {epilepsy = 0}
epilepsy = 0}
#if %pos( e, @prompt) {equilibrium = 1} {equilibrium = 0}
#if %pos( k, @prompt) {kafe = 1} {kafe = 0}
#if %pos( b, @prompt) {blind = 1} {blind = 0}
#if %pos( d, @prompt) {deaf = 1} {deaf = 0}
#IF %pos( p, @prompt) {prone = 1} {
stunned = 0
entangled = 0
roped = 0
shackled = 0
sprawled = 0
paralysis = 0}
#If (!@aeon AND !@sap AND !@stunned AND !@pause)
#If ((@autoParry = 1) AND (@needStance = 1) AND (@balance = 1) AND (@equilibrium = 1)) {doguard}
#if (@currentHp = @maxHp and @currentMana = @maxMana AND @currentEgo = @maxEgo AND (@currentPower = 10 AND @lastPower < 9)) {reckless = 1} {
reckless = 0
}
doSip
doHerb
doBal
doGeneral
doSalve
doFocus
doElixir
knight = 0
doubleWounds = 0
doneDeepAdd = 0
#t- diagnosis
#if (@bashing = 0) {#t- poisons}
#if %ismember( timing, @mechanics) {#sayp {--/%time( hh:mm:ss.zzz)"/ "}}}
;prompt |
Now when i get say, paralysed. It sets paralysis = 1 and then next prompt will fire dofocus that looks like this
DoFocus
Code: |
#if (!@asleep AND !@stunned AND !@pause AND !@aeon AND !@sap AND @focusBal AND !@doneFocus) {
#If ((@paralysis OR @leglock OR @throatlock) AND !@impatience AND @currentMana > 250 AND !@doneFocus) {fb
doneFocus = 1
#alarm "focusing" +1.5 {doneFocus = 0}} {
#IF (@currentMana > %eval( @maxMana/2+500)) {
#if (@stupid OR @confusion OR @epilepsy OR @weakness OR @vertigo OR @dizziness OR @agoraphobia OR @claustrophobia OR @impatience) {fm}}}} |
It'll then fire FB alias which is just a straight 'focus body' command.
Now with the doneFocus business, basically what happens is the system will try to focus body once, then every subsequent attempt won't fire for another 1.5 seconds (that's what the alarm is for)
What's happening is i get paralysed, and it's outputting two 'focus body' commands, which technically should be impossible
It's happening a lot on my other prompt triggers too. It doesn't happen however, if i just run a constant alarm and get paralysed like this
#ALARM (*1) {doprompt} where doprompt runs all the do aliases you see in the prompt trigger.
Then get paralysed, it'll only fire once, even if i spam doprompt in the command line as it's getting done. I'm stumped, any ideas? |
|
|
|
Arminas Wizard
Joined: 11 Jul 2002 Posts: 1265 Location: USA
|
Posted: Wed Aug 15, 2007 1:21 pm |
Have you tried all of this out in a blank session yet?
The first thing that comes to mind after looking at all that is, "Is there another trigger somewhere firing and sending focus body?"
Sorry, but at the moment I don't see anything wrong that should be sending the command twice from a cursory glance at the above code. |
|
_________________ Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram |
|
|
|
forren Novice
Joined: 26 Apr 2007 Posts: 44
|
Posted: Wed Aug 15, 2007 1:44 pm |
Try seeing if it happens when prompt is just set as prompt instead of prompt+newline. Don't know why this would be happening though, since you set the doneFocus variable.
Also a problem with your script Murph -
#If (@checkEpilepsy) {#IF (!(%pos( x, prompt))) {epilepsy = 0}
epilepsy = 0}
Epilepsy can be had without balance loss. |
|
|
|
Murphy2868 Newbie
Joined: 15 Aug 2007 Posts: 4
|
Posted: Wed Aug 15, 2007 3:32 pm |
Yeah the problem was i had the trigger set to trigger on prompt.
And the checkEpilepsy is set to 1 when i get the epilepsy balance loss message. Stops illusions. |
|
|
|
|
|
|
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
|
|