hpbar = Geyser.Gauge:new({
name="hpbar",
x="0%", y="85%",
width="18%", height="20px",
})
hpbar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #f04141, stop: 0.1 #ef2929, stop: 0.49 #cc0000, stop: 0.5 #a40000, stop: 1 #cc0000);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;]])
hpbar.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;]])
current_health, max_health = tonumber(matches[2]), tonumber(matches[3])
hpbar:setValue(current_health, max_health)
lua local hp = math.random(1,100)
hpbar:setValue(current_health, max_health, "<b>"..max_health.."hp</b>")
Mana Bar:
manabar = Geyser.Gauge:new({
name="manabar",
x="0%", y="90%",
width="18%", height="20px",
})
manabar.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #98f041, stop: 0.1 #8cf029, stop: 0.49 #66cc00, stop: 0.5 #52a300, stop: 1 #66cc00);
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-radius: 7;
padding: 3px;
]])
manabar.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #78bd33, stop: 0.1 #6ebd20, stop: 0.49 #4c9900, stop: 0.5 #387000, stop: 1 #4c9900);
border-width: 1px;
border-color: black;
border-style: solid;
border-radius: 7;
padding: 3px;
]])
current_Mana, max_Mana = tonumber(matches[2]), tonumber(matches[3])
Mana_bar:setValue(current_Mana, max_Mana)
lua local mana = math.random(1,100)
manabar:setValue(current_Mana, max_Mana, "<b>"..max_Mana.."hp</b>")
Thank you for your help!!
Comments
Svof
Mudlet Discord join up
Svof
Mudlet Discord join up
Svof
Mudlet Discord join up
Svof
Mudlet Discord join up
current_health, max_health = tonumber(matches[2]), tonumber(matches[3])
However, it is still not working. Is there anything else I'm missing? Or just something that needs to be added? Do I need the other values to be added somewhere?:
hpbar:setValue(current_health, max_health)
lua local hp = math.random(1,100)
hpbar:setValue(current_health, max_health, "<b>"..max_health.."hp</b>")
Thank you!
Here is a tutorial for using GMCP with Mudlet.
Here is a tutorial for using tables in Mudlet.
Here is a tutorial for using basic RegEx.
Here is a thread with a bunch of video tutorials I did.
I'm sure that you have checked out the Mudlet Manual / wiki, but here are links in case you haven't had the chance.