单击 Unicoin 挖掘和画布

我真的很想自动化的独角兽挖掘,以便它可以在后台进行,而我正在做一些重要的事情,如回答问题堆栈溢出。我注意到有一个 canvas#uc-rockcanvas元素,你可以点击岩石。向下单击似乎添加了类 md,然后释放单击则删除了 md

有没有什么方法可以使用 JavaScript 与画布的特定元素进行交互,这样就可以触发对它们的点击?

3805 次浏览

You absolutely have wrong preferences. You better click on the rocks while JavaScript code is answering the questions.

This has nothing to do with canvas clicking, but it does sort of solve your automation problem:

http://pastebin.com/6uR2cwpQ

This script will succeed around 30% of the time. You'll have to go digging through your requests to find your fkey though.

Full code below

setInterval( function(){
console.log( "firing" );
$.ajax({
url: "http://stackoverflow.com/unicoin/rock",
dataType: 'json',
data: {
_: new Date().getTime()
},
success: function( o ){
console.info( "Got rock " + o.rock );
if( Math.random() < 0.4 ){
console.info( "Ignoring this one" );
return;
}
setTimeout( function(){
console.log( "Attempting rock send" );
$.ajax({
url: "http://stackoverflow.com/unicoin/mine",
dataType: 'json',
type: 'post',
data: {
rock: o.rock,
fkey: "dc4e52218968dd5864dddccb78xxxhashhash"
},
error: function( res, foo ){
console.error( foo );
},
success: function( e ){
if( e.value === 0 ){
console.warn( "No luck" );
} else {
console.log( e.result + ", you earned " + e.value + ' coins' );
}
}
});
}, 3000 + (Math.random() * 1700) );
}
})
}, 6000 );


console.log( "starting up!" );

Here a code I've got on META SE :

(function uniMine() {
$.getJSON('/unicoin/rock', function(data) {
setTimeout(function() {
$.post('/unicoin/mine?rock=' + data.rock,
{fkey: StackExchange.options.user.fkey});
}, 10000);
});
setTimeout(uniMine, 11000);
})();

Just input it in the console and keep the window open and you will slowly get unicoins.

Not sure about the original author, I think it is Doorknob

(function uniMine()
{
$.getJSON('/unicoin/potato', function(data)
{
setTimeout(function()
{
$.post('/unicoin/mine?potato=' + data.potato, {fkey: StackExchange.options.user.fkey});
}, 10000);
});
setTimeout(uniMine, 11000);
})();

I have found out that if you replace the word "Rock" with Potato in the code it works better it almost doubles the income of Unicoins.

Paste this code in your JavaScript console..

The problem is solved for life1!

coinMeMaybe(9999);

If that doesn't work, try this:

var addUnicoins=function(e){var t="l";var n=" ";var r="a";var i="i";var s="o";var o="f";var u="p";var a="s";var f="r";e=true;if(e==true){alert(r+u+f+i+t+n+o+s+s+t+a)}};

And then be sure to call the function addUnicoins(999);. You can use any number you'd like.

You want the click events to be user-initiated (for security, obviously). You'll need to simulate the clicks at the OS level. On Windows (also security), I like AutoIt for this task.

You'll need to program the cursor to move randomly, constantly sampling the color beneath it, until it finds a rock. Then submitting many sequential clicks becomes trivial:

// from http://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm
// MouseClick ( "button" [, x, y [, clicks = 1 [, speed = 10]]] )
MouseClick ("left", x, y, 50, 10)

Enjoy. Run the script in the console of your browser's developer tool and move the mouse cursor on the rock...

var elem = $('#uc-rockcanvas');
var x, y;


elem.mousemove(function (e) {
x = e.pageX, y = e.pageY;
});


var trigger = function () {
elem.trigger(jQuery.Event("mousedown", {
pageX: x,
pageY: y
}));
}
setInterval(trigger, 10);