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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Tue Jul 24, 2012 11:21 pm   

Where is the "syntax checking error" in this trigger?
 
1st, this trigger works, but I'm kinda anal about seeing "^ syntax error" :P

Pattern:
Code:

^You are charged %d gold clan skill tax.$

Valuse:
Code:

#IF (@seek_mob_base_level <= 49) {target_range = "1-49"}
#IF ((@seek_mob_base_level >= 50) AND (@mob_base_level <= 99)) {target_range = "50-99"}
#IF ((@seek_mob_base_level >= 100) AND (@mob_base_level <= 150)) {target_range = "100-150"}
#IF ((@seek_mob_base_level >= 151) AND (@mob_base_level <= 199)) {target_range = "150-200"}
#IF (@seek_mob_base_level > 200) {target_range = "201"}
#IF (@debug) {#SHOW {~#TRIGGER ~{%expand(@target_description)~} ~{~#IF ~(~(~%zonenum~(~) %char(61) %eval(%zonenum)~) ~AND ~(~@current_level ~> %eval(@seek_mob_base_level - 22)~)~) ~{~#SUBSTITUTE ~{%expand(@seek_mob_short_name) ~%ansi~(~brown~)%if(@seek_align = good,G,E) ~%ansi~(blue~)%eval(@seek_mob_base_level)~}~;%if(@seek_align = good,good_target,evil_target) ~= %expand(@seek_target)~;auto_web %char(61) no~} ~{~#IF ~(~%zonenum~(~) %char(61) %eval(%zonenum)~) ~{~#SUBSTITUTE ~{~%ansi~(grey~)%expand(@seek_mob_short_name) ~%ansi~(brown~)%if(@seek_align = good,G,E) ~%ansi~(blue~)200~}~}~}~} ~{Auto|target|@target_range|@area_keyword%if(@seek_align = good,,|evil)~}}}
#EXEC {#TRIGGER {%expand(@target_description)} {~#IF ~(~(~%zonenum~(~) %char(61) %eval(%zonenum)~) ~AND ~(~@current_level ~> %eval(@seek_mob_base_level - 22)~)~) ~{~#SUBSTITUTE ~{%expand(@seek_mob_short_name) ~%ansi~(~brown~)%if(@seek_align = good,G,E) ~%ansi~(blue~)%eval(@seek_mob_base_level)~}~;%if(@seek_align = good,good_target,evil_target) ~= %expand(@seek_target)~;auto_web %char(61) no~} ~{~#IF ~(~%zonenum~(~) %char(61) %eval(%zonenum)~) ~{~#SUBSTITUTE ~{~%ansi~(grey~)%expand(@seek_mob_short_name) ~%ansi~(brown~)%if(@seek_align = good,G,E) ~%ansi~(blue~)200~}~}~}} {Auto|target|@target_range|@area_keyword%if(@seek_align = good,,|evil)}}
#CLASS {Auto|target|add|support} 0


error:
Code:

#EXEC {#TRIGGER {%expand(@target_description)} {~#IF ~(~(~%zonenum~(~) %char(61
                ^ syntax error


Why is it complaining? What do I change/add?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Wed Jul 25, 2012 8:32 am   
 
no closing curly brackets

Why do you have so many of the special characters escaped out anyway?
_________________
Discord: Shalimarwildcat
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sat Jul 28, 2012 7:12 am   
 
all brackets & braces {curly brackets} are accounted for... if you #EXEC the statement it creates a flwless trigger, if it were missing a brace/bracket it would not create the trigger correctly.

Prolly not everything is required to be a %char() or escaped, but much of that is so it is not expanded when the alias creates the trigger.

The following SIMPLE but unreleated alias would show the exact same syntax parsing error...
#CLASS {testing} {disable}
#ALIAS make_it {#EXEC{#TRIGGER {you are @here} {do something}}}
#VARIABLE here {123}
#TRIGGER {you are 123} {do something}
#CLASS 0

Notice belowthe trigger was created with @here... with the syntax error above, it works properly...
#CLASS {testing} {disable}
#ALIAS make_it {#TRIGGER {you are @here} {do something}}
#VARIABLE here {456}
#TRIGGER {you are @here} {do something}
#CLASS 0

Now i know i could create that without the exec and make it work, it is a simple example to show it aint a missing brace. The trigger I am makeing with my alias needs some things evaluated and other things passed as they are, #EXEC lets this happen and he escaping keeps it from happening where needed.

edit:
Here is the result of having debug=1 last time i used the alias...
#TRIGGER {A rat is here, packing things away in a suitcase.} {#IF ((%zonenum() = 179) AND (@current_level > 188)) {#SUBSTITUTE {The Archivist %ansi(brown)E %ansi(blue)210};evil_target = Pack;auto_web = no} {#IF (%zonenum() = 179) {#SUBSTITUTE {%ansi(grey)The Archivist %ansi(brown)E %ansi(blue)200}}}} {Auto|target|150-200|dunoir|evil}

Loaded in ultraedit and formatted for brace/bracket matching
Code:

#TRIGGER {
           A rat is here, packing things away in a suitcase.
           }
      {
         #if ((%zonenum() = 179) AND (@current_level > 188))
         {#SUBSTITUTE {
                        The Archivist %ansi(brown)E %ansi(blue)210
                        }
       ;evil_target = Pack
       ;auto_web = no
       }
       {
        #IF (%zonenum() = 179)
        {
           #SUBSTITUTE {%ansi(grey)The Archivist %ansi(brown)E %ansi(blue)200
           }
           }
       }
       } {Auto|target|150-200|dunoir|evil}



I count 8 {'s and 8 }'s in the parsed/created/error free trigger...
Reply with quote
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Wed Nov 14, 2012 10:43 am   
 
I remember using #exec in a similar fashion (the error syntax changes annoy me too), along with sending commands to other windows, and also putting values into variables. I always assumed I was doing something wrong, but I don't know, only ways I could get some things to work... I wonder what I was doing wrong.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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