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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
GloWrm
Newbie


Joined: 16 Apr 2009
Posts: 4

PostPosted: Thu Apr 16, 2009 2:34 am   

#ALARM
 
I have an alarm that looks like this:

#ADDKEY AQ ReturningToQuestor 1
#ALARM {+2}
{
#IF ( @p.Position == "stand" )
{
do_Return
}
}

It's in a trigger. But it keeps giving me an error when it runs ERROR: Trigger "+2" fired but did not compile

do_Return is an alias that runs a command.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Thu Apr 16, 2009 4:13 am   
 
Although the syntax editor doesn't show it, you've an error in your spacing.

Code:
#ADDKEY AQ ReturningToQuestor 1
#ALARM {+2} {
  #IF ( @p.Position == "stand" )  {
  do_Return
  }
}


will work for you. The first bracket of the #if needs to be on the same line as the conditional statement
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Thu Apr 16, 2009 5:19 am   
 
wrym wrote:
The first bracket of the #if needs to be on the same line as the conditional statement

Nope, it doesn't need to. And, btw, original alarm code compiles for me normally. I guess it is a problem with @p.Position, may be %db should be used here instead of dot
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Apr 16, 2009 1:20 pm   
 
This compiles for me, too. GloWrm, could you enclose your actual code, preferably the XML version, within code tags so we can see what the actual code is?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Apr 16, 2009 4:43 pm   
 
The code above works fine for me too. If the code is within another trigger, please post the XML of the entire trigger. Go to the XML tab in the trigger editor and copy and paste it into this forum thread within [code] tags.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Thu Apr 16, 2009 6:16 pm   
 
as a test I abbreviated the code to this, which DOES compile:

Code:
<alias name="test" id="420">
  <value>#ALARM {10}
{
#IF (1)   
{
   jump
  }
}</value>
</alias>


that generates this alarm:

Code:
#IF (1){
   jump
  }


Which has no space between the conditional and the first set of brackets.
When i reformatted to:

Code:
<alias name="test" id="420">
  <value>#ALARM {10}
{
#IF (1) {
   jump
  }
}</value>
</alias>


The ALARM script compiles.

In glowrm's case his alarm is "+2" and thats the script thats not compiling, not the trigger script.
Reply with quote
GloWrm
Newbie


Joined: 16 Apr 2009
Posts: 4

PostPosted: Sat Apr 18, 2009 2:08 am   ERROR: Trigger "You receive %d experience points." fired but did not compile
 
(see next post for complete xml)
In my original post I created a script that would give the error with the smallest amount of code I could get away with and still receive the error. Below is more code where I am getting the problem.

This works ok, the trigger is fired two second and runs the do_Return alias.
Code:

<trigger priority="85100" id="8510">
  <pattern>You have almost completed your QUEST!</pattern>
  <value>#ADDKEY AQ ReturningToQuestor 1
#ALARM {+2} { do_Return }
</value>
</trigger>


But .... Below there is the script do_Return which has another #ALARM {+2} it's in the #TEMP trigger that is created
Code:




<alias name="do_Return" autoappend="true" id="139">
  <value>#IF (@p.Position != "fight")
{
    #IF (@p.Name == "Baccos")
    {
        escape
        #SEND "u"
        #SEND "s"
        #SEND "u"
        #SEND "e"
        #SEND "quest complete"
        #ABORT (1)
    }
    #IF (@p.Name == "Thad")
    {
        escape
        #SEND "recall"
        #SEND "u"
        #SEND "e"
        #SEND "quest complete"
        #ABORT (1)
    }
    {
        #SEND "recall"
        #SEND "u"
        #SEND "e"
        #SEND "quest complete"
    }
}
{
  #ECHO "CREATING TEMPORARY TRIGGER"
  #TEMP {You receive %d experience points.}
  {
    #ECHO "TEMP TRIGGER MATCH"
    #IF (@AQ.ReturningToQuestor)
    {
      #ALARM {+2} { do_Return }
    }
  }
}</value>
</alias>


Here is the escape alias incase you want it.
Code:

<alias name="escape" autoappend="true" id="109">
  <value>#if (@p.Name = "Baccos")
{
  #SEND "get portal air"
  #SEND "drop portal"
  #SEND "enter portal"
  #SEND "get portal"       
  #SEND "put portal air"
}
#if (@p.Name = "Thad")
{
  #SEND "get portal bag#
  #SEND "drop portal#
  #SEND "enter portal#
  #SEND "get portal#
  #SEND "put portal bag#
  #teleport {5564} {ImmZone}
}


</value>
</alias>



Here is the error message
ERROR: Trigger "You receive %d experience points." fired but did not compile

The AQ is a variable with a type of database record. It has Zone, ReturningToQuestor, Room, Mob, QuestType, Lost, Count, Destroom, FoundObj in it.


I think it's the same problem.


In case you want it the original XML code from the original. I deleted this one and recreated trying anything to get it to work (just in case the id is not the same as the one mentioned above).


Code:

<trigger priority="5590" id="559">
  <pattern>You have almost completed your QUEST!</pattern>
  <value>#ADDKEY AQ ReturningToQuestor 1
#ALARM {+2}
 {
   #if (@p.Position == "stand")
   {
     do_Return
   }
 }</value>
</trigger>


I am running cMud 2.37, but I ran the upgrade to the beta 3.05 thinking it might work in the beta but it does the same thing in both versions. I restored my computer back to cMud 2.37 because I didn't want to be on the beta.


Last edited by GloWrm on Sat Apr 18, 2009 4:02 am; edited 1 time in total
Reply with quote
GloWrm
Newbie


Joined: 16 Apr 2009
Posts: 4

PostPosted: Sat Apr 18, 2009 3:34 am   ERROR: Trigger "You receive %d experience points." fired but did not compile
 
Here is the problem with the specific aliases and triggers moved to a new session, then exported using the export xml menu option.

Just comment out the #ADDKEY p Position "fight" after you killed your quest mob to create the temporary trigger then find another mob to kill and you will get the error.

The temp trigger is actually created in the code, I didn't notice that before. It's at the bottom of the xml.



Code:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<window name="Dizzier">
  <uid>{A9E243E5-A63D-46C6-973B-2853DCF07069}</uid>
  <packages>English Keypad|English Directions|Dizzier</packages>
  <alias name="do_Return">
    <value>#ADDKEY p Position "fight"
#IF (@p.Position != "fight")
{
    #IF (@p.Name == "Baccos")
    {
        escape
        #SEND "u"
        #SEND "s"
        #SEND "u"
        #SEND "e"
        #SEND "quest complete"
        #ABORT (1)
    }
    #IF (@p.Name == "Thad")
    {
        escape
        #SEND "recall"
        #SEND "u"
        #SEND "e"
        #SEND "quest complete"
        #ABORT (1)
    }
    {
        #SEND "recall"
        #SEND "u"
        #SEND "e"
        #SEND "quest complete"
    }
}
{
  #ECHO "CREATING TEMPORARY TRIGGER"
  #TEMP {You receive %d experience points.}
  {
    #ECHO "TEMP TRIGGER MATCH"
    #IF (@AQ.ReturningToQuestor)
    {
      #ALARM {+2} { do_Return }
    }
  }
}</value>
  </alias>
  <var name="AQ" type="Record">Zone|ReturningToQuestor=1|Room|Mob|QuestType|Lost|Count|Destroom|FoundObj</var>
  <var name="p" type="Record">Position=fight|Name=Baccos</var>
  <alias name="escape">
    <value>#if (@p.Name = "Baccos")
{
  #SEND "get portal air"
  #SEND "drop portal"
  #SEND "enter portal"
  #SEND "get portal"       
  #SEND "put portal air"
}
#if (@p.Name = "Thad")
{
  #SEND "get portal bag#
  #SEND "drop portal#
  #SEND "enter portal#
  #SEND "get portal#
  #SEND "put portal bag#
  #teleport {5564} {ImmZone}
}
</value>
  </alias>
  <trigger priority="50">
    <pattern>You have almost completed your QUEST!</pattern>
    <value>#ADDKEY AQ ReturningToQuestor 1
#ALARM {+2} { do_Return }


</value>
  </trigger>
  <trigger priority="70">
    <pattern>You receive %d experience points.</pattern>
    <value>
    #ECHO "TEMP TRIGGER MATCH"
    #IF (@AQ.ReturningToQuestor){
      #ALARM {+2} { do_Return}
    }</value>
  </trigger>
</window>
</cmud>


Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Sun Apr 19, 2009 11:17 pm   
 
The #if statement in your temporary trigger, priority 70, has no space between the conditional, and the first set of brackets, that is where your error is.

3 options,

a) reformat your alias to get the temp trigger formatted correctly.
b) use a permanent trigger, I don't see any reason that you have to remake that trigger every time.
c) use a permanent alarm, and enable/disable it
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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