Answer the question
In order to leave comments, you need to log in
How to fix script stop?
All good.
There is a userscript (some variables and husks, not very informative, I threw away):
(function (window, undefined) { // [2] нормализуем window
var w;
if (typeof unsafeWindow != undefined) {
w = unsafeWindow;
} else {
w = window;
}
if (w.self != w.top) {
return;
}
function start() {
var read = getread();
checkResult(read);
}
function checkResult(last_read) {
setTimeout(function() {
if (last_read < getread()) {
} else if (last_read > getread()) {
} else {
checkResult(last_read);
}
}, 500);
}
function getread() {
var read_text = $('.read_select .chosen-single span').text();
var regex = /[+-]?\d+(\.\d+)?/g;
var floats = read_text.match(regex).map(function(v) {
return parseFloat(v).toFixed(8);
});
return floats[0];
}
function minimum_rate() {
}
function callnetwork() {
}
})(window);
Answer the question
In order to leave comments, you need to log in
Sometimes on the checkResult function, the script cannot get a response from the site and it fulfills the third condition and restarts the checkResult function again.
console.log(last_read);
console.log(getRead());
console.log(last_read < getread());
console.log(last_read > getread());
function checkResult(last_read) {
setTimeout(function() {
if (last_read < getread()) {
} else if (last_read > getread()) {
} else {
checkResult(last_read);
}
checkResult(getRead());
}, 500);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question