[ABD] hanelyp fancy dice

Any abandoned Extensions will be moved to this forum.

WARNING: Extensions in this forum are not currently being supported or maintained by the original Extension author. Proceed at your own risk.
Forum rules
IMPORTANT: Extension Development Forum rules

WARNING: Extensions in this forum are not currently being supported nor updated by the original Extension author. Proceed at your own risk.
Locked
poenn
Registered User
Posts: 30
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] hanelyp fancy dice

Post by poenn » Thu Jun 18, 2015 1:16 pm

Hi, I am currently testing your dice extension and it seems to work fine so far. I would like to ask a question:

I am using the Ajax Shoutbox Extension from Paul Sohier (http://www.ajax-shoutbox.com) and I would like to roll dice in there. It works fine if I type [dice]1d6[/dice] for example. It is just that it is really cumbersome to always type the whole thing. Is there any way I could reduce this to something like

roll 1d6

With phpBB 3.0.x I used blueimp’s AJAX Chat which had a dice roller included and it used this syntax.

Thanks
poenn

PS: I just updated tp phpBB 3.1.5. Seems like this version breaks your extension. It is no longer working and just displays the bbcode like [dice]1d6[/dice] instead of the actual result.

User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [BETA] hanelyp fancy dice

Post by hanelyp » Thu Jun 18, 2015 4:34 pm

I just verified my fresh install of phpBB3.1.5 with this extension is working. My first guess is the upgrade from an earlier version corrupted the bbcode spec. There's an ACP tool with this extension to reset a corrupted bbcode.

regarding support for syntax

Code: Select all

roll 3d6
I don't expect it would be difficult to pick up with the way I'm processing posts, but it would then pick up every time a user used the word "roll", which I don't expect is what you want. The roll spec syntax supported potentially includes any word and a fair amount of syntactical markup, making a more specific match difficult.

poenn
Registered User
Posts: 30
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] hanelyp fancy dice

Post by poenn » Thu Jun 18, 2015 4:50 pm

You were right, resetting the bbcode did the trick. It would be perfectly fine to use the word roll since our board is in german and would almost never use that word in regular sentences. Of course, it would be super-awesome to have it user definable like roll 1d6 or whatever 3d12. ;) I forgot to mention that using roll without parameters should just assume 1d6, that would be icing on the cake!

Thanks for your help!
poenn

PS: All the tests I have done with 1d6 always gave me 4 as a result. Is that just coincidence? I tried in the chat area as well as in regular threads.

User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [BETA] hanelyp fancy dice

Post by hanelyp » Thu Jun 18, 2015 5:36 pm

Each new post, and each new roll within a post, should have a new random seed. If you preview a post, delete and reroll it should come back with the same result. If you're getting different results copy me the raw code of a post exhibiting the bug.

As an alternate to

Code: Select all

roll 3d6
I'm thinking

Code: Select all

[roll 3d6]
Without the extra syntax it would have to be a board setting, default off.

poenn
Registered User
Posts: 30
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] hanelyp fancy dice

Post by poenn » Sat Jun 20, 2015 10:11 am

Thanks, hanelyp!

I noticed that it seems to only happen in the shoutbox. If you roll a dice several times it very often gives the same result. If you wait a while in between rolling dice you get a different result which will stay for a while as well. Since you can’t add attachments here, I have uploaded you 2 screenshots:

Image
Image

koraldon
Registered User
Posts: 509
Joined: Sat Jun 30, 2007 12:42 pm

Re: [BETA] hanelyp fancy dice

Post by koraldon » Sat Jun 20, 2015 11:40 am

I have enabled phpbb debug and now I get a notice that there is an undefined offset in two lines in main.event.listener or something like that -/FYI

User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [BETA] hanelyp fancy dice

Post by hanelyp » Mon Jun 22, 2015 5:47 pm

koraldon wrote:I have enabled phpbb debug and now I get a notice that there is an undefined offset in two lines in main.event.listener or something like that -/FYI
It's not showing up in the error log on my development server. Could be a difference in how our servers are set up. A quote of the notice would be helpful.

User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [BETA] hanelyp fancy dice

Post by hanelyp » Mon Jun 22, 2015 6:00 pm

poenn wrote:Thanks, hanelyp!

I noticed that it seems to only happen in the shoutbox. If you roll a dice several times it very often gives the same result. If you wait a while in between rolling dice you get a different result which will stay for a while as well. Since you can’t add attachments here, I have uploaded you 2 screenshots:

Image
Image
Apparently that extension is doing something my code isn't expecting. If each roll in shoutbox is being processed as an independent mini-post that would break the code used to generate random seeds but not let a user keep reloading a preview until they get a roll they like. An extension that was aware of the dice extension might get around that.

I may have a patch, but it'll need some testing to be sure it doesn't break anything.

poenn
Registered User
Posts: 30
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] hanelyp fancy dice

Post by poenn » Tue Jun 23, 2015 12:25 pm

You are awesome! Thanks for the explanation and all your work. Just let me know if you need any more information. I am willing to test and help. ;)

User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [BETA] hanelyp fancy dice

Post by hanelyp » Tue Jun 23, 2015 3:39 pm

poenn, I tried to install shoutbox on my phpbb3.1.5 test board to see if my patch to fancydice made any difference. It crashed the board with php errors making activation impossible.

edit:
there was a problem relating to file permissions from the distribution package. shoutbox is installed and activated on my test board, and doesn't show outside the ACP.

poenn
Registered User
Posts: 30
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] hanelyp fancy dice

Post by poenn » Wed Jun 24, 2015 8:53 am

You need to set the privileges for the shoutbox to show up. I was wondering that myself when I installed it. In the ACP go to Permissions/Group Permissions and select the correct group (Administrators, Registered Users) that applies to your user. Then click on Advanced Permissions and you will see the checkboxes. The screenshot is from my german install, but you will get the idea:

Image

User avatar
hanelyp
Registered User
Posts: 124
Joined: Wed Apr 02, 2014 10:20 pm

Re: [BETA] hanelyp fancy dice

Post by hanelyp » Wed Jun 24, 2015 3:55 pm

shoutbox is still not working. There should be install instructions somewhere, but I haven't found them.

ntvy95
Registered User
Posts: 69
Joined: Wed Jun 10, 2015 12:58 pm

Re: [BETA] hanelyp fancy dice

Post by ntvy95 » Sat Jun 27, 2015 12:03 am

Hello, me again. I have installed your extension on my board and have done little test. Here is some features of the extension that I think they wouldn't be expected:

- The ability to preview the dice result and this result can be "moved" around the forum among different topics. => I believe the users can cheat upon this.

- If the poster is "A" and then the me "B" - a moderator / an administrator / whoever has the permission to edit the post of "A" can change the dice result.

- The result of the dice can be changed by the edition from the poster (or anyone else) after a while (maybe hours / half day for example).

- I can copy something like:

Code: Select all

[dice seed=54721 secure=1b58ae70_0]1d6[/dice]
to cheat the result without much thinking of it by the way.

Thanks in advance for reading this post. :D

poenn
Registered User
Posts: 30
Joined: Thu Oct 30, 2014 8:40 am

Re: [BETA] hanelyp fancy dice

Post by poenn » Sat Jun 27, 2015 7:12 am

Hi hanelyp,

there are instructions at http://www.ajax-shoutbox.com
There are some people with the shoutbox not showing up. I believe it was mostly due to non-prosilver themes. Sorry for the trouble, I just think your Extension is a perfect fit for the shoutbox as well as the regular forum.

allannon
Registered User
Posts: 1
Joined: Wed Jul 01, 2015 12:26 am

Re: [BETA] hanelyp fancy dice

Post by allannon » Wed Jul 01, 2015 12:46 am

I found something that seems like an unexpected behavior: whenever I have compound rolls with unqualified numbers, it will use any preceding number (including the result of the first roll) as the number of dice for the second roll.

d6 or d6+4 work fine.

However, 4+d6 yields 4d6. When multiple die types are rolled, e.g. d4+d6, I get a random number up to the first die type of the second die as a result.

If you qualify the dice, e.g. 1d4+1d6, it seems to work so there's an easy solution, but it would be nice if when parsing rolls it stopped at any non-numeric character.

phpBB 3.1.5
Fancy Dice 0.9.0 (installed yesterday evening from github download zip link)
php 5.6.9

Locked

Return to “Abandoned Extensions”