OOC Chatter
- Kaikoga Koi
- Posts: 1204
- Joined: Thu Jul 15, 2021 3:31 pm
- Location: England
Re: OOC Chatter
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 Long ★ Profile ★
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 Long ★ Profile ★
Re: OOC Chatter
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.)Moto Mitsuki wrote: ↑Sun Aug 01, 2021 8:54 amCan you check if you have the enough rights to access the page described here?Saibankan wrote: ↑Sun Aug 01, 2021 7:48 amPossibly, 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 forwardMoto Mitsuki wrote: ↑Sun Aug 01, 2021 7:34 amIs 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.![]()
If so, add the following doublet:
Code: Select all
[fahrenheit]{NUMBER}[/fahrenheit]
Then this one:Code: Select all
<form onmouseenter="result.value=' / ' + (({NUMBER}-32)*5/9).toFixed(2) + ' °C'"> <span>{NUMBER} °F</span> <output name="result"/> </form>
Code: Select all
[celsius]{NUMBER}[/celsius]
(check the box for them to be displayed among standard options, and add a helpful description text if you feel like it)Code: Select all
<form onmouseenter="result.value=' / ' + ({NUMBER}*9/5+32).toFixed(2) + ' °F'"> <span>{NUMBER} °C</span> <output name="result"/> </form>
If I got my code right, from now on, typing either:Or:Code: Select all
[fahrenheit]85[/fahrenheit]
Should display something like (rounding is a thing) on hover*:Code: Select all
[celsius]29[/celsius]
If that works well, I'll try to do a similar plugin for distances later.Code: Select all
29 °C / 85 °F
*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.
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
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
- Moto Mitsuki
- Posts: 714
- Joined: Fri Jul 16, 2021 3:35 pm
Re: OOC Chatter
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
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
Re: OOC Chatter
That appears to work.Moto Mitsuki wrote: ↑Sun Aug 01, 2021 10:48 amIf 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>

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
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
Re: OOC Chatter
Think I got it.Moto Mitsuki wrote: ↑Sun Aug 01, 2021 10:48 amIf 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>
Non-Human * Gamemaster * Headmaster of Hope's Peak Academy * Mastermind
- Moto Mitsuki
- Posts: 714
- Joined: Fri Jul 16, 2021 3:35 pm
Re: OOC Chatter
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:
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:
And they will show as:
Notes:
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>
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]
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]
- 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
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
- Moto Mitsuki
- Posts: 714
- Joined: Fri Jul 16, 2021 3:35 pm
Re: OOC Chatter
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:
Should take care of that:
On that I'll stop polluting the OOC thread.
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>
Code: Select all
[unit]80F[/unit]
[unit]15C[/unit]
Code: Select all
80F / 26.67°C
15C / 59.00°F
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
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
- Kitsu Murato
- Posts: 2336
- Joined: Sun Jul 18, 2021 1:56 am
Re: OOC Chatter
River mud brown and otter fur brown?Saibankan wrote: ↑Sun Aug 01, 2021 3:40 pmAt the discretion of the daughter of the Otter clan champion, but she should ask her fellow otters what they think would be good.Usogawa Narumi wrote: ↑Sun Aug 01, 2021 1:37 pmI saw the Moth mon colours were added? The Otter colours are....?
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
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
Re: OOC Chatter
And the rainbow of Friendship! (tm)Kitsu Murato wrote: ↑Sun Aug 01, 2021 4:09 pmRiver mud brown and otter fur brown?Saibankan wrote: ↑Sun Aug 01, 2021 3:40 pmAt the discretion of the daughter of the Otter clan champion, but she should ask her fellow otters what they think would be good.Usogawa Narumi wrote: ↑Sun Aug 01, 2021 1:37 pmI saw the Moth mon colours were added? The Otter colours are....?
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
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
- Moto Mitsuki
- Posts: 714
- Joined: Fri Jul 16, 2021 3:35 pm
Re: OOC Chatter
It works in real life apparently:
Code: Select all
Mitsuki is [unit]1m60[/unit].
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
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