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
FiendishX
Wanderer


Joined: 19 Nov 2005
Posts: 53

PostPosted: Sat Apr 12, 2008 2:54 pm   

broken syntax checker
 
Is there a reason why the syntax checker chokes on the following line?
Code:
#EXEC {#ALARM %concat(%1,%time( "hhnnsszzz")) +6 {#SHOW %1 @response_string}}


The script works as intended, it's just really annoying to lose syntax highlighting for the whole script because of that one line that is only necessary because zMUD doesn't know how to make variable name alarms.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Apr 12, 2008 7:01 pm   
 
You should be able to re-write it to this and not kill the syntax checker.
Code:
#EXEC {%concat("#ALARM ",%1,%time( "hhnnsszzz")," {+6} {#SHOW {",%1," @response_string}}")}

I was only able to test this in CMUD though so it still may not work.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
FiendishX
Wanderer


Joined: 19 Nov 2005
Posts: 53

PostPosted: Sat Apr 12, 2008 7:24 pm   
 
Arminas wrote:
You should be able to re-write it to this and not kill the syntax checker.
Code:
#EXEC {%concat("#ALARM ",%1,%time( "hhnnsszzz")," {+6} {#SHOW {",%1," @response_string}}")}

I was only able to test this in CMUD though so it still may not work.

Well that actually does not work properly. It fixes the syntax checker but breaks the function of that line of the script slightly. The whole reason for having the variable name is that otherwise if the trigger happens in rapid succession it sends the second response twice (the response string changes each time) instead of both the first and second responses.

Your suggestion did not accomplish sending both first and second responses for some reason.
This does work, however:

Code:
#EXECUTE {%concat( "#ALARM ", %1, %time( "hhnnsszzz"), " +6 {#SHOW ", %1, " ", @response_string, "}")}


So thanks for the idea anyway.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Apr 13, 2008 5:47 pm   
 
It's ou an uncommon problem; there're various situations where this can happen. You'll find that this command probably won't export to text properly, which is part of the reason why cmud's checker uses the parser itself and why it exports to xml.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
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