Quote:
Originally Posted by blacksun
ist es möglich bei einem bestimmten Guthabenstand bei einem CES das als Ereignis zu definieren und dann eine Aktion auszulösen?
Konkretes Vorhaben1:
Wenn Guthaben bei 9kw unter 100, deaktiviere 9kw-Solver
|
Vollständiges Beispiel:
Code:
// CES Aktion mit Prüfung vom Guthabenstand
// Trigger Required: Interval
var min_credits = 100;
var settings_9kw = "org.jdownloader.captcha.v2.solver.solver9kw.Captcha9kwSettings";
var apikey = callAPI("config", "get", settings_9kw, null, "ApiKey");
var prio = callAPI("config", "get", settings_9kw, null, "prio");
var confirm = callAPI("config", "get", settings_9kw, null, "confirm");
var https = callAPI("config", "get", settings_9kw, null, "https");
var credits_page = '://www.9kw.eu/index.cgi?action=usercaptchaguthaben&apikey=' + apikey;
var credits;
if (https == 1) {
credits = getPage("https" + credits_page);
} else {
credits = getPage("http" + credits_page);
}
if (credits.match(/^\d+$/)) {
if (parseInt(credits) < min_credits) {
callAPI("config", "set", "jd.controlling.captcha.CaptchaSettings", null, "captchamode", "SKIP_ALL"); //setDownloadsPaused(true);
} else {
callAPI("config", "set", "jd.controlling.captcha.CaptchaSettings", null, "captchamode", "NORMAL"); //setDownloadsPaused(false);
}
}