Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ Plugins
➜ Dynamic Prompt Line Colorizer... Enclosed in only 1 trigger!!!
Dynamic Prompt Line Colorizer... Enclosed in only 1 trigger!!!
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Onoitsu2
USA (248 posts) Bio
|
Date
| Tue 09 May 2006 03:29 PM (UTC) Amended on Tue 09 May 2006 09:33 PM (UTC) by Nick Gammon
|
Message
| This is for Aardwolf, but can simply be altered to work on virtually any type of mud.
this is my prompt style as defined in the game:
<%h/%Hhp %m/%Mmn %v/%Vmv %Xtnl Gold: %g>%c
it is shown as:
<1767/1767hp 1682/1682mn 1408/1408mv 803tnl Gold: 999>
with a CR at the end
this basically omits the original promptline, then does a DoAfterSpecial 0.1, AnsiNote ""WHATEVER HERE"", 12
the if statements set up the color change based upon the percentage of current life divided by total life you have, which is set to, 50% and less, AND 33% and less to check the colors.
included an if statement for mn (mana) as well but you can do one for ANYTHING you can match and compare.
You can even hardcode in a value for gold you want to be warned about, such as you need so much gold to be resurected with all your items, well then set the needed gold (max) value to double what you need (for starters, you can slowly work value down after you do the math to attain 50% and 33% still being more than what you need) so that it warns when you are getting low on gold to be resurected with, BUT you still do have enough to be resurected.
Code for it is to follow ... enjoy :)
Laterzzz,
Onoitsu2 | Top |
|
Posted by
| Onoitsu2
USA (248 posts) Bio
|
Date
| Reply #1 on Tue 09 May 2006 09:31 PM (UTC) |
Message
|
<triggers>
<trigger
enabled="y"
group="prompt_scripts"
match="^\<(.*?)\/(.*?)hp (.*?)\/(.*?)mn (.*?)\/(.*?)mv (.*?)tnl Gold\: (.*?)\>$"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="1"
>
<send>dim hp, mn
if ("%1" / "%2") < 0.51 then
if ("%1" / "%2") < 0.34 then
hp = 31
else
hp = 33
end if
else
hp = 32
end if
if ("%3" / "%4") < 0.51 then
if ("%3" / "%4") < 0.31 then
mn = 31
else
mn = 33
end if
else
mn = 36
end if
world.doafterspecial 0.1, "world.ansinote ansi(1) & ansi(37) & ""\<"" & ansi(0) & ansi(1) & ansi(hp) & ""%1"" & ansi(32) & ""\/%2hp "" & ansi(mn) & ""%3"" & ansi(36) & ""\/%4mn "" & ansi(37) & ""%5\/%6mv "" & ansi(35) & ""%7tnl "" & ansi(33) & ""Gold: %8"" & ansi(1) & ansi(37) & ""\>""", 12</send>
</trigger>
</triggers>
| Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #2 on Tue 09 May 2006 09:32 PM (UTC) |
Message
| Thanks for contributing that!
I have split your post into two parts, as in my browser the lengthy script line also made your explanation hard to read. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Onoitsu2
USA (248 posts) Bio
|
Date
| Reply #3 on Wed 10 May 2006 12:36 PM (UTC) |
Message
| lol no prob Nick I love MUSHclient, it is an awsome program, and anything, and I do mean anything that I can contribute will be posted.
and ya I loaded this topic and was wondering why it was split, as I did not remember the code tag doing that previously... Yes it is easier to read now ...
Laterzzz,
Onoitsu2 | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
14,009 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top