Results 1 to 3 of 3

Thread: Virtual Dice Roller HTML code

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    42 Reputation: 16
    Aerobella's Avatar
    Join Date
    Jul 2008
    Location
    Somewhere in the 'verse
    Posts
    938
    Rep Power
    15

    Default Virtual Dice Roller HTML code

    as you can see by my signature, I am currently running a pbp rpg. We made a cash system and a shop, but we still need a dice roller. The deal with the roller is that we need a HTML that we can copy and paste somewhere and it will generate a random number from 1-100 once a week. We also need a way to tell how many times the user rolled and what the result was.

    If anyone can help me here, I would be very happy to hear anything anyone can tell me.

  2. #2
    Retired Staff Reputation: 75
    Eriond's Avatar
    Join Date
    May 2006
    Location
    Montreal
    Posts
    1,790
    Rep Power
    18

    Default

    I don't think you're going to be able to do it with just HTML. I'm not quite sure what a pbp is. (Python Browser Poseur?)

    You could do it with JavaScript or PHP though.

    Try this with JavaScript:

    Code:
    <html>
    <script language="Javascript">
    
    function getnumber () {
      var number = Math.random()*100;
      number = round(number);
      document.random.number.value = time;
    }
    </script>
     
    <body>
     
    <form name="random">
    <input type="text" name="number" style="border: 0px" value="">
    </form>
     
    </body>
    </html>
    That should just generate a random number (it should work, but I don't really know JavaScript, so there's a chance it won't). To try for the other thing, I need to know what pbp is.

  3. #3
    42 Reputation: 16
    Aerobella's Avatar
    Join Date
    Jul 2008
    Location
    Somewhere in the 'verse
    Posts
    938
    Rep Power
    15

    Default

    oh pbp isn't important, it means play by post, nothing to do with a dice roller! but thank you very much!!!

    EDIT: I tried the roller and uh... it didn't work, basically there's a box where you can enter text and then if you hit enter it refreshes the page, thank you very much for trying though

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •