Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
wmiller8
Newbie


Joined: 01 Mar 2009
Posts: 3

PostPosted: Mon Mar 23, 2009 11:50 pm   

Stumped, Again!
 
So... Not sure how to do something here... i need to make it so that IF a certain variable goes below an amount, i execute a series of actions. My apologies if the answer is simple and i've missed it, but that's be all the better. Basically, what I'm out to do is set it so that if a i drop below 100 hp or so i flee and gate to my secret hiding hole.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Tue Mar 24, 2009 2:01 am   
 
Well that is simple. How are you assigning the value to the variable? You need to provide more information. Are you doing it on your prompt or what? Just put in an #if statement just like you say. #if (@health < 100) {stop doing everything and flee to secret hiding hole}.
Reply with quote
wmiller8
Newbie


Joined: 01 Mar 2009
Posts: 3

PostPosted: Tue Mar 24, 2009 2:04 am   
 
Taking it from the prompt, The variable is entitled hp

That gets me a lot closer... is it possible to make nullifying triggers part of that with the #t- command?
Reply with quote
Leitia
Adept


Joined: 04 May 2007
Posts: 292
Location: Boston

PostPosted: Tue Mar 24, 2009 2:57 am   
 
#if (@hp < 100 && @berserk < 1) {flee to secret hiding hole} {#exec badass;#var berserk 0}
#al badass {some pwn}
#al stay {#var berserk 1}

fight
fight
you type stay
fight some pwn

else

you chicken you

Edit: That should nullify it, I assumed you just wanted control since you had practically answered your own question, to use #T- or #T+ from triggers just follow the Help about IDs. The second section's {#exec badass;} is not needed but you could put a message there so you know the trigger is working as expected. The semicolon breaks the command line into two commands.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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