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
Darkwytch
Novice


Joined: 20 Feb 2004
Posts: 41
Location: USA

PostPosted: Tue Dec 28, 2004 8:49 am   

help me with a variable please
 
hi hi hi...

i just got though reading a post on this board that i so happened to need help with... although it seemed some what to help a bit it didnt excatly fit what what i needed..... the post is http://forums.zuggsoft.com/phpbb/viewtopic.php?t=19532


ok recently i posted on how to add a variable with the #add thing in part of my trigger and the help with it was wonderful, now i need help with something else kinda in the same department.... i think....

..... this is what it looks like.

%eval( %4+@thingiwannacount)

the %4 represents part of the trigger i want to count up to which begining of the trigger it has a

#add the%4partofmytrigger 1

what i was wondering how to do is this

1. a variable or something along that line where i can set the amount that will beable to count down each time the trigger is activated.

2. it needs to be able to be the correct amount each time i log on..

for instance.... say the trigger is this

Trigger
so and so gave you somuch of something.

how the numbers fit in
%1 and %2 gave you %3 of %4.

how it would look if i used a variable or something to subtract it each time trigger was activated?

variable = amounthere

%1 and %2 gave you %3 of %4 only need %eval(%4-@amounthere) more.

which should show in a window or something like

so and so gave you somuch of something only need newamountgoal more.

I dont know if im explaining what my mind has spinning around for this trigger... or that even the thing would be a variable. all i want is for some number or some equasion that i put in to be able to be counted down each time the trigger is activated and that it will remember it without me haveing to type in the amountgoal everytime i log on or use zmud... =\ please help me.... im not very good at this stuff but i try to learn as much as i can.... thank you all for taking the time to read this long post..
Reply with quote
Hibio
Beginner


Joined: 19 Mar 2004
Posts: 22

PostPosted: Tue Dec 28, 2004 2:08 pm   
 
First of, %eval is only to show, it doesn't really save the variable

example:
#var amount 100
%eval {@amount - 50} = this will show 50 on the screen, and the variable amount will still be 100


If you want to subtract the 50 from the amount. You will need to use the #math or #add

i.e.
#var amount 100
#add amount -50 = amount is now 50
#show @amount = this should show 50 on the screen


2) what do you mean by do correct amount?
Reply with quote
Darkwytch
Novice


Joined: 20 Feb 2004
Posts: 41
Location: USA

PostPosted: Tue Dec 28, 2004 7:34 pm   
 
Could someone show me some possible ways to use the #math part with this idea i have? i do wish it to count down each time the trigger is activated. different uses and various ways would be nice
Reply with quote
Hibio
Beginner


Joined: 19 Mar 2004
Posts: 22

PostPosted: Tue Dec 28, 2004 8:49 pm   
 
The zMUD help gives a very good example on how to use the #math function.
Reply with quote
Darkwytch
Novice


Joined: 20 Feb 2004
Posts: 41
Location: USA

PostPosted: Tue Dec 28, 2004 9:09 pm   
 
yes i have read the help file on the #math thing... but it doesnt give me enought examples =\
Reply with quote
Hibio
Beginner


Joined: 19 Mar 2004
Posts: 22

PostPosted: Tue Dec 28, 2004 9:41 pm   
 
i.e.

1) #math mvp (@xp_cur / (%3 + (24 * (%2 + (%1 * 7)))))

2) #math mp_per (@mp_cur*100/@mp_max)

3) #math tick (@tick + 1)

Is this enough? multiplication/division/addition/subtraction are all here
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