Bitcoin Forum

Alternate cryptocurrencies => Altcoin Discussion => Topic started by: hendo420 on December 27, 2013, 12:58:07 AM



Title: A Simple python program to autosend a wallets balance(VPS mining FTW)
Post by: hendo420 on December 27, 2013, 12:58:07 AM
https://github.com/hendo420/Bitcoin-Autosend

I was bored today so I made a program for all of those solo VPS miners out there.

Its stupid simple. Here is the source.
Code:
#!/usr/bin/python
  
import bitcoinrpc
import sys, time
  
serverIP = '127.0.0.1'
serverPort = '1069'
user = 'username'
password = 'password'
address = 'AddressToSendCoinTo'
fee = 0.001

conn = bitcoinrpc.connect_to_remote(user, password, host=serverIP, port=serverPort);
  
while True:

    balance = conn.getbalance()
    print 'Your current balance is', balance
  
    if balance > fee:
        adjbalance = float(balance) - float(fee)
        print 'Sending', adjbalance, 'to your designated address'
      
        try:
            conn.sendtoaddress(address,adjbalance)
        except Exception:
            pass
            print 'Coin send fail'
  
    time.sleep(3)

Just add in your RPC port, username, password, and address to send coins to.
Optionally change the serverIP to your VPS's IP if you are running the program from a remote PC.
You should also change the fee to match the coin you are mining.


Enjoy!  :D :D :D


Title: Re: A Simple python program to autosend a wallets balance(VPS mining FTW)
Post by: traxx187 on December 27, 2013, 01:03:40 AM
Pretty cool man

Reserved selling spot for CatCoins PM me


Title: Re: A Simple python program to autosend a wallets balance(VPS mining FTW)
Post by: hendo420 on December 27, 2013, 02:24:23 AM
Reserved


Title: Re: A Simple python program to autosend a wallets balance(VPS mining FTW)
Post by: glorycoin on December 28, 2013, 07:11:01 PM
jgarzik's python-bitcoinrpc (https://github.com/jgarzik/python-bitcoinrpc (https://github.com/jgarzik/python-bitcoinrpc) produces following error:

AttributeError: 'module' object has no attribute 'connect_to_remote'

Which bitcoinrpc python library do you suggest?

Thanks