|
Pete Fry Newbie
Joined: 04 Jun 2007 Posts: 2
|
Posted: Mon Jun 11, 2007 10:39 am
using variables in triggers...... |
ok i'm a bit of a new zmud user but her is what i'm trying to do
i've got a trigger than does #add number 1
and this trigger works i.e. when the trigger "triggers" 1 is added to the variable number.... nice and simple
but what i want to do is this a trigger that does the following
exa @number.monster
i.e. so if number is 2 it will send the following to the mud
exa 2.monster
the only way i can get this to work atm is use if statements
if {@number=1} {exa 1.monster)
etc etc
so i have to have multi if statements to get this to work
is there a way of it just doing
exa @number.monster
thanks for the help and sorry if this is a vew newbie question |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Jun 11, 2007 10:46 am |
When you refer to the value of a database record variable in zMUD, you use the syntax @Variable.Key - zMUD thinks you mean that when you tell it to do @number.monster. You have a couple of options to make sure zMUD gets it right:
@{number}.monster
%concat(@number,".monster") |
|
|
|
Pete Fry Newbie
Joined: 04 Jun 2007 Posts: 2
|
Posted: Mon Jun 11, 2007 11:13 am |
thats great thanks i didn't realise that, that makes the scripts alot less complex!!
thanks alot for you help |
|
|
|
|
|