Ok, i have got your script working by myself (I know, I know...)
Its pretty goddam cool, but it doesnt seem to update itself very often (e.g. if I cast a spell on myself it doesnt notice I use mana until later on at some random time). Here it is in all its glory, but could someone tell me why it doesnt update very often? I have a feeling its because my trigger isnt working proper, but i really cant do Regular Expressions so its the best I can do ;P
If someone could figure out why it doesnt update often, Id appreciate it :)
Anyway here it is, (set up for bb8.betterbox.net, port 6666):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<!-- Saved on Friday, June 13, 2003, 5:01 PM -->
<!-- MuClient version 3.42 -->
<!-- Plugin "health_bar" generated by Plugin Wizard -->
<muclient>
<plugin
name="health_bar"
author="Ishnaf / Nick Gammon"
id="a2af5216d68563401888e01e"
language="VBscript"
save_state="y"
date_written="2003-06-13 16:56:36"
requires="3.40"
version="1.0"
purpose="a health bar plugin"
>
<description trim="y">
<![CDATA[
This is a health bar plugin that displays your health in bars :) Its flashy :)
It basically installs itself. All you need to do is:
1. Add this plugin to your plugin list.
2. Type 'score' to let the plugin know its maximums it should work already!
Have fun!
NOTES FOR ENTHUSIASTS:
The script gets it maximums from the MUD readout, i.e.:
Health [ whatever ......
Power [ 438/908 ] Exp[........
I did it this way because its automatic and easy to set up...
]]>
</description>
</plugin>
<!-- Get our standard constants -->
<include name="constants.vbs"/>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="Power [ */ * ] Need [*] * "
name="max2"
send_to="9"
sequence="100"
variable="max_power"
other_text_colour="black"
other_back_colour="black"
>
<send>%2</send>
</trigger>
<trigger
enabled="y"
match="Vigor [ */ * ] Gold [*] *"
name="max3"
send_to="9"
sequence="100"
variable="max_vigor"
other_text_colour="black"
other_back_colour="black"
>
<send>%2</send>
</trigger>
<trigger
enabled="y"
match="*H *M *V [*] *"
name="max4"
script="DoPrompt"
sequence="100"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
<trigger
enabled="y"
match="Health [ */ * ] Exp [*] *"
name="max"
send_to="9"
sequence="100"
variable="max_health"
other_text_colour="black"
other_back_colour="black"
>
<send>%2</send>
</trigger>
</triggers>
<!-- Variables -->
<variables>
<variable name="max_vigor">127</variable>
<variable name="max_health">316</variable>
<variable name="max_power">908</variable>
</variables>
<!-- Script -->
<script>
<![CDATA[
world.note "Health bar script loaded"
world.note "type ishnaf-health_bar for help"
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 DoPrompt (sName, sLine, wildcards)
InfoClear
'
' World name
'
InfoFont "Arial", 12, 1 ' 12 point Arial *bold*
InfoColour "purple"
Info GetInfo (2) ' world name
dim health, power, vigor
health = world.GetVariable("max_health")
power = world.GetVariable("max_power")
vigor = world.GetVariable("max_vigor")
'this checks to make sure the maxmana/hit and stuff is ok, so the script doesnt have a sad.
dim d
d=1
if cInt(wildcards(1)) > cInt(health) then
d=0
end if
if cInt(wildcards(2)) > cInt(power) then
d=0
end if
if cInt(wildcards(3)) > cInt(vigor) then
d=0
end if
'if this case is true, yer script would have a sad, so we display this:
if d=0 then
world.colourTell "red", "black", "-----------------------Health_Bar Scripting Alert-------------------"
world.note ""
world.colourTell "white", "black", "your maximum hitpoints/mana are set too low for this script to run."
world.note ""
world.colourTell "white", "black", "please type 'score' and check your score, and this should fix the problem,"
world.note ""
world.colourTell "white", "black", "as the plugin gets your maximum values and updates them whenever you check"
world.note ""
world.colourTell "white", "black", "your score"
world.sound "ding.wav"
else
'this means its checked everything is ok, and is continuing
DoGauge " HP: ", wildcards (1), cInt(health), "darkgreen", "maroon"
DoGauge " Mana: ", wildcards (2), cInt(power), "mediumblue", "mediumblue"
DoGauge " Move: ", wildcards (3), cInt(vigor), "gold", "gold"
end if
end sub
'
' Do this once
'
ShowInfoBar vbTrue
]]>
</script>
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="ishnaf-health_bar"
enabled="y"
>
</alias>
</aliases>
<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script>
</muclient> |