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


Joined: 23 Jun 2003
Posts: 3
Location: Hungary

PostPosted: Mon Sep 08, 2003 1:34 pm   

Dynamic variables
 
Hi!

I've run into problems with the following case.

I tried to make a trigger to count the improves on skills.
This is quite easy, but i've problems with multiple words.

For example:

skill: two-handed weapons

Sample text: It seems you have improved your two-handed weapons skill!

Because i could not create a multi-word variable, i changed the " " chars with _ .

The trigger is the following:

#TR {It seems you have improved your %0 skill!} {do something}

I tried to do the thing with %subchar( "%0", " ", _) but i don't know how can i make the output of the subchar function to a variable name, then add 1 to the variable's value.

Any help appreciated.Smile
Reply with quote
zelin
Newbie


Joined: 23 Jun 2003
Posts: 3
Location: Hungary

PostPosted: Mon Sep 08, 2003 2:40 pm   
 
My apologies, i didn't look carefully enough, this is the solution for the problem:

#MATH @{%subchar( "%1", " ", _)} {%number( @{%subchar( "%1", " ", _)}) + 1}

I forgot the %0 - %1 problem :)
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