Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Dice Roller [BBCode] Details »»
Dice Roller [BBCode]
Version: 1.00, by DragonBlade DragonBlade is offline
Developer Last Online: Oct 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 4.0.x Rating:
Released: 06-23-2010 Last Update: Never Installs: 35
DB Changes Uses Plugins
Additional Files  
No support by the author.

Original:
https://vborg.vbsupport.ru/showthread.php?t=113972
https://vborg.vbsupport.ru/showpost....&postcount=167

With tuxz0r's permission, I have ported his version of his dice roll mod for vb 4.0. This also fixes the first post issue.

Shameless copy paste from tuxz0r's post:
This mod uses the standard AdX+B notation where

A = the number of dice to roll (1 if not present)
X = the number of faces on the dice
B = represents a modifier, usually a + or - but also a divides or multiply.

I also need it to do certain things like, only show the sum/result of the roll or show all the die results and the sum of the roll. I also wanted the ability to do open rolls, e.g. if you roll 6, six sided die, you keep rerolling any dice that come up a 6.

So, basically, I have concocted three different bbcodes in one product:
[roll]1d4[/roll] - for rolling and showing only the results or sum
[rollv]1d4[/rollv] - for rolling and seeing the result of each dice as well as the sum
[rollo]1d4[/rollo] - for open rolls

Each of these takes and optional label for the roll, to be included in the tag after the '=' sign, e.g. [roll=to hit]4d6[/roll] and so forth. It is, however, optional as the actual notation for the roll is displayed before the results in the final posting.

So, for example, you can enter rolls like the following:

[roll]4d6[/roll] to get the sum of 4 six sided die.
[roll]d%[/roll] for a percentage roll (same as 1d100)
[roll]4d6b3[/roll] to roll 4 six sided dice and only sum the "best" three results

Installation:
1. Upload class_dice.php into vb's includes folder.
1. Import product-dice.xml.

Download Now

File Type: zip product-dice.zip (3.1 KB, 243 views)

Screenshots

File Type: jpg diceroll.jpg (36.5 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 06-24-2010, 10:31 AM
sulasno sulasno is offline
 
Join Date: Feb 2010
Posts: 588
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

tagged and thanks

what can I do with this Mod ?
Reply With Quote
  #3  
Old 06-24-2010, 11:49 AM
thunder28 thunder28 is offline
 
Join Date: Sep 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its fine for roleplaying sites:-)

if is possible i can see the results for each dice?
I roll 3d10 the output is: 3,6,9, = 18

thx for this mod.
Reply With Quote
  #4  
Old 06-24-2010, 04:58 PM
Daryn Daryn is offline
 
Join Date: Nov 2008
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I seem to have found a small bug. If you add another roll to an existing post it will not do the roll but only shows the bbcode. You can do multiple rolls in one post, but you can't seem to add additional rolls to an existing one.

It also doesn't seem to work if I forget to add a roll into a post I made and then edit the post and add the roll.

Also, there is no way for me to explain how to use the bbcode on the forum because the Code, HTML, do not show the code, but instead show [roll0,1,2,3,4] depending on how many rolls are in that post.
Reply With Quote
  #5  
Old 06-24-2010, 10:19 PM
DragonBlade's Avatar
DragonBlade DragonBlade is offline
 
Join Date: May 2006
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thunder28 View Post
Its fine for roleplaying sites:-)

if is possible i can see the results for each dice?
I roll 3d10 the output is: 3,6,9, = 18

thx for this mod.
Yes, use [rollv]1d4[/rollv]

Quote:
Originally Posted by Daryn View Post
I seem to have found a small bug. If you add another roll to an existing post it will not do the roll but only shows the bbcode. You can do multiple rolls in one post, but you can't seem to add additional rolls to an existing one.

It also doesn't seem to work if I forget to add a roll into a post I made and then edit the post and add the roll.

Also, there is no way for me to explain how to use the bbcode on the forum because the Code, HTML, do not show the code, but instead show [roll0,1,2,3,4] depending on how many rolls are in that post.
I believe the previous mod never supported adding in edited rolls and the bbcode parses, ignoring other bbcodes like noparse. I could change this later but for now, I just wanted to port this over for vb4.0
Reply With Quote
  #6  
Old 06-25-2010, 01:43 AM
Daryn Daryn is offline
 
Join Date: Nov 2008
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DragonBlade View Post
Yes, use [rollv]1d4[/rollv]



I believe the previous mod never supported adding in edited rolls and the bbcode parses, ignoring other bbcodes like noparse. I could change this later but for now, I just wanted to port this over for vb4.0
Oh I totally appreciate the port. I just thought that I would post what I ran across in my tests.
Reply With Quote
  #7  
Old 07-28-2010, 06:20 PM
Scathefire Scathefire is offline
 
Join Date: Oct 2006
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like this.

Would it be difficult to adjust for 3.8.x? I've not moved to the 4 series yet.
Reply With Quote
  #8  
Old 08-20-2010, 12:38 AM
Willy T Willy T is offline
 
Join Date: Nov 2009
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having a bit of issue with the dice, namely the 2d6b1, as it always rolls a "0"

it SHOULD be rolling 2 6-sided dice, and picking the better of the two results...

if you can assist with a fix or tell me what I am doing wrong, I would greatly appreciate it.
Reply With Quote
  #9  
Old 09-20-2010, 05:53 AM
Kodai Okuda Kodai Okuda is offline
 
Join Date: Sep 2010
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack does not work in vB 4.0.6.

I've tried the original code by Eikinskjaldi and it doesn't work either.

Not that that's surprising considering it was for vB 3.4/3.5.

My question is, does anyone have an updated version of this particular dice roller that will work in version 4.0.6/4.0.7

I ask because the current versions are far too buggy to be useful and I really need a dice roller for my free online RPG system.

Thanks in advance.
Reply With Quote
  #10  
Old 02-12-2011, 09:28 PM
Eq4bits Eq4bits is offline
 
Join Date: May 2006
Posts: 468
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*installed*
works fine in 4.08
yeah I need to upgrade but haven't had the time to =S
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07507 seconds
  • Memory Usage 2,313KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete