Please upgrade your browser for the best possible experience.

Chrome Firefox Internet Explorer
×

No /roll function?


ouTJumped's Avatar


ouTJumped
02.14.2012 , 11:57 AM | #231
/signed.


I mean really? Come on.
Vurik- 50 Annihilation Marauder-
Lasmi- 40 Pyrotech Powertech-

Juyo Server

HarvardAce's Avatar


HarvardAce
02.14.2012 , 12:59 PM | #232
Quote: Originally Posted by mrdakadoc View Post
I'm a software engineer.

Code:
int roll(int max) {
  return rand() % (max) + 1;
}

int roll() {
  return roll(100);
}

That code will cost you $200.

Thanks
If you're a software engineer, then you should know that taking the modulo of a pseudo-random number is a very bad way to generate a random number. Depending on the method used to generate the "random" number, it may be that the number returned by the system always alternates between an odd and an even number. If you then did roll(2), you would always alternate between 1 and 2.

The "proper" way to do it would be:
Code:
int roll(int max) {
  return (int) (rand() / (RAND_MAX) * max + 1);
}
Additionally, many random functions in modern languages return a float between 0 and 1, so the act of multiplying by RAND_MAX is not needed, and many of those languages also provide built-in random functions that return integers between two specified numbers.

ouTJumped's Avatar


ouTJumped
02.14.2012 , 03:51 PM | #233
Want to keep this front page so it might get attention.
Vurik- 50 Annihilation Marauder-
Lasmi- 40 Pyrotech Powertech-

Juyo Server

AndrewHanderson's Avatar


AndrewHanderson
02.17.2012 , 10:00 AM | #234
/signed

CzaplaM's Avatar


CzaplaM
02.19.2012 , 09:45 PM | #235
It is here

Darthinfimus: Do you plan to implement a /roll or /random command for use in master looter situations?

Damion Schubert: Diceslingers of the world rejoice! /roll has already been implemented on our internal development servers and should be coming to you guys Real Soon Now (in an upcoming weekly patch).

Wanabrutbeer's Avatar


Wanabrutbeer
02.24.2012 , 08:11 AM | #236
Hey guys, didnt read this whole thread to see if this was mentioned already, but if your guild is using Teamspeak instead of Ventrillo, then there is an addon for the Teamspeak chat window that gives you dice rolling functionality

http://addons.teamspeak.com/director.../Dice-Bot.html

Only one person has to actually install the addon, probably the raid leader, or master looter.

I agree SWTOR should have this built in, its quite simple, but until they do, this could make things easier for you.


EDIT -
Also, upon updating TS, this stopped working, but there are a few other dice addons for TS, one's a LUA script, it works

http://addons.teamspeak.com/director...ua-Script.html

This one you would just use the command (d100) in TS chat to roll for 100. Everyone in TS can see the rolls, should suffice until SWTOR gets it together.

Atanvardo's Avatar


Atanvardo
02.25.2012 , 08:35 PM | #237
second this nomination.. /roll ftw please.

KingFink's Avatar


KingFink
02.25.2012 , 08:37 PM | #238
1.1.5

Talorra's Avatar


Talorra
02.25.2012 , 09:21 PM | #239
Yep, roll is coming in the next patch.

/thread
M'arik <Intrepid> 16-player Progression The Harbinger
IntrepidOps.com | Live Stream | Recruitment Thread | @Twitter

_tegrof's Avatar


_tegrof
02.27.2012 , 01:25 PM | #240
Not reading all the way through this thread, but adding my voice to this...

What a bone-head move this was. Seriously? No roll?

Here's my "constructive" criticism:

Whoever overlooked this, or let it go without something so simple, yet so crucial.....should be taken outside and flogged.

What a total joke.