IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Dice Roller Script?
Demon4x4
post Nov 30 2004, 07:30 PM
Post #1


Target
*

Group: Members
Posts: 3
Joined: 20-April 03
From: Houston
Member No.: 4,477



Anyone have a good email dice roller script? I would love to have something that I could use in a shadowrun PBEM. I would like for it to have a form for 'player's email' 'gm email' 'subject' 'description of action' 'number of dice to be rolled' 'number of sides on each dice' and then a submit button that would send the results of the email to the gm, and a carbon copy to the player.
Ideally it would be a script that I could add onto my own website, and not having to use a listserv.
Anyone have anything like that?
Go to the top of the page
 
+Quote Post
Spookymonster
post Nov 30 2004, 08:25 PM
Post #2


Moving Target
**

Group: Members
Posts: 639
Joined: 22-April 02
Member No.: 2,638



Here's a quick-n'-dirty script I wrote a while ago. Feel free to monkey with it as needed:

CODE
<html>
<head>
</head>
<body onload="document.dieform.resultList.value = 0;">
<script type="text/javascript">
function rollDie() {
var diePool = document.dieform.diePool.value - 0;
 var resultArray = new Array(diePool);
for (var i = 0; i < resultArray.length; i++) {
 resultArray[i] = 0;
 var dieHold = 6;
 while (dieHold == 6) {
  dieHold = (Math.ceil(Math.random() * 6));
  resultArray[i] += dieHold;
  }
 }
document.dieform.resultList.value = resultArray.sort(compareNum);
}
function compareNum(a,b) {
return a-b;
}

</script>
<form name="dieform">
# of Dice: <input type="text" name="diePool" value="1" size="4" maxlength="4" />
<button type="button" id="roll" onclick="rollDie()">Roll</button><p/>
Results: <textarea name="resultList" value="foo" rows="5" cols="25" />
</form>
</body>
</html>
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 26th April 2024 - 12:20 PM

Topps, Inc has sole ownership of the names, logo, artwork, marks, photographs, sounds, audio, video and/or any proprietary material used in connection with the game Shadowrun. Topps, Inc has granted permission to the Dumpshock Forums to use such names, logos, artwork, marks and/or any proprietary materials for promotional and informational purposes on its website but does not endorse, and is not affiliated with the Dumpshock Forums in any official capacity whatsoever.