vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Roll Dice Hack (Great for RPG boards) (https://vborg.vbsupport.ru/showthread.php?t=61668)

Madacc 02-16-2004 10:00 PM

Roll Dice Hack (Great for RPG boards)
 
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 02-17-2004 08:05 PM

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 02-17-2004 08:12 PM

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 02-17-2004 10:40 PM

Snap...just noticed this is for vB2 and not vB3. Oh well...

Gio Takahashi 02-18-2004 01:55 AM

Wow o_O So it did. I was so hoping its for vB3.

...Make it for vb3!

Madacc 02-18-2004 02:52 AM

Quote:

Originally Posted by Gio Takahashi
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 02-18-2004 12:39 PM

What is the point?>

Hoffi 02-18-2004 07:41 PM

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 02-19-2004 03:17 PM

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 02-19-2004 04:46 PM

Quote:

Originally Posted by Sylvus
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.


All times are GMT. The time now is 03:10 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01117 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete