Shattered Kingdoms
https://www.shatteredkingdoms.org/forums/

Prompts
https://www.shatteredkingdoms.org/forums/viewtopic.php?f=21&t=13480
Page 7 of 9

Author:  zryych [ Sun Oct 16, 2011 3:52 pm ]
Post subject:  Re: Prompts

j3r3myp1pp3n wrote:
zryych wrote:
Showing the amount of money you have takes up a rather excessive amount of space, at least the way I'm doing it. Is there any way to make it more compact like how one does business with the bank? (1 obsidian, 4 platinum, 5 gold, 2 silver, 9 copper just becomes 14529 {copper})

what client do you use?


MUSHClient

Author:  j3r3myp1pp3n [ Sun Oct 16, 2011 4:01 pm ]
Post subject:  Re: Prompts

zryych wrote:
j3r3myp1pp3n wrote:
zryych wrote:
Showing the amount of money you have takes up a rather excessive amount of space, at least the way I'm doing it. Is there any way to make it more compact like how one does business with the bank? (1 obsidian, 4 platinum, 5 gold, 2 silver, 9 copper just becomes 14529 {copper})

what client do you use?


MUSHClient

I will get back into scripting a little to get this done for you. Don't expect it anytime soon, though, as the weekend is over and I'm busy throughout the week. Maybe someone else would take up the little project for you.

Author:  zryych [ Sun Oct 16, 2011 4:15 pm ]
Post subject:  Re: Prompts

I'll assume that means that there most likely isn't a SK defined way to do that?
You definitely don't have to go to that much trouble on my behalf for something like that, though I appreciate the offer.
As it stands now, I just rarely ever put coins in my prompt as I generally prefer time and date info. Maybe if enough people would prefer the abbreviated version, it could be changed so everybody could get the shortened prompt.

Author:  Teh_Peso [ Thu Nov 24, 2011 8:56 pm ]
Post subject:  Re: Prompts

Quote:
prompt [$4Blood:$4$I$B%b%%$A $5Power:$5$I%c%%$A $1Walkin:$1$I%d%%$A][$7$I%r]%n


My warrior prompt, yey blinking

Author:  TheBladeMasta [ Fri Nov 25, 2011 5:27 pm ]
Post subject:  Re: Prompts

My warrior prompt
I dull down the colors by preference, I find it harder to differentiate numbers at a glance if they are too bright.
Code:
prompt $0$I-{$4Health:$3%b$0$I\ -{$5Magic:$5$I%c$0$I|$2%d$6:Move$0$I}- $A%r%n$A%g%n>


No flash blinkys like in Pesos but I like it :D

Author:  The_Illustrated_Man [ Thu Dec 29, 2011 3:47 pm ]
Post subject:  Re: Prompts

I always use this one, works great for me.

Code:
prompt [$4$IHealth$A:%b][$1$IMana$A:%c][$6$IPower$A:%d][$7$ITime$A:%H]%n>


Looks like this with color

Code:
[Health:100][Mana:100][Power:100][Time:6pm]
>

Author:  forgemccain [ Sun Mar 04, 2012 11:23 am ]
Post subject:  Re:

Cyra wrote:
Yeah.


Code:
Obvious exits: n(closed) w
     The latest dispatches are pinned upon the southern wall.
     An polished oval table stands in the centre of the chamber.
(Charmed) A small kitten with mischievous eyes is here.

Health 100 Mana 100 Movement 100
exit
North     - The Justiciar's Office
West      - A Torch-lit Hall


Hmmm was there a code to add that?

Author:  Dragonite2012 [ Thu Aug 23, 2012 5:36 am ]
Post subject:  Re: Prompts

I know this thread is a little old, but here is mine...

Quote:
prompt COINS: %g%n$5[$2HP %b%%$5][$3ME %c%%$5][$6PE %d%%$5]$A[%H%5]%r%n$A>%n

Quote:
COINS: 239
[HP 100%][ME 100%][PE 100%][11pm ] The Termite Nest
>


The above uses a plugin script on MUSHClient (in Lua) to compile the "gold" line into a single value....

Quote:
<?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="^COINS: ((?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[

function convert_gold (n, l, wc)

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

ColourNote("WHITE","BLACK","COINS: "..all_coin)

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>

Author:  zryych [ Fri Sep 07, 2012 6:58 am ]
Post subject:  Re: Prompts

This is pretty nice, but it would be even nicer if this was just the standard way that this info was presented in the prompt. I prefer to keep my prompt on one line and there doesn't seem to be any way to accomplish both the single line and the non-obnoxious money presentation.

Author:  Dragonite2012 [ Sat Sep 08, 2012 12:30 am ]
Post subject:  Re: Prompts

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.

Page 7 of 9 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/