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


Joined: 26 Oct 2011
Posts: 1
Location: Australia

PostPosted: Wed Oct 26, 2011 8:05 am   

Coding help
 
I've been trying to figure this out for about an hour and a half now without any luck.

My alias is like this:
#if (@herb_bal=1 and @stupidity=1) {outc goldenseal;outc goldenseal;outc goldenseal;eat goldenseal;inc goldenseal;inc goldenseal;eat goldenseal;eat goldenseal;herb_bal=.5};#if (@herb_bal=1) {outc goldenseal;eat goldenseal;herb_bal=.5};#alarm {+1.75} {#if (@herb_bal==".5") {herb_bal=1}}

I'm having a problem when I encounter multiple affs because my Alarm keeps overriding my curing for the second affliction. I want to know, how do I get my alarm to reset each time I try to use the alias? For example:

I hit the alias, it sets herb_bal to .5.
I eat the herb, setting herb_bal to 0
I regain herb balance, setting herb_bal to 1
I hit another alias, setting herb_bal to .5 (and a new alarm)
While this alias is going through, my other alarm goes off. Setting herb_bal to 1.
I try to eat again because my system thinks it has herb balance.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4686
Location: Pensacola, FL, USA

PostPosted: Wed Oct 26, 2011 12:24 pm   
 
Well... is the alias the only way to reset the variable value?
Perhaps it should be changed via trigger instead, so the variable always has the right value and you can avoid this coding pileup.
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Oct 26, 2011 3:05 pm   
 
Is there any clue from the mud about what your herb_bal is in-game? If so, then Shalimar's suggestion of a trigger to reset the herb_bal is the best.

If there is no clue from the mud, and you have to do it by timing, then perhaps the best solution is to give your alarm a name id. Then you can place the #ALARM command at the beginning of the alias so that it will change the alarm time of the named alarm before it can accidentally go off in the middle of your alias.
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