 |
tatsuke Newbie
Joined: 04 Apr 2007 Posts: 4
|
Posted: 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? |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
 |
tatsuke Newbie
Joined: 04 Apr 2007 Posts: 4
|
Posted: Wed Apr 04, 2007 7:10 pm |
Going to give the list thing a try.
Thanks for the fast reply. |
|
|
|
 |
tatsuke Newbie
Joined: 04 Apr 2007 Posts: 4
|
Posted: 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. |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
 |
tatsuke Newbie
Joined: 04 Apr 2007 Posts: 4
|
Posted: Wed Apr 04, 2007 7:55 pm |
That's the stuff!
Thanks a lot, really appreciated.
I'm really digging cMUD. |
|
|
|
 |
|
|
|