OOC Chatter

Chat, character planning, and whatever else you the player need to say publicly.
User avatar
Kaikoga Koi
Posts: 1204
Joined: Thu Jul 15, 2021 3:31 pm
Location: England

Re: OOC Chatter

Post by Kaikoga Koi » Sun Aug 01, 2021 9:27 am

Yo my dude! Welcome my dude!
Moth Clan ★ Glory 44 ★ Honour 49 ★ Status 28 ★ Courtship Points 23 ★ Scent of Lilacs, Citrus oils and Almond ★

Update: Day 13. Koi is wearing a kimono in much higher quality, lilac in hues with green lunar moths and silver lanterns. She is wearing a jade green choker. She is wearing a katana that largely is peace tied, and at night has a very fine lantern. She is being followed at all times by a Shika Guard at a distances. She wears a fine wooden carved bracelet with the Moth Clan symbol on it.

Dangerous Allure ★ Wood working tools ★ Unsavoury Past ★ Shaking Hands ★ Anxiety Attacks ★ A Purple Choker with a wooden sphere of a Moth ★

Female ★ Actress ★ Vitiligo on the left eye ★ I'd never really found a place in the outside world, but had stayed away too long to fit in at home. ★ Wait so LongProfile

User avatar
Kuni Yasu
Posts: 893
Joined: Thu Jul 08, 2021 3:34 pm

Re: OOC Chatter

Post by Kuni Yasu » Sun Aug 01, 2021 9:29 am

Moto Mitsuki wrote:
Sun Aug 01, 2021 8:54 am
Saibankan wrote:
Sun Aug 01, 2021 7:48 am
Moto Mitsuki wrote:
Sun Aug 01, 2021 7:34 am
Is it possible to add custom BbCodes to phpBB? We've got temperatures/distances conversion problems about every game, if it was possible to have something like a [temperature farenheit=85] that would automagically print 30°C/85°F in the post, that would solve the issue once and for all.
Possibly, but that's probably something I'd have to ask for the board admin to tackle, and they're rather busy. Google will translate it for me, and I'll remember to do it going forward :)
Can you check if you have the enough rights to access the page described here?

If so, add the following doublet:

Code: Select all

[fahrenheit]{NUMBER}[/fahrenheit]

Code: Select all

<form onmouseenter="result.value=' / ' + (({NUMBER}-32)*5/9).toFixed(2) + ' °C'">
<span>{NUMBER} °F</span>
<output name="result"/>
</form>
Then this one:

Code: Select all

[celsius]{NUMBER}[/celsius]

Code: Select all

<form onmouseenter="result.value=' / ' + ({NUMBER}*9/5+32).toFixed(2) + ' °F'">
<span>{NUMBER} °C</span>
<output name="result"/>
</form>
(check the box for them to be displayed among standard options, and add a helpful description text if you feel like it)

If I got my code right, from now on, typing either:

Code: Select all

[fahrenheit]85[/fahrenheit]
Or:

Code: Select all

[celsius]29[/celsius]
Should display something like (rounding is a thing) on hover*:

Code: Select all

29 °C / 85 °F
If that works well, I'll try to do a similar plugin for distances later.

*I didn't find a simple way (i.e. without adding a script tag) to have it show up directly on page load. If any coder lurking around has an idea, may they speak.
Testing the first one on my forum just does a nice job adding the °F without doing the calculation and adding the °C result. But this is quite cool. (I also may have an older version of things over there.)
Crab * Purifier * Big Lady * Face Paint * Excellent Bloodlines * Unwealthy * Friendly
Honor is the Ideal * Glory: Unremarkable Retainer * Status: 30 * CP: 16

Commonly worn: Clothes!; wakizashi with crab tsuba; small knife; scroll satchel--tied closed with blue & brown kumihimo braid and dangling apricot pit netsuke; elaborately woven ribbon tying up her hair; a jade necklace carved into a Badger head, carved wooden charms of crab and moth looped around a wrist with lavender ribbon.

Description

User avatar
Moto Mitsuki
Posts: 714
Joined: Fri Jul 16, 2021 3:35 pm

Re: OOC Chatter

Post by Moto Mitsuki » Sun Aug 01, 2021 10:48 am

Kuni Yasu wrote:
Sun Aug 01, 2021 9:29 am
Testing the first one on my forum just does a nice job adding the °F without doing the calculation and adding the °C result. But this is quite cool. (I also may have an older version of things over there.)
If it doesn't show up the conversion, is there really a point?

Here's a simpler version that might actually work (I had very much forgotten document.write() was a thing):

Code: Select all

[fahrenheit]{NUMBER}[/fahrenheit]

Code: Select all

<span>{NUMBER} °F / 
<script>document.write((({NUMBER}-32)*5/9).toFixed(2))</script>
 °C</span>

Code: Select all

[celsius]{NUMBER}[/celsius]

Code: Select all

<span>{NUMBER} °C / 
<script>document.write(({NUMBER}*9/5+32).toFixed(2))</script>
 °F</span>
Unicorn Clan | Bushi | Cavalry | Commander | Goth | Barbarian
Honor: 31 (Honor is the Ideal) | Glory: 47* (Reputable Samurai) | Status: 30 (average Great Clan samurai) | Profile
Usually dressed in white and black. Gaijin-style "daisho" (scimitar, buckler, wakizashi).
Famously Reliable/Gaijin Culture/Omen of Bad Luck

User avatar
Kuni Yasu
Posts: 893
Joined: Thu Jul 08, 2021 3:34 pm

Re: OOC Chatter

Post by Kuni Yasu » Sun Aug 01, 2021 10:52 am

Moto Mitsuki wrote:
Sun Aug 01, 2021 10:48 am
Kuni Yasu wrote:
Sun Aug 01, 2021 9:29 am
Testing the first one on my forum just does a nice job adding the °F without doing the calculation and adding the °C result. But this is quite cool. (I also may have an older version of things over there.)
If it doesn't show up the conversion, is there really a point?

Here's a simpler version that might actually work (I had very much forgotten document.write() was a thing):

Code: Select all

[fahrenheit]{NUMBER}[/fahrenheit]

Code: Select all

<span>{NUMBER} °F / 
<script>document.write((({NUMBER}-32)*5/9).toFixed(2))</script>
 °C</span>

Code: Select all

[celsius]{NUMBER}[/celsius]

Code: Select all

<span>{NUMBER} °C / 
<script>document.write(({NUMBER}*9/5+32).toFixed(2))</script>
 °F</span>
That appears to work. :)
Crab * Purifier * Big Lady * Face Paint * Excellent Bloodlines * Unwealthy * Friendly
Honor is the Ideal * Glory: Unremarkable Retainer * Status: 30 * CP: 16

Commonly worn: Clothes!; wakizashi with crab tsuba; small knife; scroll satchel--tied closed with blue & brown kumihimo braid and dangling apricot pit netsuke; elaborately woven ribbon tying up her hair; a jade necklace carved into a Badger head, carved wooden charms of crab and moth looped around a wrist with lavender ribbon.

Description

User avatar
Saibankan
Posts: 1440
Joined: Wed Dec 02, 2020 12:44 am

Re: OOC Chatter

Post by Saibankan » Sun Aug 01, 2021 2:29 pm

Moto Mitsuki wrote:
Sun Aug 01, 2021 10:48 am
Kuni Yasu wrote:
Sun Aug 01, 2021 9:29 am
Testing the first one on my forum just does a nice job adding the °F without doing the calculation and adding the °C result. But this is quite cool. (I also may have an older version of things over there.)
If it doesn't show up the conversion, is there really a point?

Here's a simpler version that might actually work (I had very much forgotten document.write() was a thing):

Code: Select all

[fahrenheit]{NUMBER}[/fahrenheit]

Code: Select all

<span>{NUMBER} °F / 
<script>document.write((({NUMBER}-32)*5/9).toFixed(2))</script>
 °C</span>

Code: Select all

[celsius]{NUMBER}[/celsius]

Code: Select all

<span>{NUMBER} °C / 
<script>document.write(({NUMBER}*9/5+32).toFixed(2))</script>
 °F</span>
Think I got it.
Non-Human * Gamemaster * Headmaster of Hope's Peak Academy * Mastermind

User avatar
Moto Mitsuki
Posts: 714
Joined: Fri Jul 16, 2021 3:35 pm

Re: OOC Chatter

Post by Moto Mitsuki » Sun Aug 01, 2021 2:31 pm

Actually...

I just finished coding a more generic plugin because we just weren't going to have a new tag for each unit. Superseding the previous code is thus here now:

Code: Select all

[unit]{REGEXP=/^[0-9a-zA-Z'"\.\s\x{00B0}]+$/u}[/unit]

<span>{REGEXP}
<script>
document.write((function () {
function convert(s){var t;if(null!==(t=s.match(/^\s*([0-9])+m\s*([0-9]+)?\s*$/)))return convert(t[1]+"."+(t[2]||0)+"m");if(null!==(t=s.match(/^\s*([0-9]+(\.[0-9]+)?)\s*((c)?m)\s*$/))){var r="m"===t[3]?100:1,a=parseFloat(t[1])*r;return(n=Math.floor(a/30.48))+"' "+(l=Math.round((a-30.48*n)/2.54))+'"'}if(null!==(t=s.match(/^\s*([0-9]+)'\s*([0-9]+)"?\s*$/))){var n=parseInt(t[1]),l=parseInt(t[2]);return Math.round(30.48*n+2.54*l)+" cm"}return null!==(t=s.match(/^\s*([0-9]+(\.[0-9]+)?)\s*°\s*C\s*$/))?(9*parseFloat(t[1])/5+32).toFixed(2)+"°F":null!==(t=s.match(/^\s*([0-9]+(\.[0-9]+)?)\s*°\s*F\s*$/))?(5*(parseFloat(t[1])-32)/9).toFixed(2)+"°C":s}

return ' / ' + convert(`{REGEXP}`);
})())
</script>
</span>
Note: There will be a warning due to using a REGEXP parameter instead of a SIMPLETEXT, which I had to because of course units are full of special characters that didn't work out of the box. Everything should still be under control even so (special characters that would allow to release the kraken are still very much forbidden; the weird one at the end is the goddamn degree symbol).

This allows to write things like:

Code: Select all

[unit]1m60[/unit]
[unit]30°C[/unit]
[unit]175cm[/unit]
[unit]5'6"[/unit]
[unit]1.85 m[/unit]
[unit]` + alert('toto'));(`[/unit]
And they will show as:

Code: Select all

1m 60 / 5' 3"
30°C / 86.00°F
175cm / 5' 9"
5'6" / 168 cm
1.85 m / 6' 1"
[unit]` + alert('toto'));(`[/unit]
Notes:
  • Only height and temperature units are supported at the moment. Local fancy numbers ("1 000,00") are not supported either. Unsupported numbers/units will simply be returned as is. Ping me if you need to add other conversions.
  • The big weird thing is just standard minified JS (i.e. with spaces removed and variable names reduced to the shortest possible), whose source is there.
Unicorn Clan | Bushi | Cavalry | Commander | Goth | Barbarian
Honor: 31 (Honor is the Ideal) | Glory: 47* (Reputable Samurai) | Status: 30 (average Great Clan samurai) | Profile
Usually dressed in white and black. Gaijin-style "daisho" (scimitar, buckler, wakizashi).
Famously Reliable/Gaijin Culture/Omen of Bad Luck

User avatar
Moto Mitsuki
Posts: 714
Joined: Fri Jul 16, 2021 3:35 pm

Re: OOC Chatter

Post by Moto Mitsuki » Sun Aug 01, 2021 2:59 pm

Quick update: I had forgotten the QWERTY keyboard did not have a ° as a default, and therefore temperatures were routinely written as 80F instead of 80°F in the US (which is another unit altogether, but that's irrelevant here).

This new code:

Code: Select all

<span>{REGEXP}
<script>
document.write((function () {
function convert(s){var t;if(null!==(t=s.match(/^\s*([0-9])+m\s*([0-9]+)?\s*$/)))return convert(t[1]+"."+(t[2]||0)+"m");if(null!==(t=s.match(/^\s*([0-9]+(\.[0-9]+)?)\s*((c)?m)\s*$/))){var r="m"===t[3]?100:1,a=parseFloat(t[1])*r;return(n=Math.floor(a/30.48))+"' "+(l=Math.round((a-30.48*n)/2.54))+'"'}if(null!==(t=s.match(/^\s*([0-9]+)'\s*([0-9]+)"?\s*$/))){var n=parseInt(t[1]),l=parseInt(t[2]);return Math.round(30.48*n+2.54*l)+" cm"}return null!==(t=s.match(/^\s*([0-9]+(\.[0-9]+)?)\s*°?\s*C\s*$/))?(9*parseFloat(t[1])/5+32).toFixed(2)+"°F":null!==(t=s.match(/^\s*([0-9]+(\.[0-9]+)?)\s*°?\s*F\s*$/))?(5*(parseFloat(t[1])-32)/9).toFixed(2)+"°C":s}

return ' / ' + convert(`{REGEXP}`);
})())
</script>
</span>
Should take care of that:

Code: Select all

[unit]80F[/unit]
[unit]15C[/unit]

Code: Select all

80F / 26.67°C
15C / 59.00°F
On that I'll stop polluting the OOC thread.
Unicorn Clan | Bushi | Cavalry | Commander | Goth | Barbarian
Honor: 31 (Honor is the Ideal) | Glory: 47* (Reputable Samurai) | Status: 30 (average Great Clan samurai) | Profile
Usually dressed in white and black. Gaijin-style "daisho" (scimitar, buckler, wakizashi).
Famously Reliable/Gaijin Culture/Omen of Bad Luck

User avatar
Kitsu Murato
Posts: 2336
Joined: Sun Jul 18, 2021 1:56 am

Re: OOC Chatter

Post by Kitsu Murato » Sun Aug 01, 2021 4:09 pm

Saibankan wrote:
Sun Aug 01, 2021 3:40 pm
Usogawa Narumi wrote:
Sun Aug 01, 2021 1:37 pm
I saw the Moth mon colours were added? The Otter colours are....?
At the discretion of the daughter of the Otter clan champion, but she should ask her fellow otters what they think would be good.
River mud brown and otter fur brown?
Lion Clan * Bard * Bureaucrat * Spiritual * Haunted * Clumsy * Kitsu Honest * Kitsu Eyes
Honor Is the Ideal 59 | Unremarkable Retainer 44 | Imperial Descended Great Clan Samurai 45 | Description
Equipment: Traveling Clothes, Wakizashi, Katana, Tessen, Yumi & arrows, Shamisen, Helix Piercing Orange Earrings, Shamisen

User avatar
Kuni Yasu
Posts: 893
Joined: Thu Jul 08, 2021 3:34 pm

Re: OOC Chatter

Post by Kuni Yasu » Sun Aug 01, 2021 4:50 pm

Kitsu Murato wrote:
Sun Aug 01, 2021 4:09 pm
Saibankan wrote:
Sun Aug 01, 2021 3:40 pm
Usogawa Narumi wrote:
Sun Aug 01, 2021 1:37 pm
I saw the Moth mon colours were added? The Otter colours are....?
At the discretion of the daughter of the Otter clan champion, but she should ask her fellow otters what they think would be good.
River mud brown and otter fur brown?
And the rainbow of Friendship! (tm)

Kidding aside, I'd expect entertainers to end up with some bright colors. Even if the shades of brown amuses me.

Also: <3 at Moto-san for all the coding nerdery.
Crab * Purifier * Big Lady * Face Paint * Excellent Bloodlines * Unwealthy * Friendly
Honor is the Ideal * Glory: Unremarkable Retainer * Status: 30 * CP: 16

Commonly worn: Clothes!; wakizashi with crab tsuba; small knife; scroll satchel--tied closed with blue & brown kumihimo braid and dangling apricot pit netsuke; elaborately woven ribbon tying up her hair; a jade necklace carved into a Badger head, carved wooden charms of crab and moth looped around a wrist with lavender ribbon.

Description

User avatar
Moto Mitsuki
Posts: 714
Joined: Fri Jul 16, 2021 3:35 pm

Re: OOC Chatter

Post by Moto Mitsuki » Sun Aug 01, 2021 6:13 pm

Kuni Yasu wrote:
Sun Aug 01, 2021 4:50 pm

Also: <3 at Moto-san for all the coding nerdery.
It works in real life apparently:

Code: Select all

Mitsuki is [unit]1m60[/unit].
Result: Mitsuki is 1m60.

Last version of the plugin should be there: https://github.com/ceithir/bbcode-unit And now this link has been publicly given, we can return to our normal schedule.
Unicorn Clan | Bushi | Cavalry | Commander | Goth | Barbarian
Honor: 31 (Honor is the Ideal) | Glory: 47* (Reputable Samurai) | Status: 30 (average Great Clan samurai) | Profile
Usually dressed in white and black. Gaijin-style "daisho" (scimitar, buckler, wakizashi).
Famously Reliable/Gaijin Culture/Omen of Bad Luck

Post Reply