|
rking351 Newbie
Joined: 04 Nov 2007 Posts: 7
|
Posted: 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 |
|
|
|
rking351 Newbie
Joined: 04 Nov 2007 Posts: 7
|
Posted: Sun Nov 04, 2007 7:42 pm |
figured this out, sorry took me a while to understand help
|
|
|
|
rking351 Newbie
Joined: 04 Nov 2007 Posts: 7
|
Posted: 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? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
rking351 Newbie
Joined: 04 Nov 2007 Posts: 7
|
Posted: Tue Nov 06, 2007 5:58 am |
Thanks that worked!
|
|
|
|
|
|