Bitcoin Forum
May 08, 2024, 05:49:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 ... 109 »
281  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: December 01, 2015, 03:17:48 PM
Please help me sir ,
Import database eror Cry



You need to select a database from the lefthand column before you click on import.

Thanks sir , Problem Solved  Cool Cheesy

One more thing I want to ask, how to change the minimum payout to 8000 satoshi, at this point my faucet no minimum payout? Sad
You want people to have to play up to a 8000 balance before cashout? Doesn't that defeat the purpose of a faucet?
282  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: December 01, 2015, 01:24:05 PM
Please help me sir ,
Import database eror Cry



You need to select a database from the lefthand column before you click on import.
283  Bitcoin / Project Development / Re: Looking to display Bitcoin price plus extra % that i will set on: November 30, 2015, 12:09:55 AM
Great thanks !!!

But:

Quote
Not a good idea, you'll get banned for hitting the API too many times, but here you go.

Is there any other way to make it work like preev (auto refresh)  ?

Yes, the way I do it is to set up a database to store the price/market value. Then set a cron job to run every N minutes to update the database with the updated rate.  This way you could have a million visitors and still never exceed the API limits, because you are just querying your own DB instead of hitting them with an API call for every visitor.
284  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 30, 2015, 12:06:27 AM
Thank you for this nice script, can you change the house edge of this game?

Yes you could change the house edge if you changed the way the profit is calculated.

faucetboxgame/index.php  lines 51 and 148

Code:
$multi2 = $multi - 0.02;  //house edge

I have it set up so that it cuts off 2% off the multiplier. So if someone bets with 50/50 chance of winning, if they win they will only receive a prize as if they bet at a 52% probability instead of 50%.
285  Bitcoin / Project Development / Re: Shopping Cart System using Blockchain's new Receive Payments API v2 BIP32 xpub on: November 29, 2015, 06:08:21 AM
Thanks for taking time to do this.

But sadly I do not think anyone should use this for a production site, from my quick glace there is 0 security in this, it looks like sql injections are possible.

I could be wrong, I am not a security expect but just looking out for everyone.
That's not true at all.
All inputs are designated to charset utf8 and then escaped before being inputted to the DB. Although PDO or objects would be safer it's open so anyone can change it if they feel the need for a higher level of security.
286  Bitcoin / Project Development / Re: Looking to display Bitcoin price plus extra % that i will set on: November 29, 2015, 03:37:46 AM
Great THANKS Smiley

But can you add a few lines of ajax so it can auto refresh?

Not a good idea, you'll get banned for hitting the API too many times, but here you go.


HTML:
index.html
Code:
<script src="ajax.js"></script>
<script type="text/javascript">
refreshdiv();
</script>
<div id="pricediv"></div>

AJAX:
ajax.js
Code:


var seconds = 5;
var divid = "pricediv";
var url = "price.php";

function refreshdiv(){
var xmlHttp;
try{
xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("Your browser does not support AJAX.");
return false;
}
}
}

fetch_unix_timestamp = function()
{
return parseInt(new Date().getTime().toString().substring(0, 10))
}

var timestamp = fetch_unix_timestamp();
var nocacheurl = url+"?t="+timestamp;

xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
document.getElementById(divid).innerHTML=xmlHttp.responseText;
setTimeout('refreshdiv()',seconds*1000);
}
}
xmlHttp.open("GET",nocacheurl,true);
xmlHttp.send(null);
}

var seconds;
window.onload = function startrefresh(){
setTimeout('refreshdiv()',seconds*1000);
}

PHP
price.php
Code:
$url = "https://coinbase.com/api/v1/prices/spot_rate";
$json = json_decode(file_get_contents($url), true);
$price = $json["amount"];
$addP = $price * 1.05; //add 5% to the current exchange rate
echo $addP;
287  Bitcoin / Project Development / Shopping Cart System using Blockchain's new Receive Payments API v2 BIP32 xpub on: November 28, 2015, 10:17:41 PM
BC.info is phasing out their version 1 receive payments API on Dec 7th. Their new version is out, the main difference is HD BIP32 xpub instead of payment forwarding. I have tested it out, and I must say I enjoy it much more than the previous version.

In the process of testing it out I created a shopping cart system that small merchants can use to sell whatever they want on their website, so I thought I'd throw it up on github. https://github.com/coinables/Blockchain-Receive-Payments-API-Shopping-Cart

What you'll need:
- Blockchain.info API key for their new receive payments API. Request one here https://api.blockchain.info/v2/apikey/request/
- A website and host that supports PHP, and MySQL databases. Preferably cPanel with PHPmyAdmin.
- Download the files in the repository at github https://github.com/coinables/Blockchain-Receive-Payments-API-Shopping-Cart
- Create and configure a database on your webserver
- Import the included SQL database files using PHPmyadmin or similar database manager
- Open the config.php file and update the fields
- Upload the files to your server.
- Goto login.php in the directory where you uploaded your files to access your admin panel and start adding products!

Want a preview?  I go over it in this video starting at 6:25  https://youtu.be/D2__AFoOdec?t=6m24s
288  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 28, 2015, 09:31:19 PM
Very nice script! I did make a bet on my private test clone what won over 30000 sats and it did not auto payout. I have not changed anything what should affect to that. Anyway if I use that script somewhere I remember to pay tip Smiley

Doh, you're right. Left out some crucial info that was preventing the auto cashout. New commit added to fix the auto cashout. Also added a max cashout limit of 99,999 satoshis, if someone's balance is higher than that they will receive an error when trying to cashout.
289  Bitcoin / Project Development / Re: Looking to display Bitcoin price plus extra % that i will set on: November 28, 2015, 03:34:25 AM
Here's a simple one I created in PHPfiddle:  http://phpfiddle.org/lite/code/9mbw-iu5v

http://btcthreads.com/how-to-get-the-current-bitcoin-price/

Code:
$url = "https://coinbase.com/api/v1/prices/spot_rate";
$json = json_decode(file_get_contents($url), true);
$price = $json["amount"];
$addP = $price * 1.05; //add 5% to the current exchange rate
echo $addP;
290  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 10:20:38 PM
can you give a step by step on how to set the files in the hosting?

and yes a threshold to say 9999 satoshi.

There is a threshold set, if the player has a balance that is over 9,999 satoshi their game will end and they will be paid out their balance.

All you need to do is download the zip from github. Set up a database on your web host, update the two index.php files in each folder with the database credentials you just created and with your faucetbox and funcaptcha API keys. Import the enginedb.sql through PHPmyadmin. The landing page for your visitors is in the Faucetbox directory, to test your new site go to yoursite.com/faucetbox
291  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 08:37:52 PM
So when I was cloning my project to github I forgot that I had a cronjob running to keep track of the faucet balance. This is why your balance is showing nothing, because if there is no cronjob running the database table fbbal is empty.  I'm going to drop the cron, the fbbal table and just call the faucetbox API on the fly to grab the faucet balance.  Github repo has been updated.
works great now

another thing i'm not sure how to setup the referral reward, the $reefAmount is a percentage value or amount proportional to $startBal  
i'm trying to setup 111 satoshi per claim with 10% ref. reward

$startBal = 111; //starting balance for users
$reefAmount = 11; //referral amount

is it correct Smiley?




Yup if you set it like the above, every new claim will be 111 satoshis and the refer will be paid 11 satoshis.

EDIT: Also if you are going to set it down to 111, you might want to change the default bet amount of 200 satoshis to a lower amount on the faucetboxgame/index.php  line 647

Code:
<input type="text" name ="bet" id="bet" value="<?php if(!isset($_POST['bet'])){ echo "200"; } else { echo $_POST['bet']; } ?>"

Change echo "200" to something lower like echo "50"
292  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 07:11:43 PM
So when I was cloning my project to github I forgot that I had a cronjob running to keep track of the faucet balance. This is why your balance is showing nothing, because if there is no cronjob running the database table fbbal is empty.  I'm going to drop the cron, the fbbal table and just call the faucetbox API on the fly to grab the faucet balance.  Github repo has been updated.
293  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 06:25:45 PM
any way you can set up a a threshold?
Threshold for what? I set up to auto withdraw if the user has a balance over 9999 satoshis, is that what you mean?
294  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 06:23:30 PM
very nice from you sharing this with others, PM me your BTC addy please Smiley

There's one in the readme on the git hub repo ; )
0.01 sent, cheers Smiley


Thank you for the support Smiley
i used your script on this site: LINK, faucet balance was not showing any value, so i had to remove it, do you have any idea what was wrong? thank you
Now that you mention it i think I do. I'll take a look when I get home wife had me a run a 5k this morning
295  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 05:30:18 PM
very nice from you sharing this with others, PM me your BTC addy please Smiley

There's one in the readme on the git hub repo ; )
0.01 sent, cheers Smiley


Thank you for the support Smiley
296  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 05:28:28 PM
Awesome dude! Any way this thing can use on host wallets to faucet from or no?

That would be a neat feature. I am going to check out your code for sure and see how you've done things.
Thank you for sharing your source code. Very kind of you!

Not sure what you mean by host wallet. It uses faucetbox to manage faucet funds.
297  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 05:09:12 PM
very nice from you sharing this with others, PM me your BTC addy please Smiley

There's one in the readme on the git hub repo ; )
298  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 12:49:41 PM
Cool, I'll check this out and see how it goes. I appreciate you giving out the script for free, and I might intergrate this into my faucet.

If I do intergrate this, may I use the FAQ on your demo? It's well written.

Yes feel free to use any or all parts
299  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 04:35:12 AM
Wow - thank you for the open source really nice to have Smiley

also tried the life demo it is pretty nice to get the Coins on the same site and not to make any deposit at all to gamble!
How is the Timer set? i becam 300 satoshi for my first claim.. Therefore 10 Minutes should be the Timer? AM i right?

Would be great to know Wink

regards
lama-hunter

You can change the timer and rewards to whatever you would like to for your site.

Is it possible to add the option of investing funds players? I want to add this to my website.

Yes it's possible, but that's not the focus of this script. There are way too many scammers out there that would use the source code to open a dice site and then run away with customer funds. 
It could be added relatively easily with a few tweaks.
300  Economy / Micro Earnings / Re: Open Sourced Faucet with Dice Script on: November 26, 2015, 02:00:26 AM
This is beautiful, thank you so much. I will definitely be using this. One question, can players deposit coins into the game?

No, that would make it a gambling site. This is just a fun addition to a faucet
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [15] 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 ... 109 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!