|
Cronos Novice
Joined: 06 Sep 2004 Posts: 30
|
Posted: Mon Sep 06, 2004 8:53 pm
Experience Gained Trigger |
My mud doesn't show how much experience you gain after a kill. Right now I have to type score which tell me my exp and then after a kill I type score again and do the math to figure it out. Is it possible to create a trigger of some sort so that it tells me the experienced gained after each fight?
This is the format of what I see when I type score.
You have 83873 experience.
How can I turn it into a trigger of some type so it tells me the experienced gained after each fight?
Thanks in advance. |
|
|
|
geniusclown Magician
Joined: 23 Apr 2003 Posts: 358 Location: USA
|
Posted: Tue Sep 07, 2004 12:38 am |
Is there a single string that you always get when you kill a critter? If so, it should be relatively easy:
Quote: |
#TR {The mob is dead!} {score} |
If you want to see what the gain was, then you can add a second trigger:
Quote: |
#TR {^You have (%d) experience.$} {#SHOW You gained %eval(%1-@experience)!;experience=%1} |
Perhaps you only want it to calculate when you kill a mob, and only display your increase, then you could do a multistate trigger:
Quote: |
#TR {The mob is dead!} {score}
#COND {^You have (%d) experience.$} {
#GAG
#SHOW You gain %eval(%1-@experience)!
experience=%1
} |
|
|
_________________ .geniusclown |
|
|
|
Cronos Novice
Joined: 06 Sep 2004 Posts: 30
|
Posted: Tue Sep 07, 2004 1:42 am |
Thanks, it worked great.
Just another question though.
The "Tick Timer" under the Actions -> Tick Timer...Is it possible to turn that into a button? Basically I want a button I can turn on and off where if it's on, it does a command every x seconds and if it's off, it stops doing that command.
Thanks |
|
|
|
Falan Wanderer
Joined: 17 Aug 2004 Posts: 98 Location: OK, USA
|
Posted: Tue Sep 07, 2004 5:44 am |
You can put commands in the tick timer's Timeout Command field. See "tick timer dialog" in the Help Files. See also, "#TIMER".
See "Introduction to Buttons" in the Help Files for info on creating buttons. I think using the Settings Editor is the easiest way to make buttons. See, "Settings" and "Buttons" for more info.
You could create a push button to send the #TIMER command each time the button is pressed. A toggle button would do the same and also allow you to change the button Caption (e.g. make it show On/Off). Since the tick timer is limited to one time and group of commands, you could create various toggle buttons to create alarms, like
#ALARM "AlarmName" {hh:mm:ss} {command}
when the button is turned On, and turns off the #ALARM when the button is turned off,
#T- AlarmName
Buttons have lots of options and are very useful. Experiment with some dummy commands that won't interfere with others on your Mud and have fun! (I say that because it can be annoying to get spammed by someone only to find out they're working on triggers and such. Nothing like getting spammed "Hello!" a hundred times from a failed greeting script ) |
|
_________________ zMUD 7.05a |
|
|
|
|
|