PDA

View Full Version : Roll Dice Hack (Great for RPG boards)


Madacc
17 Feb 2004, 21:55
Here's a hack I made in a few days. Basically, this hack allows you to roll dice in a thread. This will be a great addition to many RPG and D&D style boards, but will also work great for really any board that wants a fun dice rolling system. It is very secure, and this was tested by many of our members. As far as I know, there is no way to cheat this system or rig your roll.

NOTE: Boards that allow HTML in threads will be vunerable to cheaters. This system displays a unique HTML style border that cannot be created in threads when HTML is not allowed. If it is allowed, people could copy the exact look of the post and it would be impossible to tell the difference between a real roll and a rigged roll.

This is my first hack so go easy on me. ;)

This hack should only take about 10 minutes to install. It's pretty quick.

To roll the dice, use the following syntax as your post: /roll <low number> <high number>

Here's an example dice roll:

/roll 200 500

Make sure to include nothing else in your post or you'll get an error. I hope you enjoy this hack!

Hoffi
17 Feb 2004, 22:05
Hi Madacc,

basicly i am looking for such a Hack. The Problem I see is, that the Dice is not stored in the Database outside the Post-Text so that it can be edited and always shown the same number after rolling once the dice.

Madacc
17 Feb 2004, 22:12
Hoffi,

The way the system works is simple. It stores the number as part of the post after the first roll and disallows editting of your post that contains a rolled dice. I did this to make the system a little easier to work with, therefore not needing to manipulate the database. I assure you the system works exactly how you think it should. You'll see once you install it. :)

AutomatikStudio
18 Feb 2004, 00:40
Snap...just noticed this is for vB2 and not vB3. Oh well...

Gio Takahashi
18 Feb 2004, 03:55
Wow o_O So it did. I was so hoping its for vB3.

...Make it for vb3!

Madacc
18 Feb 2004, 04:52
Wow o_O So it did. I was so hoping its for vB3.

...Make it for vb3!

I'll see what I can do ;)

gmarik
18 Feb 2004, 14:39
What is the point?>

Hoffi
18 Feb 2004, 21:41
OK, but i see its for vB2. Too bad.
The Thing that you disallow editing after Rolling a Dice is a way, but I find this way not perfect. But thats only my opinion.

Sylvus
19 Feb 2004, 17:17
So if someone wanted to roll an 18, they could simply do a

/roll 18 18

and always get the number they wanted. Or if you required them to roll a six-sided dice, the highest roll wins, anyone could do

/roll 6 6

This is not great for any RPG board.

The proper way to do this is to hard code each roll based on the combination of dice provided for RPG games.

1d4
1d6
1d8
1d10
1d12
1d20
1d100

This stops anyone from generating a high number based on the selection of <low number> <high number> and always getting the result they want.

Example #1:

Player using <low number> <high number>

"Please roll a d20, you require an 18, 19 or 20 to make the jump across the river!"

/roll 18 20

Rolls a 19!

WOW! He made it!

Example #2 (hard coded 1d#):

"Please roll a d20, you require an 18, 19 or 20 to make the jump across the river!"

/roll d20

Rolls a 4.

See my point?

I'd like your permission to modify the code you've provided and make it a real dice roller based on the d4, d6, d8, d10, d12, d20, d100 dice given in true RPG games, not a <low number> <high number> system that can easilly be exploited.

Syl...

Madacc
19 Feb 2004, 18:46
So if someone wanted to roll an 18, they could simply do a

/roll 18 18

and always get the number they wanted. Or if you required them to roll a six-sided dice, the highest roll wins, anyone could do

/roll 6 6

This is not great for any RPG board.

The proper way to do this is to hard code each roll based on the combination of dice provided for RPG games.

1d4
1d6
1d8
1d10
1d12
1d20
1d100

This stops anyone from generating a high number based on the selection of <low number> <high number> and always getting the result they want.

Example #1:

Player using <low number> <high number>

"Please roll a d20, you require an 18, 19 or 20 to make the jump across the river!"

/roll 18 20

Rolls a 19!

WOW! He made it!

Example #2 (hard coded 1d#):

"Please roll a d20, you require an 18, 19 or 20 to make the jump across the river!"

/roll d20

Rolls a 4.

See my point?

I'd like your permission to modify the code you've provided and make it a real dice roller based on the d4, d6, d8, d10, d12, d20, d100 dice given in true RPG games, not a <low number> <high number> system that can easilly be exploited.

Syl...

But you see, if the rules stated to roll a d20, and they typed /roll 18 20 the message would state:

-------------------------------------------------------------
** A Magic Die is rolled by Person
** It could have been any number from 18 to 20 and it turned up a 18
-------------------------------------------------------------

And as you can see, he didn't roll correctly. Everyone can see that he rolled 18-20 which is not correct. So, if you state the ground rules, d20 = /roll 1 20 then you can easily catch bad rolls.

Holidazed
22 Feb 2004, 04:37
But you see, if the rules stated to roll a d20, and they typed /roll 18 20 the message would state:

-------------------------------------------------------------
** A Magic Die is rolled by Person
** It could have been any number from 18 to 20 and it turned up a 18
-------------------------------------------------------------

And as you can see, he didn't roll correctly. Everyone can see that he rolled 18-20 which is not correct. So, if you state the ground rules, d20 = /roll 1 20 then you can easily catch bad rolls.
Any plans to make this vbb3.0 compatible?

In addition, it would be nice if the dice roll did not have to be on a post by itself. Maybe on its own line, but by itself makes it hard. Afterall, the user has to post his move in the rpg and then make a seperate post with his dice roll? A bit cumbersome.

Holidazed
26 Feb 2004, 02:35
Is anybody supporting this hack?

rikku3978
12 Mar 2004, 03:32
I installed it. It's pretty cool in the forums game board, but it would be spam elsewhere.

I installed it for a seperate game, and it seems popular amoung members.

Pretty cool hack ^-^
Edit: Oh, but if you aren't using html in your board, you have to edit some of the code >_>

Holidazed
29 Apr 2004, 23:41
hello? Any chance of this becoming v3.01 compatible?

Madacc
05 May 2004, 21:10
I'm going to make a vb3 version and release it very soon, just to keep you all updated.

Holidazed
06 May 2004, 17:56
How about if inside the post, the user puts a /roll1d6 (or something like that) on a line by itself, the system rolls a dice and makes it a seperate post that cannot be edited. This way the user can continue to edit his/her own post, but not modify the dice roll.

In addition, we might be able to set the diceroll to be posted by the user we choose (Like user: Dicebot). We make the user, and tell the hack the user id we want the rolls to be posted by.


Or, instead of using the "/roll" command, maybe an option on the "Reply to Post / New Post / Edit Post" screens to roll a dice.

Have a field for them to put in the sides of the dice and another field for how many to roll.

In addition, have a comment field so when we see the diceroll in a post, we know what it was rolled for.

If you do this, maybe have an admin option for setting which usergroups can roll dice.

Maybe an option for seperate dicerolls in the same post (with comments).

Cool?

Madacc
06 May 2004, 19:17
How about if inside the post, the user puts a /roll1d6 (or something like that) on a line by itself, the system rolls a dice and makes it a seperate post that cannot be edited. This way the user can continue to edit his/her own post, but not modify the dice roll.

In addition, we might be able to set the diceroll to be posted by the user we choose (Like user: Dicebot). We make the user, and tell the hack the user id we want the rolls to be posted by.


Or, instead of using the "/roll" command, maybe an option on the "Reply to Post / New Post / Edit Post" screens to roll a dice.

Have a field for them to put in the sides of the dice and another field for how many to roll.

In addition, have a comment field so when we see the diceroll in a post, we know what it was rolled for.

If you do this, maybe have an admin option for setting which usergroups can roll dice.

Maybe an option for seperate dicerolls in the same post (with comments).

Cool?

Don't worry, I'm almost done and the system is 100% more solid and fool proof than the previous. It's now an option when you go to post, with text boxes, and it's unedittable (stores the dice roll in the database). Should be done by tonight or tomorrow.

Holidazed
06 May 2004, 22:22
Sweet! Thank you. What about my ideas? Are any of them going to be in this release?

Madacc
06 May 2004, 22:29
Basically the way I'm designing it is like this:

As one of the options when replying or posting a thread is a "Dice Roll" option. Basically there are 2 text boxes, one for the minimum roll and one for the maximum. If you enter them in with your post, you will roll the dice as part of the post, which appears above your post message. When you go to edit your post, just your message appears in your message box and it shows what you rolled where you could originally make your roll (where the option was), that way you can't edit it.

So essentially the vb3 system will feature:

- Uneditable dice rolls
- "Dotted border" style for the dice rolls, therefore as to make it hard to dupe. If you have any other anti-duping method ideas feel free to throw them out there.
- You can make a post WITH your dice roll
- Much more secure and solid

Holidazed
07 May 2004, 13:53
Very cool. Can't wait.

Holidazed
10 May 2004, 17:18
Madacc, what is the status? I am ancipating this release. Can't wait.

Madacc
10 May 2004, 18:51
I ran into a few interesting problems. I'm still trying to work everything out. I don't want to release a buggy hack. It won't be much longer. :)

Holidazed
10 May 2004, 18:54
Cool! I would rather it was not buggy too. lol

Holidazed
17 May 2004, 16:13
Madacc, hows it going with this hack?

Holidazed
25 May 2004, 22:31
Madacc, any idea when this hack will be done?

Holidazed
01 Jul 2004, 01:51
Whoa, it has been awhile.

Madaac?
Are you ok?
Have not head from you in awhile.
How is the hack going?
Is there something I can do to help speed this along?

Holidazed
11 Jul 2006, 18:02
I guess Madaac vanished into the Phantom Zone. Bummer.