About Lottery
Lotteries can be created by any user registered on TibiaVIP. To create a lottery it is necessary to inform the world where it will take place, the number of tickets available, the prizes for each placement and the date of the draw. The creator can also link players to their corresponding tickets if he wants to.
All lotteries have an exclusive link for consultation and are also available on the TibiaVIP Lotteries page.
Lotteries can be deleted or edited as many times as necessary before the draw takes place. After the draw, no editing or removal will be possible.
Tickets will always be drawn safely and randomly, following the legacy TibiaLottery.com code.
Lotteries are drawn through random.org.
Most random number generators are based on pseudo-random numbers that are "accepted" for most situations, but random.org gets its random numbers from background noise in space, making them as random as possible.
If random.org fails to load for some reason, we fall back on PHP's built-in random function. You can find the code snippet below.
function create_sequence($tickets){
$array = @file("http://www.random.org/sequences/?min=1&max=".$tickets."&col=1&format=plain&rnd=new"); //Uses random.org to generate "real" random numbers
if(is_array($array)){
foreach($array as $data){
$winners[] = (int)preg_replace('#([^\d])#', '', trim($data)); //Stores the numbers in the array (numbers only)
}
}
if(!is_array($winners) || count($winners) < $tickets){ //Basically, if random.org failed to load...
$winners = array();
while(count($winners) < $tickets){
$number = rand(1, $tickets); //We use PHP to generate our own random numbers, which are "less random" than random.org
if(!in_array($number, $winners)){
$winners[] = $number; //Assigns our own generated numbers to the array
}
}
}
return($winners); //Returns the "winners," basically the new random number array.
}