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


Joined: 06 Sep 2005
Posts: 11

PostPosted: Sat Oct 01, 2005 9:51 am   

Remote scripting error *SOLVED*
 
Ok first off I'm using zMud 7.20b on a SMAUG mud

Here is what I am attempting.
To be able to use characer "A" to say to character "B" copy (here would be the #TR #AL #VAR etc... you get the idea, if not it should become cleare soon.) and character "A" would create the trigger, aliase, variable told to copy.

Here is what I have so far.

You say 'copy #TR {&petitioner says 'blind'} {#IF (%ismember(@petitioner,@friendsList)) {cast 'cure blindness' @petitioner} {announcer}'

--------------------------------------------------------------------------
Here is what I have on the recieving character so far.
--------------------------------------------------------------------------
#CLASS {Remote}
#ALIAS announcer {'You do not have the authority to command me.}
#ALIAS acopy {#TR ~{&petitioner says 'blind'~} ~{#IF (%ismember(@petitioner,@friendsList)) ~{cast 'cure blindness' @petitioner~} ~{announcer~}}
#TRIGGER {&member says 'copy (%2)'} {#IF (%ismember( @member, @friendsList)) {#VERB 0;#AL acopy {%2};#VERB 1;#ALARM 1000;acopy} {announcer}}
#CLASS 0
-------------------------------------------------------------------------

Notice when the aliase "acopy" is created it contains ~ which I do NOT want leading me to believe the problem is with the patern matching in the trigger?

I tried it using a variable/alias combo as well with no luck. Sure its something simple and would appreciate a fresh pair of eye's to find the error in my script. Cool
_________________
Kill 1 man and your a murderer. Kill them all and your a GOD!

Last edited by nibbledeuce on Sat Oct 01, 2005 8:12 pm; edited 1 time in total
Reply with quote
Vodoc
Apprentice


Joined: 11 Apr 2003
Posts: 119
Location: Sweden

PostPosted: Sat Oct 01, 2005 1:58 pm   
 
You can use this code:
Code:
#CLASS {Remote}
#ALIAS announcer {'You do not have the authority to command me.}
#VAR friendsList {nibbledeuce}
#TRIGGER {&member says 'copy (%*)'} {#IF (%ismember( @member, @friendsList)) {#exe {"%2"}} {announcer}}
#CLASS 0

It will check for a valid user and then execute the received text just as if you had done it yourself. It will correctly create a trigger for this line:

nibbledeuce says 'copy #TR {&petitioner says 'blind'} {#IF (%ismember(@petitioner,@friendsList)) {cast 'cure blindness' @petitioner} {announcer}}'

Please not that this line differs from your test line in that this has an extra } at the end which you was missing.

Edit: Be very careful when using this script, since it will allow users to do anything with your settings and your pattern ain't anchored properly so it could be exploited. I suggest that you change the pattern to something a little bit safer like: ^&member says 'copy (%*)'$
Reply with quote
nibbledeuce
Beginner


Joined: 06 Sep 2005
Posts: 11

PostPosted: Sat Oct 01, 2005 8:11 pm   
 
Ah yes I knew I was missing something simple "}", and thanks for reminding me about pattern matching from the start with "^". I already had the friendsList but chose not to include it as I didn't want to create unneccesary clutter. I also changed it from says to tells to make it less public as well.
_________________
Kill 1 man and your a murderer. Kill them all and your a GOD!
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