Register forum user name Search FAQ

Gammon Forum

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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Healthbar for Achaea!

Healthbar for Achaea!

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  

Posted by Nickpick   (24 posts)  Bio
Date Sun 28 Aug 2005 07:07 PM (UTC)

Amended on Thu 23 Feb 2006 09:08 AM (UTC) by Nickpick

Message
I hope that you don't mind Nick, but I adapted you Health_Bar plugin for the MUD called Achaea, just because so many people asked for help about it. It doesn't require any knowledge of VBScript and only needs a reconnect after being setup. Check the help file for more info.

Here's the code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient [
<!ENTITY trigger_match
"^(\d+)h, (\d+)m, (\d+)e, (\d+)w c?e?x?k?d?b?-(.*)$" >
]>


<!-- Saved on Monday, April 28, 2003, 9:53 AM -->
<!-- MuClient version 3.41 -->

<!-- Plugin "Health_Bar" generated by Plugin Wizard -->

<!--
You will probably need to customise the trigger to match your MUD.

See ENTITY line near top of file. The above trigger will match on:

<54/1000 hp 90/100 m 600/750 mv>

A simpler trigger would be:

&lt;*/*hp */*m */*mv&gt;

-.-.-.-.-.-.-.- ADAPTED TO ACHAEA! -.-.-.-.-.-.-.-

Reconnect to Achaea in order to lauch the plugin properly.

-->

<muclient>
<plugin
name="Health_Bar"
author="Nick Gammon"
id="a2af5216d68563401888e01e"
language="VBscript"
purpose="Shows HP, Mana, Endurance and Willpower in a colour bar"
date_written="2003-04-28 09:50:05"
date_modified="2003-04-28 12:40:05"
requires="3.29"
version="1.12"
>
<description trim="y">
<![CDATA[

IMPORTANT: In order for plugin to work properly you need to reconnect to Achaea or call out the SCORE.

ALSO, configure your PROMP to show ALL, i.e. Health, Mana, Endurance and Willpower. In order to do so, type CONFIG PROMPT ALL.

Original text:

Install this plugin to show an info bar with HP, Mana,
and Movement points shown as a bar (between 0 and 10 blocks).

You need your prompt line to display the appropriate information,
naturally. I used this in SMAUG:

prompt <%h/%H hp %m/%M m %v/%V mv>
fprompt <%h/%H hp %m/%M m %v/%V mv>

"prompt" sets the normal prompt, "fprompt" sets the fight prompt.

Customise the plugin if you want to match a different sort of prompt line.

To see this message, type: Health_Bar:help

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-.-.-.-.- Original Script -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.- by -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.- Nick Gammon -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-.-.-.-.- ADAPTED TO ACHAEA! -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.- by -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.- Caecilius Azon -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

]]>
</description>

</plugin>


<!-- Triggers -->

<triggers>
<trigger
enabled="y"
match="&trigger_match;"
name="InfoBar"
regexp="y"
script="DoPrompt"
sequence="100"
>
</trigger>
<trigger
enabled="y"
match="^Password correct\. Welcome to Achaea\.$"
regexp="y"
script="RunScore"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="Multi Line"
lines_to_match="3"
keep_evaluating="y"
match="You are level (.*?)\.\nHealth\: (.*?)\/(.*?) Mana\: (.*?)\/(.*?)\nEndurance\: (.*?)\/(.*?) Willpower\: (.*?)\/(.*?)\Z"
multi_line="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>world.setvariable "HealthMax", %3
world.setvariable "ManaMax", %5
world.setvariable "EnduranceMax", %7
world.setvariable "WillpowerMax", %9</send>
</trigger>
</triggers>

<!-- Script -->


<script>
<![CDATA[
sub DoGauge (sPrompt, iCurrent, iMax, sGoodColour, sBadColour)
dim pc, count

'
' Do prompt in black Arial
'
InfoColour "black"
InfoFont "Arial", 10, 0
Info sPrompt

'
' Use Webdings for gauge (black square)
'

InfoFont "Webdings", 10, 0

pc = CInt ((CInt (iCurrent) / CInt (iMax)) * 10)

'
' Below 20% warn by using different colour
'

if pc < 2 then
InfoColour sBadColour
else
InfoColour sGoodColour
end if

'
' Draw active part of gauge
'
for count = 0 to pc
Info "g"
next

'
' Draw rest of gauge in grey (ie. unfilled bit)
'

InfoColour "dimgray"
while count <= 10
count = count + 1
Info "g"
wend

end sub

sub RunScore (sName, sLine, wildcards)

world.send("SCORE")

end sub

sub DoPrompt (sName, sLine, wildcards)

dim MaxH, MaxM, MaxE, MaxW

MaxH = world.getvariable("HealthMax")
MaxM = world.getvariable("ManaMax")
MaxE = world.getvariable("EnduranceMax")
MaxW = world.getvariable("WillpowerMax")

InfoClear

'
' World name
'

InfoFont "Times New Roman", 12, 1 ' 12 point Arial *bold*
InfoColour "darkgrey"
Info GetInfo (2) ' world name

DoGauge " HP: ", wildcards (1), MaxH, "darkgreen", "maroon"
DoGauge " Mana: ", wildcards (2), MaxM, "DarkBlue", "Blue"
DoGauge " Endurance: ", wildcards (3), MaxE, "orange", "orange"
DoGauge " Willpower: ", wildcards (4), MaxW, "purple", "purple"


end sub

'
' Do this once
'
ShowInfoBar vbTrue



]]>
</script>

<!-- Variables -->

<variables>
<variable name="WillpowerMax">1000</variable>
<variable name="HealthMax">1000</variable>
<variable name="ManaMax">10000</variable>
<variable name="EnduranceMax">10000</variable>
</variables>

<!-- Plugin help -->

<aliases>
<alias
script="OnHelp"
match="Health_Bar:help"
enabled="y"
>
</alias>
</aliases>

<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script>

</muclient>


Just create a file called Health_Bar.xml with your notepad and paste in the code from above.

I really hope that you don't mind me posting it.

EDIT: A slight update has been made on 30th August 2005.
EDIT2: CONFIG PROMPT ALL notion added on 23rd February 2006.
Top

Posted by Scarn   (47 posts)  Bio
Date Reply #1 on Thu 01 Sep 2005 11:39 AM (UTC)
Message
dont suppose youy want to make one for The Two Towers?:P

the prompt is...

HP:230 EP:230 REG:MOR >

with a newline...:)

I cant seem to get it to work...as 230 in the max HP.
Top

Posted by Gadget424   (5 posts)  Bio
Date Reply #2 on Mon 05 Dec 2005 01:34 AM (UTC)
Message
I can't get this modified plugin to work in Achaea no matter what I try. I sent this to my brother and he got the plugin to work, first try, no problems. I however am not as lucky.

I've tried uninstalling the plugin, reinstalling it, exiting MUSH, saving here, saving there, reinstalling MUSH and starting over... all to no avail. I'm guessing there's one little step somewhere that I'm just flat missing and it will work like a charm, but I sure as heck can't figure out what it is. Unless it's another part of my machine that hasn't been updated properly, or another setting that I've failed to configure, I'm completely at a loss.

I'm using MUSH 3.65 on Windows XP. Any help anyone could provide would be most appreciated.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 05 Dec 2005 02:10 AM (UTC)
Message
When the plugin was posted Maxgrin should have "quoted forum codes" (there is a function in the MUSHclient notepad to do that). Without it, subtle bugs have probably crept it. Here is the same code, modified with quoted forum codes:



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient [
  <!ENTITY trigger_match 
   "^(\d+)h, (\d+)m, (\d+)e, (\d+)w c?e?x?k?d?b?-(.*)$" > 
]>


<!-- Saved on Monday, April 28, 2003, 9:53 AM -->
<!-- MuClient version 3.41 -->

<!-- Plugin "Health_Bar" generated by Plugin Wizard -->

<!--
You will probably need to customise the trigger to match your MUD.

See ENTITY line near top of file. The above trigger will match on:

  <54/1000 hp 90/100 m 600/750 mv>

A simpler trigger would be:

  &lt;*/*hp */*m */*mv&gt;

-.-.-.-.-.-.-.- ADAPTED TO ACHAEA! -.-.-.-.-.-.-.-

Reconnect to Achaea in order to lauch the plugin properly.

-->

<muclient>
<plugin
   name="Health_Bar"
   author="Nick Gammon"
   id="a2af5216d68563401888e01e"
   language="VBscript"
   purpose="Shows HP, Mana, Endurance and Willpower in a colour bar"
   date_written="2003-04-28 09:50:05"
   date_modified="2003-04-28 12:40:05"
   requires="3.29"
   version="1.1"
   >
<description trim="y">
<![CDATA[

IMPORTANT: In order for plugin to work properly you need to reconnect to Achaea or call out the SCORE.

Original text:

Install this plugin to show an info bar with HP, Mana, 
and Movement points shown as a bar (between 0 and 10 blocks).

You need your prompt line to display the appropriate information,
naturally. I used this in SMAUG:

prompt <%h/%H hp %m/%M m %v/%V mv>
fprompt <%h/%H hp %m/%M m %v/%V mv>

"prompt" sets the normal prompt, "fprompt" sets the fight prompt.

Customise the plugin if you want to match a different sort of prompt line.

To see this message, type: Health_Bar:help

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-.-.-.-.-   Original Script  -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-        by          -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-    Nick Gammon     -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-.-.-.-.-.- ADAPTED TO ACHAEA! -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-        by          -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-  Caecilius Azon    -.-.-.-.-.-.-.-
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.

]]>
</description>

</plugin>


<!--  Triggers  -->

<triggers>
  <trigger
   enabled="y"
   match="&trigger_match;"
   name="InfoBar"
   regexp="y"
   script="DoPrompt"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="y"
   match="^Password correct\. Welcome to Achaea\.$"
   regexp="y"
   script="RunScore"
   sequence="100"
  >
  </trigger>
<trigger
   enabled="y"
   group="Multi Line"
   lines_to_match="3"
   keep_evaluating="y"
   match="You are level (.*?)\.\nHealth\: (.*?)\/(.*?)  Mana\: (.*?)\/(.*?)\nEndurance\: (.*?)\/(.*?)  Willpower\: (.*?)\/(.*?)\Z"
   multi_line="y"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>world.setvariable "HealthMax", %3
world.setvariable "ManaMax", %5
world.setvariable "EnduranceMax", %7
world.setvariable "WillpowerMax", %9</send>
  </trigger>
</triggers>

<!--  Script  -->


<script>
<![CDATA[
sub DoGauge (sPrompt, iCurrent, iMax, sGoodColour, sBadColour)
dim pc, count

'
'  Do prompt in black Arial
'
  InfoColour "black"
  InfoFont "Arial", 10, 0
  Info sPrompt

'
'  Use Webdings for gauge (black square)
'

  InfoFont "Webdings", 10, 0

  pc = CInt ((CInt (iCurrent) / CInt (iMax)) * 10)

'
'  Below 20% warn by using different colour
'

  if pc < 2 then
    InfoColour sBadColour
  else
    InfoColour sGoodColour
  end if

'
'  Draw active part of gauge
'
  for count = 0 to pc
    Info "g"
  next  

'
'  Draw rest of gauge in grey (ie. unfilled bit)
'

  InfoColour "dimgray"
  while count <= 10
    count = count + 1
    Info "g"
  wend

end sub

sub RunScore (sName, sLine, wildcards)

world.send("SCORE")

end sub

sub DoPrompt (sName, sLine, wildcards)

dim MaxH, MaxM, MaxE, MaxW

MaxH = world.getvariable("HealthMax")
MaxM = world.getvariable("ManaMax")
MaxE = world.getvariable("EnduranceMax")
MaxW = world.getvariable("WillpowerMax")

  InfoClear

'
'  World name
'

  InfoFont "Times New Roman", 12, 1  ' 12 point Arial *bold*
  InfoColour "darkgrey"
  Info GetInfo (2)  ' world name

  DoGauge " HP: ", wildcards (1), MaxH, "darkgreen", "maroon"
  DoGauge " Mana: ", wildcards (2), MaxM, "DarkBlue", "Blue"
  DoGauge " Endurance: ", wildcards (3), MaxE, "orange", "orange"
  DoGauge " Willpower: ", wildcards (4), MaxW, "purple", "purple"


end sub

'
'  Do this once
'
ShowInfoBar vbTrue



]]>
</script>

<!--  Variables  -->

<variables>
  <variable name="WillpowerMax">1000</variable>
  <variable name="HealthMax">1000</variable>
  <variable name="ManaMax">10000</variable>
  <variable name="EnduranceMax">10000</variable>
</variables>

<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="Health_Bar:help"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
  world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script> 

</muclient>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #4 on Mon 05 Dec 2005 02:12 AM (UTC)
Message
Quote:


I can't get this modified plugin to work in Achaea no matter what I try. I sent this to my brother and he got the plugin to work, first try, no problems


In what way does it not work? Error message? Nothing happens?

Try it with version 3.70:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6124

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Gadget424   (5 posts)  Bio
Date Reply #5 on Mon 05 Dec 2005 02:17 AM (UTC)
Message
Nothing happens. When I initially install it, down in the status bar it says that it's loading it, but then nothing ever pops up.

Haven't tried it yet w/ 3.7. Will do that now.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #6 on Mon 05 Dec 2005 02:24 AM (UTC)
Message
What is your prompt line like? It needs to match the trigger exactly. Can you give an example?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Gadget424   (5 posts)  Bio
Date Reply #7 on Mon 05 Dec 2005 02:25 AM (UTC)
Message
Still nothing, not even w/ 3.7. It just doesn't pop up. It says "Achaea loading plugin Health_Bar..." but then nothing happens, and even when I type in SCORE as suggested, still nothing happens, and then even after I save world and relogin, still nothing happens.

I kinda think that it has to be running because when I type Health_Bar:help it brings up that section of the xml file, but no bars ever show up.
Top

Posted by Gadget424   (5 posts)  Bio
Date Reply #8 on Mon 05 Dec 2005 02:27 AM (UTC)
Message
1040h, 1100m ex-

And as I said, I have another user that copied the same text into his xml file and it worked like a charm. Which makes me think it's just another setting I don't have toggled properly or something.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #9 on Mon 05 Dec 2005 02:35 AM (UTC)
Message
If you look at the trigger at the top of the page it is this:


^(\d+)h, (\d+)m, (\d+)e, (\d+)w c?e?x?k?d?b?-(.*)$


Now an example of what that would match is:


1040h, 1100m, 300e, 88w ex-


So, you need to change your prompt to look like that. Add endurance and willpower.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Gadget424   (5 posts)  Bio
Date Reply #10 on Mon 05 Dec 2005 02:39 AM (UTC)
Message
Dude, that's totally weird. I didn't even change it to add all the stats. All I added was endurance and BLAMMO! There it is. I even changed it back to just display health and mana and it's still up. Never would have thought to try that. Thanks Nick, MUSHclient rules, ergo, you rule.
Top

Posted by Gore   (207 posts)  Bio
Date Reply #11 on Mon 05 Dec 2005 09:04 PM (UTC)
Message
That's a pretty neat plugin. Any chance I could incorpoate parts of it into my system?
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #12 on Mon 05 Dec 2005 09:42 PM (UTC)
Message
What system? If you mean the plugin I wrote, that is publicly available for use.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Gore   (207 posts)  Bio
Date Reply #13 on Tue 06 Dec 2005 10:53 AM (UTC)
Message
I mean would you mind if I dissected for some parts I required and incorporated it into my plugin? I'd give you credit of course =p
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #14 on Tue 06 Dec 2005 07:45 PM (UTC)
Message
Go ahead.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


80,834 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.