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
Cuthalion
Beginner


Joined: 29 Jun 2003
Posts: 18
Location: USA

PostPosted: Tue Jul 08, 2003 3:46 am   

Syntax error?
 
This is what I scripted...
#CLASS {Team}
#ALIAS teamhealth
#VA %1HP 11 11 Team
#TRIGGER {^%1*death's door} {#VAR %1HP 1}
#TRIGGER {^%1*barely alive} {#VAR %1HP 2}
#TRIGGER {^%1*terribly hurt} {#VAR %1HP 3}
#TRIGGER {^%1*very bad shape} {#VAR %1HP 4}
#TRIGGER {^%1*in a bad shape} {#VAR %1HP 5}
#TRIGGER {^%1*very hurt} {#VAR %1HP 6}
#TRIGGER {^%1*feeling rather hurt} {#VAR %1HP 7}
#TRIGGER {^%1*physically hurt} {#VAR %1HP 8}
#TRIGGER {^%1*somewhat hurt} {#VAR %1HP 9}
#TRIGGER {^%1*slightly hurt} {#VAR %1HP 10}
#TRIGGER {^%1*physically feeling very well} {#VAR %1HP 11}
#CLASS 0

This is what happens as soon as I save it...
#CLASS {Team} {setdef}
#ALIAS teamhealth {{#VA}
#ALIAS teamhealth {{#VA}
^ syntax error

Why? How do I fix it?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Jul 08, 2003 4:04 am   
 
Ok, first is a typical newbie mistake and probably has no effect on the problem. You need to avoid using %1...%99 in triggers.

Second, you need to explain this part:

quote:

#ALIAS teamhealth
#VA %1HP 11 11 Team



I assume this is a typo, but the #ALIAS command needs a code-block and code to execute (the code-block is defined by the curly braces):

#alias Name {code to execute}

As for the #variable command, you can indeed use parameter placeholders (%1...%99) in the name, but they aren't very useful unless the command is contained within something that accepts arguments--such as an alias. In that vein, I suppose what you were wanting to do on that line is:

#alias teamhealth {#variable %1hp 11 11 Team}

Unless there's more code you're holding back, I don't see anything else that's syntactically wrong with your code.
Reply with quote
Cuthalion
Beginner


Joined: 29 Jun 2003
Posts: 18
Location: USA

PostPosted: Tue Jul 08, 2003 5:58 am   
 
That is what i tried to do. I made the class. Put the alias in it. Then I put the rest of the script in the alias. I think my mistake was in The class script when I was double checking, I backspaced out a return I didnt aesthetically like. The script had the alias tabbed in and the variable line tabbed in from the alias. By backspacing out the tabs it no longer follows does it? Dumb mistake but thanks for helping me see it. BTW I am not sure about the alias. It is the first way I thought of getting the trigger to work. I input "teamhealth (name)" and I get back script written for that name. Eventually I need the trigger to use the name in this line...
^(name) joins your team. and write a hp script for them. Then my fun will really start as I try to figure out how to get rid of the new script whenever I get the lines...
^(name) leaves your team.
or
^You force (name) to leave your team.
Otherwise not only will I keep getting more and more script but if anyone rejoins me, I will get their script all over again along with another button.Not asking anyone to write it...just explaining myself so others can play with idea.
Thanks
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jul 08, 2003 3:58 pm   
 
Something along these lines might work better.
#CLASS {Team}
#ALIAS teamhealth {#IF (%numparam() > 0) {#ADDI Team {%1};#ADDK TeamHealth {%1} {11}}}
#TRIGGER {^({@Team}) * death's door} {#ADDK TeamHealth {%1} 1}
#TRIGGER {^({@Team}) * barely alive} {#ADDK TeamHealth {%1} 2}
#TRIGGER {^({@Team}) * terribly hurt} {#ADDK TeamHealth {%1} 3}
#TRIGGER {^({@Team}) * very bad shape} {#ADDK TeamHealth {%1} 4}
#TRIGGER {^({@Team}) * bad shape} {#ADDK TeamHealth {%1} 5}
#TRIGGER {^({@Team}) * very hurt} {#ADDK TeamHealth {%1} 6}
#TRIGGER {^({@Team}) * feeling rather hurt} {#ADDK TeamHealth {%1} 7}
#TRIGGER {^%1*physically hurt} {#ADDK TeamHealth {%1} 8}
#TRIGGER {^({@Team}) * somewhat hurt} {#ADDK TeamHealth {%1} 9}
#TRIGGER {^({@Team}) * slightly hurt} {#ADDK TeamHealth {%1} 10}
#TRIGGER {^({@Team}) * physically feeling very well} {#ADDK TeamHealth {%1} 11}
#ALIAS unteam {#IF (%numparam() > 0) {#DELI Team {%1};#DELK TeamHealth {%1}}}
#CLASS 0

#ADDITEM and #ADDKEY don't allow duplicates so it won't matter if you add someone twice. You can easily remove them though with something like the Unteam alias I provided.
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