Results 1 to 7 of 7

Thread: Not sure if this is possible

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    4

    Not sure if this is possible

    I run several forum based RPG's on my board. Many of them are in the style of the old AD&D type of play, rolling dice to determine if your action is successful. What I am looking for is a dice roller for my board. I dont know if it is possible, but here is what I would like it to do.

    You enter a particular forum. in this forum is the dice roller. You decide what you want to roll, a 20 sided die, a 10 sided die, or anything in between. you decide how many times you want it to roll that die. You hit roll, and it rolls the die with the paramaeters you have set. Once it is done rolling, it actually posts the rolls in the forum. These posts can not be edited or deleted.

    If this is possible, please let me know. I have no programming skill or scripting skill, so I dont know what would need to ne done. if you have any ideas, please contact me at my email, or over ICQ. Thanks.

  2. #2

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    4
    someone should be at least able to say if this is possible or not.

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I think you could implement it with some kind of random number generation with a server-side script. I wouldn't do it client side as there would be the possibility of users faking dice rolls.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    4
    ok, how would I go about doing this?

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You can take the source from the usermade die roll section to implement it yourself in ASP, I wouldn't mind. I also do die rolling, altough it is only 6-sided.

    Here it is, MDICE!!! (part of the MSuite AD&D program set, by Sastraxi)
    Attached Files Attached Files
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    I can also provide some code:

    Code:
    <%
    Function RollDie(A,B)
    Dim TempRoll
    Dim RollTot
    Dim AAA
    
       For AAA = 1 to B
          TempRoll = Int(Rnd * A) + 1
          If TempRoll > A Then TempRoll = A
          RollTot=RollTot+TempRoll
       Next AAA
    
       RollDie = RollTot
    End Function
    %>
    To add a database, I can only give you some tips:
    Make sure to open it with Optimistic Lock and OpenStatic.
    Next use this code to add a new record (make sure to use MDB and 3 fields, "Sided", "HowMany", "Result"...

    Code:
    <%
    Function ExtendedRollDie(A,B)
    Dim TempRoll
    Dim RollTot
    Dim AAA
    
       For AAA = 1 to B
          TempRoll = Int(Rnd * A) + 1
          If TempRoll > A Then TempRoll = A
          RollTot=RollTot+TempRoll
       Next AAA
    
       ExtendedRollDie = RollTot
    
       'make sure oRec is a valid ADODB.Recordset
       oRec.AddNew
       oRec("Sided") = A
       oRec("HowMany") = B
       oRec("Result") = RollTot
    End Function
    %>
    Hope I helped!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    whoops!

    After oRec("Result") = RollTot, add this line:

    Code:
       oRec.Update
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

Posting Permissions

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



Click Here to Expand Forum to Full Width