News:

Author Topic: Add-on for Dice Script: Random Rewards + USD value  (Read 323 times)

0 Members and 1 Guest are viewing this topic.

Offline alamin

  • Administrator
  • Initiate
  • *****
  • Posts: 274
  • Gender: Male
  • Referrals: 18
Add-on for Dice Script: Random Rewards + USD value
« on: March 23, 2017, 12:21:12 AM »
After this post: You are not allowed to view links. Register or Login
Someone told me to add this feature on dice script.
It's very easy to add this feature in dice script.
Just open index.php file from root directory.
Find:
Code: You are not allowed to view links. Register or Login
$startBal = 50; //starting balance for users
$reefAmount = 5; //referral amount
Replace with this code:
Code: You are not allowed to view links. Register or Login
$faucet_reward = 0.001; //reward amount in USD
$ref_amount = 0.0001; //referral amount in USD
$get_rate = file_get_contents("https://blockchain.info/tobtc?currency=USD&value=1");
$rate_sats = $get_rate * 100000000;
$startBal = intval($faucet_reward * $rate_sats);
$reefAmount = intval($ref_amount * $rate_sats);



Edit:
So, here's the code for random rewards:
Code: You are not allowed to view links. Register or Login
$min_reward = 0.001; //minimum faucet reward in USD
$max_reward = 0.005; //maximum faucet reward in USD
$ref_prcnt = 0.05; //referral percentage divided by 100.
        $get_rate = file_get_contents("https://blockchain.info/tobtc?currency=USD&value=1");
        $rate_sats = $get_rate * 100000000;
$shw_min = intval($min_reward * $rate_sats);
$shw_max = intval($max_reward * $rate_sats);
$reward = rand($shw_min, $shw_max);
        $startBal = intval($reward);
$reefAmount = intval($ref_prcnt * $startBal);

Now paste this code anywhere inside <body> </body> tag to show the rewards:
Code: You are not allowed to view links. Register or Login
<?php echo "Win $shw_min to $shw_max Satoshi every xxx minutes."?>That's it. Now your dice is ready to change the reward amount according to change of bitcoin price, just like freebitco.in. ;)
« Last Edit: March 24, 2017, 01:13:52 PM by alamin »