it should be in a config file because 290/290x mines differently than 280x (faster skein, slower groestl for the same scrypt mhash/s)
I made a php script that does the same thing for windows:
https://bitbucket.org/iopq/automatic-algo-switcher-for-myriadcoin/
I scape the difficulties from the JSON api and my config file has the settings for an R9 290
if you want to do it from the wallet and run the wallet I suggest you use the same approach, I have scrypt disabled because it takes too much power
what you might want to also do is scrape the price info, let the user specify the power usage of each algo (and $/watt), and calculate the most profitable algo based on current price and selling immediately after mining
Hmmm I was wondering about that. The "Coins/Scrypt MH" number seems to give me a good enough approximation of profitability for my R9 280x for my purposes, but I see that to do it properly those numbers would need to be weighted for different GPUs. I guess the numbers are just discovered experimentally? I don't have the time (or the equipment) to work out the weightings for coin production on different algos and different hardware unfortunately. Your idea for letting the user specify the power and doing a proper cost analysis before choosing the algo is great... but again I'm not sure I have the time right now to implement that
I think I will take up foodie's offer of a nice simplified "Coins/Scrypt MH" webpage to get the numbers from and leave it at that for now. I'll also implement a decent algo choosing mechanism - maybe based on the setting of the commands at the top of the script (ie: no command for a given algo means leave that algo out of the running).
At some point I'll put it on github and open it up if people are interested in contributing?
Also - a question for the devs and other coin-tech people: Is the constant switching of miners between algos in this way considered harmful to the coin? Obviously if *all* miners were switching en-mass on the hour, it would cause some pretty wild and weird swings in difficulty and hash rates for the algos... I know auto-switching pools are frowned upon for this reason by some people. When you have big enough hordes of miners chasing profit from coin to coin it can severely impact hashrates and leave coins vulnerable to attack at certain times. I suppose chasing profit *within the one coin* as we are doing here is not as bad... but then its open for analysis / discussion.
Thanks. I will tip you well if you can set up a simplified Coins/Scrypt MH webapge taht accounts for different GPU benchmarks.
I don't think the constant switching of miners between algos would be harmful. The difficulties for each algo retarget after every block that algo finds, but I'm not sure what type of memory kernal is put in place (how far into the past it using the hashrates).