Actually, when it comes to the problem with the line:
else if (Mod<0) {doInsert (Num+"d"+Sides+Mod+": "+Roll);
The result is "3d5-2: 10" because the + sign just tells the script that it is part of a string of values. THe only way for the script to add them together (I learned this the hard way...
//Dice Button
function tag_dice()
{
var FoundErrors = '';
var Num = prompt("Please enter the number of dice", "1");
var Sides = prompt("Please enter the number of sides","2");
var Mod = prompt ("Please enter any modifiers","0");
var a = (Num*Sides)-Num;
var Rand =...
I have been asking about this in the javascript forum and I was told that I should ask here. I have a funtion for my forum that simulates dice rolling. I would like to know how to make the results read only. Here is my funtion so far:
//Dice Button
function tag_dice()
{
var FoundErrors =...
One problem I see right away is the (1 + J). I tried something similar, and all it did was put them next to each other in a string. You might have to do:
(Number(1) + Number(J))
That is what I had to do for my dice roller.
I hav tried all of the solutions set forth by the far more qualified members here, but none of them work. I just reallised how stupid I was being, because I forgot to specify that I need this to work for a code button that exectues an funtion from an external js library file. That is why I have...
Weel, this is only for a play by post RPG that I am working on. I already have a routine that generates the number and posts it once they input the necessary values. I can always check their posts to see if the result was read only (once I make it that way that is).
I was wondering if there was a way to make the text a js button puts in the text area of my forum readonly, and maybe in another font? I am just looking for a way to keep people from cheating when using my dice roller. I can always check their posts to see if they actualy used the button or if...
Actually, what stormbird suggested is about what I need. The reroll would not be a problem, because refreshing the page would mean they would have to input all of the text again. A reroll like that would not matter that much since the player would not be able to change the result outright, but...
Hello, I am very new to JavaScript and I was wondering if it is possible to have a function place a textbox in the textarea of a forum I administrate. The purpose of this is for the dice roller I coded. It currently does a doInsert of the roll results that my members can easily edit to suit...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.