|
Tygerhart Novice
Joined: 04 Oct 2001 Posts: 43 Location: Canada
|
Posted: Mon Dec 08, 2008 5:16 pm
Help with window alert |
Hi all;
Here's hoping someone can help me with this. It's been quite some time since I've MUDded and I've started to get back into it again. I used to use zMUD but recently I purchased cMUDpro. The problem for me is that I can't remember how do somethings in zMUD and I'm kind of leery about trying to write something in cMUD based on faulty memory of how zMUD worked.
Here's the problem;
"Anger" is a cool skill but is somewhat dangerous if you're not keeping track of it. It essentially gives you a random number boost to your HP and you can keep using the skill as long as your HP are below maximum. The drawback is that each health boost only lasts 2 minutes from each successful use of "Anger" and the HP increase that you recieved disappears, dropping your HP.
What I would like to create is a window that starts to flash when the successful "Anger" message is first displayed;
"The pain of your injuries seems to vanish as you focus your anger."
and I would like to keep a track of each successful use with a two minute timer in the same flashing window
example
1 Anger 2:00
2 Anger 1:36
3 Anger 0:45
4 Anger 0:00
When the following pops up;
"You feel the pain come back to you as your anger diminishes."
I would like it to clear the oldest instance of "Anger" in the window (In the example it would be 4 Anger 0:00).
When all instances of "Anger" have cleared, the following is sent by the MUD
"You feel the pain come back to you as the last of your anger leaves you."
What I would like to happen here is the window stops flashing and is blank.
Is this at all doable?
Can anyone help me out with this if it is?
Thank you for any help you can offer.
Tygerhart |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Dec 08, 2008 6:45 pm |
Doing this sort of notification is very possible. I don't know if a window would be the best way to go about it. Personally, I'd be much more comfortable just with some text that appears in the same place as the MUD text:
#trig {The pain of your injuries seems to vanish as you focus your anger.} {#say Anger 2:00;#alarm +30 {#say Anger 1:30};#alarm +60 {#say Anger 1:00};#alarm +90 {#say Anger 00:30};#alarm +110 {#say %ansi(red)ANGER EXPIRES IN 10 SECONDS}}
Or something similar. You might also get some milage out of using a button - you could do the flashing with that, too, if you like. What you'd do is similar to the above, but you store the time in a variable. So:
#trig {The pain of your injuries seems to vanish as you focus your anger.} {#var AngerTime 120;#alarm "Anger" 1 {#add AngerTime -1}}
Then you put the @AngerTime variable in a button caption (or on the status bar or in the status window, if you'd prefer) and it'll be updated each second. Getting the flashing to work is a bit harder; I'd use an alarm that calls the %btncol function every second to change the colour of the button. |
|
|
|
Tygerhart Novice
Joined: 04 Oct 2001 Posts: 43 Location: Canada
|
Posted: Mon Dec 08, 2008 6:59 pm |
The trigger works wonderfully! In fact I quite like not using the window now. heh
Can it be adapted a bit though?
You see, I can have multiple instances of "anger" running and each instance last two minutes. The way the trigger works at the moment, I hit "anger" and it starts the two minute timer. I hit "anger" again 3 seconds later and it resets the timer etc. Often I have to stack the "anger"s and I need to know how much time I have left on each one and when all the "anger" is gone.
Thanks Fang!
Tyger |
|
|
|
Tygerhart Novice
Joined: 04 Oct 2001 Posts: 43 Location: Canada
|
Posted: Mon Dec 08, 2008 7:02 pm |
Wait! scratch the last post it doesn't reset the timer. It makes seperate timers.
Ok. How's this then? With that going, I need to know how many instances of anger are active and when they're all gone.
Thanks again,
Tyger |
|
|
|
cazador Apprentice
Joined: 08 Dec 2005 Posts: 108
|
Posted: Mon Dec 08, 2008 8:53 pm |
create a var called anger, with reset of 0
#trig {The pain of your injuries seems to vanish as you focus your anger.} {#say Anger 2:00;@anger=@anger+1;#alarm +30 {#say Anger 1:30};#alarm +60 {#say Anger 1:00};#alarm +90 {#say Anger 00:30};#alarm +110 {#say %ansi(red)ANGER EXPIRES IN 10 SECONDS};$alarm +120 {@anger=@anger-1}
The @anger variable will contain the number of angers |
|
|
|
|
|