LibTrueRandom-1.0 is a library that provides a way to asynchronously retrieve random values by making /roll requests.
Example code:
LibStub("LibTrueRandom-1.0").GetRandom(1, 1000, function(value) -- value will be a number >= 1 and <= 1000 here end)
Here's the use case for this library:
- You're in a guild or a raid and you want to randomly choose someone to get loot or for some other reason
- You can't use math.random, since other users in the group might think you are returning bad data thus weighting yourself or friends over them.
- Doing a /roll is safe and secure, since it's executed server-side and can't be weighted by client-side code.
- You print to the raid chat: "Rolling for phat lewt - 1: Monkeyman 2: Bananadude 3: Awesomeo"
- /roll 1 3
- Myguy rolled 2 (1-3) - executed server-side
- Bananadude is awarded the "phat lewt" programmatically (with the callback function provided)
- The three know that they had equal chances to get the item, knew what number they corresponded to, and knew who was the winner due to the public display of the /roll, so there is full transparency and hopefully no whining about "hax".
- 2 comments
- 2 comments
Facts
- Date created
- Sep 10, 2010
- Categories
- Last update
- Jan 14, 2011
- Development stage
- Release
- License
- MIT License
- Curse link
- LibTrueRandom-1.0
- Downloads
- 783
- Recent files
- R: v40000 for 4.0.3a Jan 14, 2011
- A: r20110114165826 for 4.0.3a Jan 14, 2011
- A: r20100910174213 for 3.3.5 Sep 10, 2010
- A: r20100910172001 for 3.3.5 Sep 10, 2010
- Reply
- #2
ckknight Sep 11, 2010 at 14:53 UTC - 0 likes@Dridzt: Go That's an addon, this is simply a library that has nothing to do with raids. If RaidRoll or others decide to use this library, more power to em.
- Reply
- #1
Dridzt Sep 10, 2010 at 22:23 UTC - 0 likesIsn't that what RaidRoll and a couple other addons do?