Bitcoin Forum
January 24, 2018, 02:14:20 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Auto BTC sending PHP script  (Read 1397 times)
anthony_
Member
**
Offline Offline

Activity: 65


View Profile
June 15, 2011, 04:13:34 AM
 #1

Code:
<?php
while(1) {
$bitcoind_path '"%ProgramFiles(x86)%\Bitcoin\daemon\bitcoind"';
$sendtoaddress 'fdasfad';
$tax 0.0005;
$betamount 0.1;
$minimumbalance 0.0;
$strbalance =  exec($bitcoind_path.' getbalance');
$balance floatval($strbalance);
if($balance >= $betamount $tax && $balance - ($betamount $tax) > $minimumbalance) {
echo exec($bitcoind_path.' sendtoaddress '$sendtoaddress ' ' $betamount) . '\n';
echo 'sent!';
} else {
sleep(10);
}
}
?>

I use it for sites like bitcoin lottery and such so I can continue to waste my mining earnings Cheesy

I will add JSON-RPC support in the future, this was just a test script.

If you like it consider donating a small amount to 17kKVg1NP8ciHG3qKoZirc7UP3NE1AFQC6
1516760060
Hero Member
*
Offline Offline

Posts: 1516760060

View Profile Personal Message (Offline)

Ignore
1516760060
Reply with quote  #2

1516760060
Report to moderator
1516760060
Hero Member
*
Offline Offline

Posts: 1516760060

View Profile Personal Message (Offline)

Ignore
1516760060
Reply with quote  #2

1516760060
Report to moderator
1516760060
Hero Member
*
Offline Offline

Posts: 1516760060

View Profile Personal Message (Offline)

Ignore
1516760060
Reply with quote  #2

1516760060
Report to moderator
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1516760060
Hero Member
*
Offline Offline

Posts: 1516760060

View Profile Personal Message (Offline)

Ignore
1516760060
Reply with quote  #2

1516760060
Report to moderator
NothinG
Hero Member
*****
Offline Offline

Activity: 560



View Profile
June 15, 2011, 07:29:23 AM
 #2

Code:
<?php
while(1) {
$bitcoind_path '"%ProgramFiles(x86)%\Bitcoin\daemon\bitcoind"';
$sendtoaddress 'fdasfad';
$tax 0.0005;
$betamount 0.1;
$minimumbalance 0.0;
$strbalance =  exec($bitcoind_path.' getbalance');
$balance floatval($strbalance);
if($balance >= $betamount $tax && $balance - ($betamount $tax) > $minimumbalance) {
echo exec($bitcoind_path.' sendtoaddress '$sendtoaddress ' ' $betamount) . '\n';
echo 'sent!';
} else {
die();
}
}
?>

Changed your sleep() to die(). I can't see any point in retrying the loop if there isn't enough money.

anthony_
Member
**
Offline Offline

Activity: 65


View Profile
June 15, 2011, 08:25:53 AM
 #3

Code:
<?php
while(1) {
$bitcoind_path '"%ProgramFiles(x86)%\Bitcoin\daemon\bitcoind"';
$sendtoaddress 'fdasfad';
$tax 0.0005;
$betamount 0.1;
$minimumbalance 0.0;
$strbalance =  exec($bitcoind_path.' getbalance');
$balance floatval($strbalance);
if($balance >= $betamount $tax && $balance - ($betamount $tax) > $minimumbalance) {
echo exec($bitcoind_path.' sendtoaddress '$sendtoaddress ' ' $betamount) . '\n';
echo 'sent!';
} else {
die();
}
}
?>

Changed your sleep() to die(). I can't see any point in retrying the loop if there isn't enough money.

It loops over and over again until there is money then it sends it.
NothinG
Hero Member
*****
Offline Offline

Activity: 560



View Profile
June 15, 2011, 08:30:24 AM
 #4

It loops over and over again until there is money then it sends it.
Oh, I wasn't thinking very long term usage.
I see how this script works now.

Good idea. Smiley

anthony_
Member
**
Offline Offline

Activity: 65


View Profile
June 15, 2011, 09:09:28 AM
 #5

Yeah, I've been trying to win the jackpot but no luck so far Sad
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!