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


Joined: 20 Mar 2016
Posts: 1

PostPosted: Sun Mar 20, 2016 3:17 am   

Simple Trigger function
 
When my health is below 50% I want my client to beep.

How would I do this using zscripting? I have the #BEEP part down! Very Happy
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Mar 20, 2016 6:14 am   
 
We would need some examples of your prompt in order to write the #TRIGGER that would capture the health information. If the prompt doesn't also contain max health then we would need to know how to get that information as well. The 50% calculation can be done with %eval. I would also suggest a sub-state to provide a delay between the beeps.

If we write it on the forum it will likely be in a command form that you can copy and paste into the command line to create all the settings. Normally you would make those settings by opening the package editor and selecting New Whatever and then would put all the scripts in there.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
shalimar
GURU


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

PostPosted: Sun Mar 20, 2016 8:13 am   
 
#IF (@health<(@healthMax/2)) {#BEEP}

Insert that into your trigger after defining @health and @healthMax
_________________
Discord: Shalimarwildcat
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