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


Joined: 06 Sep 2004
Posts: 30

PostPosted: 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.
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: 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
Reply with quote
Cronos
Novice


Joined: 06 Sep 2004
Posts: 30

PostPosted: 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
Reply with quote
Falan
Wanderer


Joined: 17 Aug 2004
Posts: 98
Location: OK, USA

PostPosted: 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 Rolling Eyes )
_________________
zMUD 7.05a
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