vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   looking for dice roller BBcode (https://vborg.vbsupport.ru/showthread.php?t=263280)

Mv.c9 05-07-2011 09:09 AM

looking for dice roller BBcode
 
Hi

a small part of my forum is regarding role-play and they need dice roll, i saw one: https://vborg.vbsupport.ru/showthread.php?t=245192 but it wont work. its disfunctional. it always gives me [roll0].

this is the main php method we use on another site http://requiem.raptorred.com/dice/multiple_d10.php

PHP Code:

<br>Multiple D 10<hr>
      

    
        <form name="form1" method="post" action="">
          
           <font size="2">Amount of Dice : </font><input type="text" name="dice_amount" value="1" size="4" class="input"><br>
        
          <input type="submit" name="roll" id="roll" value="Roll Dice" class="input">
        </form>
<hr>
<?php 

if (isset($_POST['roll'])) { 
$dice_amount $_POST["dice_amount"];
      
      if(
$dice_amount <= 50) {
?>
<table border ="0" width="100%">
<tr>
<td valign="top">
  

<table border ="0" align="right">
<tr>

<?php
      
      
      $counter 
0;
      
$max 5;
      
$row_break 1;
      
$numbers = array("null"0000000000);
      
      while(
$counter $dice_amount) {
       
       
      echo 
"<td>";
      
$i rand(110);
    
      
      
$numbers[$i] = $numbers[$i] + 1;
      
      echo 
"<img src='d10/$i.png'>";
      
      
      echo 
"</td>";
    
       if(
$row_break ==$max) { echo "</tr><tr>"$row_break=1; } else { $row_break $row_break+1;}
         
$counter $counter 1;
      }
    
      
      
?>
      </tr>
</table>

<td width="200">&nbsp;</td>

<td valign="top"  width="200">
<table border="1" width="350">
    <tr>
    

 <td><div align="center">Number</div></td>
      <td><div align="center">Amount</div></td>
    </tr>
    <tr>
      <td><div align="center">1's</div></td>
      <td><div align="center"><?php echo $numbers[1]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">2's</div></td>
      <td><div align="center"><?php echo $numbers[2]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">3's</div></td>
      <td><div align="center"><?php echo $numbers[3]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">4's</div></td>
      <td><div align="center"><?php echo $numbers[4]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">5's</div></td>
      <td><div align="center"><?php echo $numbers[5]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">6's</div></td>
      <td><div align="center"><?php echo $numbers[6]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">7's</div></td>
      <td><div align="center"><?php echo $numbers[7]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">8's</div></td>
      <td><div align="center"><?php echo $numbers[8]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">9's</div></td>
      <td><div align="center"><?php echo $numbers[9]; ?></div></td>
    </tr>
    <tr>
      <td><div align="center">10's</div></td>
      <td><div align="center"><?php echo $numbers[10]; ?></div></td>
    </tr>
  </table>
  
  
</td>



 </td>
 </tr>
</table>

   <?php 
 
}  else {  echo "You can only roll up to 50 dice as a time."; }
   }
   
   
?>

was hoping to know if i can shove it into a forum bbcode, or to be able to use that addon correctly for 4.1.3

Thanks alot.

Mv.c9 05-08-2011 05:49 PM

anyone ?

kh99 05-08-2011 07:07 PM

I installed the mod you linked to above and it works for me (vb 4.1.3). If you're getting [roll0] could it be you're entering a '0' instead of 'o' in the [rollo] tag?

But if you want to implement your own version maybe you could just change that mod as needed.

Mv.c9 05-10-2011 05:11 PM

Quote:

Originally Posted by kh99 (Post 2193397)
I installed the mod you linked to above and it works for me (vb 4.1.3). If you're getting [roll0] could it be you're entering a '0' instead of 'o' in the [rollo] tag?

But if you want to implement your own version maybe you could just change that mod as needed.

i dont know why but i still get the [roll0] maybe im not installing correctly, or i dont know. something is off and i cant figure it out.


All times are GMT. The time now is 09:14 AM.

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.01287 seconds
  • Memory Usage 1,746KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete