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
tatsuke
Newbie


Joined: 04 Apr 2007
Posts: 4

PostPosted: Wed Apr 04, 2007 6:54 pm   

Question from zMUD to cMUD
 
Hey guys,

I have a very newbish question. I'm testing out cMUD, and want to make sure I can figure everything out before I buy it.

Anyway, when I transferred over my scripts, one of the things that is no longer working is my KOS trigger.

In zMUD, it was:

*({@kosv1|@kosv2|@kosv3|@kosv4|@kosv5})*has arrived.

Which would trigger kill %1.

When I remove the brackets in cMUD, I can get it to trigger, but it triggers with no space. For example, it would trigger killPlayer, instead of kill Player.

Obviously, it's the "%1" that's causing this, but I'm not sure what should go there. Help me out?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Apr 04, 2007 7:03 pm   
 
I removed the * before the pattern (since it isn't needed) and this script started working fine. It may have been a problem with the variables in question being undefined though.

One possible improvement, in case you're interested, that'll get around that undefined problem and also let you have as many KoS entries as you like is to change your KoS variable to a string list and the trigger to:

#trig {({@KoSList})* has arrived.} {kill %1}

and then use #additem and #delitem to edit your list.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
tatsuke
Newbie


Joined: 04 Apr 2007
Posts: 4

PostPosted: Wed Apr 04, 2007 7:10 pm   
 
Going to give the list thing a try.

Thanks for the fast reply.
Reply with quote
tatsuke
Newbie


Joined: 04 Apr 2007
Posts: 4

PostPosted: Wed Apr 04, 2007 7:37 pm   
 
Ok, I think I've found where the "no space" thing has come from.

I tested out the list trigger, and it seemed to work. However, when I changed 'kill %1' to '@killcmd %1' (where the killcmd is simply what command I want to use to kill), the program triggers:

killPlayerA rather than kill PlayerA.

I guess I should have posted that initially, just assumed it was not the problem.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Wed Apr 04, 2007 7:49 pm   
 
Yes, that would cause this problem because you haven't actually told CMUD what to do with the returned value of @killcmd. Change it to "#exec @killcmd %1" and all will be well.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
tatsuke
Newbie


Joined: 04 Apr 2007
Posts: 4

PostPosted: Wed Apr 04, 2007 7:55 pm   
 
That's the stuff!

Thanks a lot, really appreciated.

I'm really digging cMUD.
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