TRIGGER:
<triggers>
<trigger
enabled="y"
expand_variables="y"
match="^HP\:(\d+)\/(\d+) EP\:(\d+)\/(\d+) REG\: \>$"
name="InfoBar"
regexp="y"
script="DoPrompt"
send_to="12"
sequence="100"
>
<send>setvariable "Health", "%1"
setvariable "Energy", "%3"
setvariable "Region", "%5"
status = WindowCreate ("6", 0, 0, 290,673, 6, 0, ColourNameToRGB ("black"))
status = WindowGradient (6, 27, 10, 50, 33, ColourNameToRGB ("white"),ColourNameToRGB ("white"),1)
status = WindowGradient (6, 34, 10, 42, 33, ColourNameToRGB ("darkred"),ColourNameToRGB ("red"),1)
status = WindowGradient (6, 27, 18, 50, 25, ColourNameToRGB ("darkred"),ColourNameToRGB ("red"),1)
status = WindowGradient (6, 27, 60, 50, 83, ColourNameToRGB ("white"),ColourNameToRGB ("white"),1)
status = WindowGradient (6, 34, 60, 42, 83, ColourNameToRGB ("green"),ColourNameToRGB ("lime"),1)
status = WindowGradient (6, 27, 67, 50, 75, ColourNameToRGB ("green"),ColourNameToRGB ("lime"),1)
status = WindowGradient (6, 20, 110, 50, 133, ColourNameToRGB ("black"),ColourNameToRGB ("saddlebrown"),1)
status = WindowGradient (6, 20, 118, 50, 123, ColourNameToRGB ("sienna"),ColourNameToRGB ("yellow"),1)
status = WindowGradient (6,32, 116, 37, 125, ColourNameToRGB ("orange"),ColourNameToRGB ("yellow"),1)
status = WindowGradient (6, 20, 156, 26, 183, ColourNameToRGB ("cyan"),ColourNameToRGB ("blue"),1)
status = WindowGradient (6, 29, 165, 36, 183, ColourNameToRGB ("fuscia"),ColourNameToRGB ("purple"),1)
status = WindowGradient (6, 38, 173, 46, 183, ColourNameToRGB ("green"),ColourNameToRGB ("lime"),1)
status = WindowGradient (6, 20, 183, 50, 187, ColourNameToRGB ("white"),ColourNameToRGB ("red"),1)
status = WindowFont (6, "heading", "Trebuchet MS", 16, TRUE, FALSE, FALSE, FALSE, 0, 0)
status = WindowText (6, "heading", " Health: @Health",65, 10, 0, 0,ColourNameToRGB ("white"),false)
status = WindowText (6, "heading", " Energy: @Energy",65, 58, 0, 0,ColourNameToRGB ("white"),false)
status = WindowText (6, "heading", " Gold: @Gold",65,108, 0, 0,ColourNameToRGB ("white"),false)
status = WindowText (6, "heading", " Exp: @Exp",65,156, 0, 0,ColourNameToRGB ("white"),false)
status = WindowShow (6, true)
</send>
</trigger>
</triggers>
SCRIPT:
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", 12 , 0
pc = CInt ((CInt (iCurrent) / CInt (iMax)) * 20)
'
' 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 <= 20
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 "black"
Info GetInfo (2) ' world name
InfoColour "white"
info "Health: "
DoGauge "", wildcards (1), 130, "red", "aqua"
InfoColour "white"
InfoFont "Arial", 12, 1 ' 12 point Arial *bold*
info " Energy: "
DoGauge "", wildcards (3), 130, "mediumblue", "mediumblue"
end sub
'
' Do this once
'
ShowInfoBar vbTrue
END |