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
➜ Plugins
➜ Buff tracker for Zombiemud
Buff tracker for Zombiemud
|
You need to log onto the forum to reply or create new threads.
Refresh page
Posted by
| Antiflower
(4 posts) Bio
|
Date
| Wed 20 Aug 2025 03:32 PM (UTC) Amended on Wed 20 Aug 2025 03:58 PM (UTC) by Antiflower
|
Message
| I would like to create a buff tracker for Zombiemud. Zombiemud uses a party system and I'd like the tracker to send information to the party channel with the party say command, I did get chatgpt to come up a functional version, but I am unsure how to add more buffs beyond stoneskin to this, any attempt at getting chatgpt to edit it further results in the plugin no longer functioning. So if someone could help me edit this plugin in a way that allows me to add buffs myself without editing a large portion of the code, such as just adding new trigger blocks, that would be preferable, I think? It was difficult to get even this far with chatgpt as it kept trying to use improper formating for plugins and making things up until I gave it an example from the forums here.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="ZombieMUD_BuffTracker"
author="You"
id="a1b2c3d4e5f67890"
language="VBscript"
purpose="Track Stoneskin buff stacks"
save_state="y"
requires="4.00"
version="1.1"
>
<description trim="y"><![CDATA[
Tracks Stoneskin buffs on ZombieMUD and announces stacks to party.
- Triggered by:
"Granite plates form over your skin."
"Your stoneskin crumbles and drops off."
- Supports up to 2 stacks.
- Alias: buffstatus (prints current buff stacks to party channel).
]]></description>
</plugin>
<!-- Triggers -->
<triggers>
<!-- Stoneskin applied -->
<trigger
match="Granite plates form over your skin."
script="OnStoneskinGain"
enabled="y"
/>
<!-- Stoneskin fades -->
<trigger
match="Your stoneskin crumbles and drops off."
script="OnStoneskinLoss"
enabled="y"
/>
</triggers>
<!-- Aliases -->
<aliases>
<alias
match="^buffstatus$"
script="OnBuffStatus"
enabled="y"
regexp="y"
/>
</aliases>
<!-- Script -->
<script>
<![CDATA[
Dim stoneskinStacks
Sub OnPluginInstall
stoneskinStacks = 0
World.Send "party say BuffTracker loaded. Stoneskin stacks = " & stoneskinStacks
End Sub
Sub OnStoneskinGain(name, line, wildcards)
If stoneskinStacks < 2 Then
stoneskinStacks = stoneskinStacks + 1
End If
World.Send "party say Stoneskin applied. Current stacks: " & stoneskinStacks
End Sub
Sub OnStoneskinLoss(name, line, wildcards)
If stoneskinStacks > 0 Then
stoneskinStacks = stoneskinStacks - 1
End If
World.Send "party say Stoneskin faded. Current stacks: " & stoneskinStacks
End Sub
Sub OnBuffStatus(name, line, wildcards)
World.Send "party say Current Stoneskin stacks: " & stoneskinStacks
End Sub
]]>
</script>
</muclient> | Top |
|
Posted by
| Fiendish
USA (2,540 posts) Bio
Global Moderator |
Date
| Reply #1 on Thu 21 Aug 2025 12:18 PM (UTC) Amended on Thu 21 Aug 2025 12:19 PM (UTC) by Fiendish
|
Message
| Do all of your buffs stack or only some? |
https://github.com/fiendish/aardwolfclientpackage | Top |
|
Posted by
| Fiendish
USA (2,540 posts) Bio
Global Moderator |
Date
| Reply #2 on Thu 21 Aug 2025 12:48 PM (UTC) Amended on Thu 21 Aug 2025 01:01 PM (UTC) by Fiendish
|
Message
| Anyway, probably something like this (not tested)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="ZombieMUD_BuffTracker"
author="Fiendish"
id="5436f54b51d710e47030a41f"
language="Lua"
purpose="Track buffs and announce to party"
save_state="y"
requires="4.00"
version="1.1"
>
<description trim="y"><![CDATA[
Tracks buffs on ZombieMUD and announces stacks to party.
- Alias: buffstatus (prints current buff stacks to party channel).
]]></description>
</plugin>
<!-- Aliases -->
<aliases>
<alias
match="buffstatus"
script="OnBuffStatus"
enabled="y"
regexp="n"
/>
</aliases>
<!-- Script -->
<script>
<![CDATA[
buffDetails = {
["stoneskin"] = {
["maxStacks"] = 2,
["apply"] = "Granite plates form over your skin.",
["fade"] = "Your stoneskin crumbles and drops off.",
}
}
buffStacks = {}
function OnPluginInstall()
Send("party say BuffTracker loaded.")
for name, buff in pairs(buffDetails) do
buffStacks[name] = 0
AddTriggerEx(
"gain_" .. name:gsub("[^A-Za-z0-9_]", ""):sub(1, 32),
buff["apply"],
"OnBuffGain('" .. name .. "')",
trigger_flag.Enabled,
-1, 0, "", "", sendto.script, 100
)
AddTriggerEx(
"loss_" .. name:gsub("[^A-Za-z0-9_]", ""):sub(1, 32),
buff["fade"],
"OnBuffLoss('" .. name .. "')",
trigger_flag.Enabled,
-1, 0, "", "", sendto.script, 100
)
end
end
function OnBuffGain(name)
if buffStacks[name] < buffDetails[name]["maxStacks"] then
buffStacks[name] = buffStacks[name] + 1
Send("party say " .. name .. " gained. Current stacks: " .. buffStacks[name])
else
Send("party say " .. name .. " is at max stacks: " .. buffDetails[name]["maxStacks"])
end
end
function OnBuffLoss(name)
if buffStacks[name] and buffStacks[name] > 0 then
buffStacks[name] = buffStacks[name] - 1
Send("party say " .. name .. " lost. Current stacks: " .. buffStacks[name])
else
Send("party say " .. name .. " is not active.")
end
end
function OnBuffStatus()
Send("party say Current Buff Status:")
for name, stacks in pairs(buffStacks) do
if stacks > 0 then
Send("party say " .. name .. ": " .. stacks .. "/" .. buffDetails[name]["maxStacks"])
end
end
end
]]>
</script>
</muclient>
|
https://github.com/fiendish/aardwolfclientpackage | Top |
|
Posted by
| Antiflower
(4 posts) Bio
|
Date
| Reply #3 on Thu 21 Aug 2025 07:21 PM (UTC) Amended on Thu 21 Aug 2025 08:09 PM (UTC) by Antiflower
|
Message
|
Fiendish said:
Do all of your buffs stack or only some?
No, but the ones that do only stack to 2 times, so it doesnt need to be anything fancier than that.
Also, This plugin version looks wonderful. I'll give it a test run, and I thank you for your time and help, I really appreciate you being willing to do so. | Top |
|
Posted by
| Antiflower
(4 posts) Bio
|
Date
| Reply #4 on Thu 21 Aug 2025 08:10 PM (UTC) |
Message
|
Fiendish said:
Anyway, probably something like this (not tested)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE muclient>
<muclient>
<plugin
name="ZombieMUD_BuffTracker"
author="Fiendish"
id="5436f54b51d710e47030a41f"
language="Lua"
purpose="Track buffs and announce to party"
save_state="y"
requires="4.00"
version="1.1"
>
<description trim="y"><![CDATA[
Tracks buffs on ZombieMUD and announces stacks to party.
- Alias: buffstatus (prints current buff stacks to party channel).
]]></description>
</plugin>
<!-- Aliases -->
<aliases>
<alias
match="buffstatus"
script="OnBuffStatus"
enabled="y"
regexp="n"
/>
</aliases>
<!-- Script -->
<script>
<![CDATA[
buffDetails = {
["stoneskin"] = {
["maxStacks"] = 2,
["apply"] = "Granite plates form over your skin.",
["fade"] = "Your stoneskin crumbles and drops off.",
}
}
buffStacks = {}
function OnPluginInstall()
Send("party say BuffTracker loaded.")
for name, buff in pairs(buffDetails) do
buffStacks[name] = 0
AddTriggerEx(
"gain_" .. name:gsub("[^A-Za-z0-9_]", ""):sub(1, 32),
buff["apply"],
"OnBuffGain('" .. name .. "')",
trigger_flag.Enabled,
-1, 0, "", "", sendto.script, 100
)
AddTriggerEx(
"loss_" .. name:gsub("[^A-Za-z0-9_]", ""):sub(1, 32),
buff["fade"],
"OnBuffLoss('" .. name .. "')",
trigger_flag.Enabled,
-1, 0, "", "", sendto.script, 100
)
end
end
function OnBuffGain(name)
if buffStacks[name] < buffDetails[name]["maxStacks"] then
buffStacks[name] = buffStacks[name] + 1
Send("party say " .. name .. " gained. Current stacks: " .. buffStacks[name])
else
Send("party say " .. name .. " is at max stacks: " .. buffDetails[name]["maxStacks"])
end
end
function OnBuffLoss(name)
if buffStacks[name] and buffStacks[name] > 0 then
buffStacks[name] = buffStacks[name] - 1
Send("party say " .. name .. " lost. Current stacks: " .. buffStacks[name])
else
Send("party say " .. name .. " is not active.")
end
end
function OnBuffStatus()
Send("party say Current Buff Status:")
for name, stacks in pairs(buffStacks) do
if stacks > 0 then
Send("party say " .. name .. ": " .. stacks .. "/" .. buffDetails[name]["maxStacks"])
end
end
end
]]>
</script>
</muclient>
This works perfectly. I was able to add more buffs to it and it functions great. Thank you again for the assistance. | 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.
1,219 views.
You need to log onto the forum to reply or create new threads.
Refresh page
top