Im having yet another dice problem. Here is the current one im using right now.
Roll()
set category = "Communication"
var/dice=0
var/sides=0
dice = input("How many dice?","How many dice?")as num
sides= input("How many sides?","How many sides?")as num
var/total=0
var/output = "[src.name] rolls [dice]d[sides]= "
world << "\..." // \... suppresses the automatic return
for(var/x=0,x<dice,x++)
var/roll=rand(1,sides)
output += "[roll], "
total += roll //Add them up
output += " Total:[total]"
world << "[output]"
What im wanting to do is have the use type in [dice]d[sides] instead of it having to pop up asking how many dice then how many sides.
You would use the verb like this Roll"1d5" If your getting what I mean. Im wanting it to still show the [roll] var. Im also having problems figuring on how to limit the amount of dice that can be rolled. like so a usr can't roll over 100 dice lets say..
ID:176567
Jan 2 2003, 7:54 am
|
|
Jan 2 2003, 7:56 am
|
|
you could use the HTML library. I'm not great with that library (not much experiance) though, so you'll have to figure out the rest yourself.
|
In response to Hazman
|
|
I dont think the HTML lib has anything to do with a dice.. *cough* or does it..
|
In response to Jacob
|
|
Use a form from the HTML library to output [thisnumber]d[thisnumber] then generate a random number based on them using a proc. Finally, output this number.
|
In response to Hazman
|
|
lol Ok. HTML lib is the last thing I wanted to fool around with =-\. Im guessing there isn't a easier way to get around it.
|
In response to Jacob
|
|
Not that I am aware of.
|
Ignore Hazman, he has no clue what you're talking about.
verb |