Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Ambelghan
Novice


Joined: 04 Apr 2010
Posts: 49

PostPosted: Fri Aug 20, 2010 8:00 am   

3.22a Triggers that detect my prompt, will sometimes eat it in DragonRealms
 
Here's the code:
Code:
- <cmud>
- <trigger name="AutoAssess" priority="25410">
  <pattern>You assess your combat situation...</pattern>
  <value>CombatAssessment = ""</value>
- <trigger>
  <pattern>^$</pattern>
  <value>#STATE 2</value>
  </trigger>
- <trigger prompt="true">
  <pattern>^(*)$</pattern>
  <value>#IF (%begins(%1,">") OR %begins(%1,"(You are also defending against") OR %numwords(@CombatAssessment,"|") > 4) { #IF (%begins(%item(@CombatAssessment,1),"You")) { #ECHO Attack #T- AutoCombat #BU attackButton {0} } { #IF (@CombatAssessment = "") { #ECHO waiting on creatures #T+ NoImmediateCreature } { #ECHO Face and engage face next eng } } #STATE 0 } { CombatAssessment = %additem(%1,@CombatAssessment) #STATE 2 }</value>
  </trigger>
  </trigger>
  </cmud>
trigger state
Code:
<trigger>
  <pattern>^$</pattern>
  <value>#STATE 2</value>
</trigger>
trigger state
Code:
<trigger prompt="true">
  <pattern>^(*)$</pattern>
  <value>#IF (%begins(%1,">") OR %begins(%1,"(You are also defending against") OR %numwords(@CombatAssessment,"|") > 4)
{
 
  #IF (%begins(%item(@CombatAssessment,1),"You"))
  {
    #ECHO Attack
    #T- AutoCombat
    #BU attackButton {0}
  }
  {
    #IF (@CombatAssessment = "")
    {
      #ECHO waiting on creatures
      #T+ NoImmediateCreature
    }
    {
      #ECHO Face and engage
      face next
      eng
    }
  }
  #STATE 0
}
{
  CombatAssessment = %additem(%1,@CombatAssessment)
  #STATE 2
}
</value>
</trigger>


When my character is done looting something it is suppose to do an assessment of the area, three things will happen: Something will be facing it, attack it, something might be around it, face it and attack or, or nothing is around, wait for some creatures to show and then attack them. Here's an example.
Quote:
CorpseLooterDone
ass
>
You assess your combat situation...

A kra'hei hatchling (1: solidly balanced) is flanking you at melee range.

(You are also defending against a kra'hei hatchling.)
Face and engage
face next
eng
>
You turn to face a kra'hei hatchling.
>
You are already at melee with a kra'hei hatchling.


Every now and then this will happen:
Quote:
CorpseLooterDone
ass
>
You assess your combat situation...

A kra'hei hatchling (1: nimbly balanced) is behind you at melee range.
> Face and engage
face next
eng
You turn to face a kra'hei hatchling.
You are already at melee with a kra'hei hatchling.


It eats my prompt, which messes up the trigger when it comes around again, anyone have any idea why this is happening?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Aug 20, 2010 9:34 pm   
 
Another part of your code is probably doing a #gag or #sub on something you didn't expect to match. There's nothing in what you posted that would modify lines, much less hide them.
_________________
EDIT: I didn't like my old signature
Reply with quote
Ambelghan
Novice


Joined: 04 Apr 2010
Posts: 49

PostPosted: Mon Aug 23, 2010 8:57 am   
 
Ok in the last trigger state, I checked off the check box "Trigger on prompt" it basically picks up the prompt only so I know that there is nothing else around me. However, this check box appears to be eating my prompt, so it never appears again, whenever it appears on its own. When I remove the check mark the prompt disappearing event no longer occurs. This didn't use to happen before 3.22a.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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