Dice Rolling Script
mIRC Code
+ 0 likes
Please Register to submit score.
| Average Score | 0.0 |
| Scores Submitted | 0 |
| Date Added | Apr 29, 2008 |
| Last Updated | Jun 25, 2008 |
| Tags | compact dice mirc random remote roll |
|
|
Introduction
I focused on keeping this small and compact, it totals 11 lines in total. The use of /set rather than /var was deliberate also.
It's not my first mIRC script, but probably the trickiest one I've tackled. I was speaking to someone on mIRC and they said they'd seen 4 ways of doing this in 24 hours, so I thought I'd put it here for the experts to scrutinise!
What this does it the following:
User prompts:
!Script <no. of dice used> <sides on all dice>
The script generates random numbers for each dice rolled (based on the no. of sides) and then adds up the total score.
An example of a prompt would be:
User prompts: !Script <no. of dice used> <sides on all dice>
The script generates random numbers for each dice rolled (based on the no. of sides) and then adds up the total score.
An example of a prompt would be:
!roll 3 2
[ User Nick ] < Dice: 3 > < Sides on Dice: 2 > < Rolls Scores: 2 2 1 > < Total Score: 5 >
mIRC Snippet:
Dice Rolling Script
Posted on Apr 29, 2008 2:00 pm
Posted on Apr 29, 2008 2:00 pm
| Code: |
if (($2 <= 0) || ($2 == $null) || ($3 == $null) || ($3 <= 0)) { |
The if ($2 == $null) is redundant since you have the if ($3 == $null) also.
But you could simply do:
| Code: |
if ($2 isnum 1- && $3 isnum 1-) { |
mIRC Snippet:
Dice Rolling Script
Posted on Apr 29, 2008 2:14 pm
Posted on Apr 29, 2008 2:14 pm
set -s %AmountDice = SPAM !
mIRC Snippet:
Dice Rolling Script
Posted on Apr 30, 2008 11:18 am
Posted on Apr 30, 2008 11:18 am
I've cut the
thanks for that pointer!
@ jonesy44: Yep, I've edited in $2 for %AmountDice and $3 for %DiceSides
Thanks for the help!
| Quote: |
| ($2 == $null) |
thanks for that pointer!
@ jonesy44: Yep, I've edited in $2 for %AmountDice and $3 for %DiceSides
Thanks for the help!
mIRC Snippet:
Dice Rolling Script
Posted on May 1, 2008 3:59 pm
Posted on May 1, 2008 3:59 pm
Funny ^^
Can you tell me how you type messages in bold? or in colors O.o
Thanks :D
Can you tell me how you type messages in bold? or in colors O.o
Thanks :D
mIRC Snippet:
Dice Rolling Script
Posted on May 1, 2008 4:09 pm
Posted on May 1, 2008 4:09 pm
criminal:
| Code: |
[b]bold[/b] [i]italics[/i] [color=red]red[/color] [u]underline[/u] [url=http://url.com]URL[/url] [code];code[/code] [img]http://path/to/image.jpg[/img] |
mIRC Snippet:
Dice Rolling Script
Posted on May 2, 2008 9:50 am
Posted on May 2, 2008 9:50 am
And just in case, if you mean mIRC:
Bold = Ctrl+B <message here> Ctrl+B
Color = Ctrl+K then choose the number corresponding to the color
Bold = Ctrl+B <message here> Ctrl+B
Color = Ctrl+K then choose the number corresponding to the color
mIRC Snippet:
Dice Rolling Script
Posted on May 3, 2008 9:49 am
Posted on May 3, 2008 9:49 am
Edited the Snippet, it now uses /var instead of /set and therefore does not clutter your Variables!
mIRC Snippet:
Dice Rolling Script
Posted on Jun 21, 2008 3:57 am
Posted on Jun 21, 2008 3:57 am
Cleand up my if statement.
mIRC Snippet:
Dice Rolling Script
Posted on Jun 24, 2008 11:15 pm
Posted on Jun 24, 2008 11:15 pm
nice... might I suggest putting a . in front of your vars to cut out the status window spam.
mIRC Snippet:
Dice Rolling Script
Posted on Jun 24, 2008 11:35 pm
Posted on Jun 24, 2008 11:35 pm
He is using var -s to specifically show the variables result when set so instead of using .var -s %var to quiet it the better suggestion would be to lose the -s all together.
mIRC Snippet:
Dice Rolling Script
Posted on Jun 25, 2008 12:48 am
Posted on Jun 25, 2008 12:48 am
I like leaving the -s in when I'm working on my scripts for bug-testing, seems that i haven't removed them.
Edit: Changed now.
Edit: Changed now.








