# cat switch.php
$l = 0;
$n = 0;
while (1){
$coins = file_get_contents('
https://www.whattomine.com/coins.json'); $json = json_decode($coins, true);
$etc = $json['coins']['EthereumClassic']['profitability'];
$eth = $json['coins']['Ethereum']['profitability'];
$dcr = $json['coins']['Decred']['profitability'];
$sia = $json['coins']['Sia']['profitability'];
$lbc = $json['coins']['LBRY']['profitability'];
$etc_lag = $json['coins']['EthereumClassic']['lagging'];
$eth_lag = $json['coins']['Ethereum']['lagging'];
$dcr_lag = $json['coins']['Decred']['lagging'];
$sia_lag = $json['coins']['Sia']['lagging'];
$lbc_lag = $json['coins']['LBRY']['lagging'];
if ($etc_lag) {
$etc = 0;
}
if($eth_lag) {
$eth = 0;
}
if ($dcr_lag) {
$dcr = 0;
}
if($sia_lag) {
$sia = 0;
}
if($lbc_lag) {
$lbc = 0;
}
echo date('Y-m-d H:i:s')."\n";
if ($etc > $eth) {
echo "ETC : ".$etc." > ETH ".$eth."\n";
if ($dcr > $sia and $dcr > $lbc) {
$n = "ETC-DCR";
echo "DCR : ".$dcr." > SIA ".$sia."\n";
echo "DCR : ".$dcr." > LBC ".$lbc."\n";
if ($n !== $l) {
copy("etc-dcr.txt", "config.txt");
echo "Switched to ETC-DCR\n";
}
} else if ( $sia > $dcr and $sia > $lbc ) {
$n = "ETC-SIA";
echo "SIA : ".$sia." > DCR ".$dcr."\n";
echo "SIA : ".$sia." > LBC ".$lbc."\n";
if ($n !== $l) {
copy("etc-sia.txt", "config.txt");
echo "Switched to ETC-SIA\n";
}
} else if ( $lbc > $dcr and $lbc > $sia ) {
$n = "ETC-LBC";
echo "LBC : ".$lbc." > DCR ".$dcr."\n";
echo "LBC : ".$lbc." > SIA ".$sia."\n";
if ($n !== $l) {
copy("etc-lbc.txt", "config.txt");
echo "Switched to ETC-LBC\n";
}
} else {
echo "DCR : ".$dcr." = SIA : ".$sia." = LBC : ".$lbc."\n";
}
} else if ($eth > $etc) {
echo "ETH : ".$eth." > ETC ".$etc."\n";
if ($dcr > $sia and $dcr > $lbc) {
$n = "ETH-DCR";
echo "DCR : ".$dcr." > SIA ".$sia."\n";
echo "DCR : ".$dcr." > LBC ".$lbc."\n";
if ($n !== $l) {
copy("eth-dcr.txt", "config.txt");
echo "Switched to ETH-DCR\n";
}
} else if ( $sia > $dcr and $sia > $lbc) {
$n = "ETH-SIA";
echo "SIA : ".$sia." > DCR ".$dcr."\n";
echo "SIA : ".$sia." > LBC ".$lbc."\n";
if ($n !== $l) {
copy("eth-sia.txt", "config.txt");
echo "Switched to ETH-SIA\n";
}
} else if ( $lbc > $dcr and $lbc > $sia ) {
$n = "ETH-LBC";
echo "LBC : ".$lbc." > DCR ".$dcr."\n";
echo "LBC : ".$lbc." > SIA ".$sia."\n";
if ($n !== $l) {
copy("eth-lbc.txt", "config.txt");
echo "Switched to ETH-LBC\n";
}
} else {
echo "Conf : ".$l."\n";
echo "DCR : ".$dcr." - SIA : ".$sia." - LBC : ".$lbc."\n";
}
} else {
echo "ETH : ".$eth." = ETC ".$etc."\n";
if ($dcr > $sia and $dcr > $lbc) {
$n = "ETH-DCR";
echo "DCR : ".$dcr." > SIA ".$sia."\n";
echo "DCR : ".$dcr." > LBC ".$lbc."\n";
if ($n !== $l) {
copy("eth-dcr.txt", "config.txt");
echo "Switched to ETH-DCR\n";
}
} else if ( $sia > $dcr and $sia > $lbc ) {
$n = "ETH-SIA";
echo "SIA : ".$sia." > DCR ".$dcr."\n";
echo "SIA : ".$sia." > LBC ".$lbc."\n";
if ($n !== $l) {
copy("eth-sia.txt", "config.txt");
echo "Switched to ETH-SIA\n";
}
} else if ( $lbc > $dcr and $lbc > $sia ) {
$n = "ETH-LBC";
echo "LBC : ".$lbc." > DCR ".$dcr."\n";
echo "LBC : ".$lbc." > SIA ".$sia."\n";
if ($n !== $l) {
copy("eth-lbc.txt", "config.txt");
echo "Switched to ETH-LBC\n";
}
} else {
echo "Conf : ".$l."\n";
echo "SIA : ".$sia." - DCR : ".$dcr." - LBC : ".$lbc."\n";
}
}
if ($n === $l) {
echo "Not switched\n";
}
echo "\n";
$l = $n;
sleep(300);
}
?>
my scrypt change auto the conf file, but it don't restart claymore. it's just for i can see and make a decision.
with all your information wallet, url of pool you use, worker, etc..