Dice Roller

Started by Colin, July 30, 2009, 09:52:06 PM

Previous topic - Next topic

Colin

Actually it didn't. Give it a try on 2.0.8.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Arantor

The whole point of the change is to prevent tampering. That includes limiting previewing the dice rolls to know what you're going to have - so they get changed during the preparse step around this, specifically so that you can't just keep 'rerolling' until you get results you happen to like.
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

Colin

I think we are talking about the same thing however there was as functionality change from 2.0.8 - 2.0.9

Assuming you write the following while composing a post

[roll]1d6[/roll]

Selecting preview in an SMF 2.0.8 instance would generate the dice roll results in the preview and leave the bbc code untampered in the text area. Note that when you click post, however, it will evaluate the roll again.

However, in an SMF 2.0.9 instance it will generate the dice roll results in the preview, but update the textarea value with the [blockquote].... tag.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Arantor

QuoteSelecting preview in an SMF 2.0.8 instance would generate the dice roll results in the preview and leave the bbc code untampered in the text area. Note that when you click post, however, it will evaluate the roll again.

Yes, this much I know, because that's how I wrote it originally for just that reason: so that you can't keep rerolling until you get a result you like. And so that you can't edit afterwards. But that you could preview a post to check formatting.

QuoteHowever, in an SMF 2.0.9 instance it will generate the dice roll results in the preview, but update the textarea value with the [blockquote].... tag.

There is actually no reason for this to be occurring since none of the things that changed in 2.0.9 should have changed this, bearing in mind that I have discussed a number of aspects of it with the devs while it was being developed, but I can't say I'm that surprised.
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

Teh Lizzeh

In the quick reply preview it would originally change the coding which I am fully aware of, in the full reply, though, it wouldn't until I upgraded to 2.0.9. I'm not sure how much the upgrade actually has to do with this change, though, since that's absolutely not my area of expertise. I'm just hoping there's a way to figure out why it's doing that right now and for it to stop doing that.

jack_1985

Quote from: Colin on October 17, 2014, 05:06:06 AM
Selecting preview in an SMF 2.0.8 instance would generate the dice roll results in the preview and leave the bbc code untampered in the text area. Note that when you click post, however, it will evaluate the roll again.

However, in an SMF 2.0.9 instance it will generate the dice roll results in the preview, but update the textarea value with the [blockquote].... tag.
I stumbled upon the same problem. In my case it had something to do with an error in the file "Subs-Editor", strangely enough. One of the $txt variables in that file generated an undefined error, and for some reason that made my dice previews change into blockquotes...

jack_1985

Quote from: Teh Lizzeh on October 13, 2014, 10:38:53 PM
In version 2.0.9 the mod changes from [roll] to [blockquote] whenever a roll is previewed, this did not happen before. I realise that 2.0.9 is so new and that it hasn't been modified to fit that version yet but I was wondering if there's either an easy fix or if the mod will be updated soon?

It believe this change from 2.0.8 to 2.0.9 in the file Post.php causes the problem:

Find:

if (isset($_REQUEST['preview']))
return Post();


Replace With:
   if (isset($_REQUEST['preview']))
{
checkSession();
return Post();
}


I changed this back and the dice previewing worked again.

margarett

Do note that this is a security fix. While arguably hard to exploit, it's still a security fix.
Not saying that you should revert it, you just need to be aware of it ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Goss

Is it possible to rename the blockquote tag?  Blockquote is already a standard formatting tool for my community, so I can't have it generating that anti-cheating warning.

DizzySaxophone

I've had this mod installed on my forum for a long time. It recently stopped showing up. No button to click in the message box, and putting in the code doesn't work either. We were using 2.0.9 and it wasn't working so I went ahead and updated us to 2.0.11

Seeing as we're a tabletop rpg board it is a bit important. I thought about uninstalling the mod and reinstalling but it gave me all kinds of warning first so decided not to. Any ideas?

DizzySaxophone

I didn't have the option to edit my previous post, but I wanted to go ahead and let you know I figured it out. When we updated the coding didn't come through, but I just went through and edited the files myself and it works. Thanks!

mickie

I installed this Mod
It functions fine.
But the images are not exporting to the proper locations so the BBC button for dice has a broken image icon
I know that I can just FTP the image in.
The reason I am asking for help is that I want to edit the colors on the roller and give the edited zip file to people.
(With all proper credits intact of course. ) Along with custom themes. So that the dice roller display can actually be read.
I am currently creating themes for SMF 2.0.11
Thanks in advance

florence000

I have the same or similar problem to DizzySaxophone. I cannot see the message box button...what to do?

mickie

Problem solved. I missed a checkbox to add it to the other themes. I was just clicking through too fast  ::)

Colin

Quote from: mickie on May 05, 2017, 06:51:26 PM
Problem solved. I missed a checkbox to add it to the other themes. I was just clicking through too fast  ::)

:)
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

BShaftoe

Is this mod going to be updated for 2.1?

OtterlyAdorable

Hey!  This is an awesome tool!!  Thank you SO much for your work on it!

Are there any plans to add a "keep/drop lowest-___ rolls"?  (e.g. roll 4d6 and drop the lowest roll, or 10d6 and keep the top 6)

Colin

Quote from: BShaftoe on May 08, 2017, 07:03:52 AM
Is this mod going to be updated for 2.1?

Sure, once we get 2.1 out :)
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Colin

Quote from: OtterlyAdorable on May 15, 2017, 04:15:13 PM
Hey!  This is an awesome tool!!  Thank you SO much for your work on it!

Are there any plans to add a "keep/drop lowest-___ rolls"?  (e.g. roll 4d6 and drop the lowest roll, or 10d6 and keep the top 6)

Hmm, there wasn't, but that sounds interesting. Perhaps something to add to the wishlist. I'll open a GitHub repo and we can add some features to track.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Advertisement: