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


Joined: 04 Nov 2007
Posts: 7

PostPosted: Sun Nov 04, 2007 7:24 pm   

Triggers, Setprompt, Windows Zmud
 
Hi,

First let me start by saying I'm not a coder.... I use to play around with tintin so I understand the Zmud help commands and fucntions like:
#ALIAS {name} {command} or
#TRIG {string} {action} etc

I currently using zMUD 7.21 which is windows based and mainly use aliases and triggers.... and instead of having to create the code #ALIAS, I just hit the alias button enter the name and command in the windows.

Lately I've been trying to use zMud more by creating a trigger off of my hp/mana prompt and the help files talk about doing #SETPROMPT. So now i'm confused as to where to put this command in the windows based program...

Ultimately, I want to make a trigger to alert me or take an action when my hp runs low. Also thinking about this, will this cause a loop error if the action I set does not fix my low hp? For example if I create the trigger to beep and send myself a message when my HP is low, won't this repeat every time the message is sent and my prompt reappears?

Thanks for your help.

Rich
Reply with quote
rking351
Newbie


Joined: 04 Nov 2007
Posts: 7

PostPosted: Sun Nov 04, 2007 7:42 pm   
 
figured this out, sorry took me a while to understand help
Reply with quote
rking351
Newbie


Joined: 04 Nov 2007
Posts: 7

PostPosted: Sun Nov 04, 2007 10:24 pm   
 
ok got this working with the following:
#TRIG {^~<&hp - &mana~> %1}
{#SETPROMPT "<" hp - mana
#IF (@mana < 50) {
#color blink
#BEEP
}}

An example of my prompt would be the following
<1045 - 194> (MP:165752) [T:23337] $73290

The problem i'm seeing in some cases when entering in commands the prompt gets repeated on the same line like:
<1001 - 194> (MP:167152) [T:23241] $86525 <1001 - 194> (MP:167152) [T:23241] $86525 The smithy. [e w]

when this occurs the trigger is activated and i'm not sure why.

any ideas?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Nov 04, 2007 11:15 pm   
 
Setprompt isn't supposed to be used from within a trigger - the command creates a trigger, and so like other trigger commands, you don't need to use it more than once.

Since you have a trigger that's capturing your prompt already (assuming that it's working properly - you may find better results using proper pattern matching wildcards in your trigger patterns - ask for more help with that if you need it) you don't need another trigger from setprompt. You can remove the setprompt line from your trigger there, and just refer to the @mana variable that your prompt trigger is creating.

You also shouldn't be using %1-%99 in the trigger pattern - they're used in the script when you've defined captures in the trigger pattern. You do that by surrounding things you want to capture in () brackets.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
rking351
Newbie


Joined: 04 Nov 2007
Posts: 7

PostPosted: Tue Nov 06, 2007 5:58 am   
 
Thanks that worked!
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