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
Pete Fry
Newbie


Joined: 04 Jun 2007
Posts: 2

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


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

PostPosted: 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")
_________________
Rorso's syntax colouriser.

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


Joined: 04 Jun 2007
Posts: 2

PostPosted: 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
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