Thread: [User feedback required] Automatische Erhöhung des Tageslimits
View Single Post
  #6  
Old 11.06.2019, 06:46
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,082
Default

Quote:
Originally Posted by thecoder2012 View Post
Yes but it not works in my tests. I have only "false" as return value with callAPI+plugins+set/reset.
You were pretty much there.

Code:
var tempLimit = 100; // <- user specified

var interfaceName = "deprecated.jd.plugins.hoster.ShareOnlineBiz";
var displayName = "share-online.biz";
var key = "TRAFFIC_LIMIT";
var values = ["100", "99", "98", "97", "96", "95", "90", "80", "70", "60", "50", "40", "30", "20", "10"];

var oldValue = callAPI("plugins", "get", interfaceName, displayName, key); // Store old value
callAPI("plugins", "set", interfaceName, displayName, key, tempLimit.toString()); // Set temp value
callAPI("plugins", "set", interfaceName, displayName, key, values[oldValue]); // Restore old value
Reply With Quote