Yes there is....if you can match around the prompt. Matching the prompt isn't hard, it just isnt standard because everyone uses there own flavor. And you have to know how to write a detailed regular expression matchline. And then insert into THAT the matchline (perhaps without the "COINS:" part) for the money bit....
I played around with it, and came up with this...
jerinx's prompt with coin value wrote:
*100%*100%*100%*11pm*$100
I played with it more, and (here's the tricky part) got it to support being in the middle (like, say, if you wanted to show the room name afterward)...
jerinx's prompt with coin and room name wrote:
*100%* 98%*100%*9pm*$100 *The Traveler's Garb
The plugin is not actually inserting the value into the MUD's prompt, but rather gagging the prompt and repainting it, using the # sign in the prompt to encapsulate the coin amounts and not redraw them.
Caveat: because THIS plugin is redrawing the prompt, the prompt will NOT be omitted when using the chat plugin i've posted in Clients. (that is, it will be gagged TWICE, and then redrawn by this plugin)
coins.xml wrote:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, August 23, 2012, 8:17 AM -->
<!-- MuClient version 4.73 -->
<!-- Plugin "mygold" generated by Plugin Wizard -->
<muclient>
<plugin
name="mygold"
id="88f9ced9f7364e79272bc728"
language="Lua"
date_written="2012-08-23 08:16:47"
requires="4.73"
version="1.0"
>
</plugin>
<!-- Get our standard constants -->
<include name="constants.lua"/>
<triggers>
<trigger
name="gold_line"
enabled="y"
regexp="y"
keep_evaluating="y"
omit_from_output="y"
match="^\*\s?\d+\%\*\s?\d+\%\*\s?\d+\%\*\s?\d+(am|pm)\*\#((?P<obs>\d+) obsidian(\, ?)?((?P<plat>\d+) platinum(\, )?)?((?P<gold>\d+) gold(\, )?)?((?P<silv>\d+) silver(\, )?)?((?P<copp>\d+) copper(\, )?)?(zero)?$"
script="convert_gold"
></trigger>
</triggers>
<script>
<![CDATA[
end_of_prompt = false
function convert_gold (n, l, wc, styles)
obs = get_val(wc["obs"])
plat = get_val(wc["plat"])
gold = get_val(wc["gold"])
silv = get_val(wc["silv"])
copp = get_val(wc["copp"])
all_coin = (10000*obs) + (1000*plat) + (100*gold) + (10*silv) + copp
local coin_shown = false
for _, v in ipairs (styles) do
if (v.text=="#") then
if end_of_prompt then end_of_prompt = false
else end_of_prompt = true
end -- end if toggle
end -- found #
if not end_of_prompt then
ColourTell (RGBColourToName (v.textcolour), RGBColourToName (v.backcolour), v.text)
end
if (end_of_prompt) and (not coin_shown) then
ColourTell ("green","black","$"..all_coin)
coin_shown = true
end
end -- for each style run
Note("")
end_of_prompt = false
end
function get_val(t_str)
r_val = tonumber(t_str)
if not r_val then r_val = 0 end
return r_val
end
]]>
</script>
</muclient>
To utilize this, the matchline for the trigger needs to be a regular expression representing your prompt. And your prompt needs to have a $0#$A inserted before (and after, if there is text following the coins)
jerinx's prompt with coins wrote:
*%b%%*%c%%*%d%%*%H*$0#$A%g%n
If you need help setting up your matchine for your prompt, you can PM me with your prompt c/p'd and I'll generate a matchline (to replace the match="etc" in the trigger).
WARNING: I wrote this at 4 in the morning after being awake for 40 hours, so I wouldn't be surprised if it is buggy. The first plugin I posted, with the COINS above the prompt has been in use by at least one other player, so I trust it lots more.