View Single Post
  #1380  
Old 19.05.2020, 21:57
sherif011 sherif011 is offline
Super Loader
 
Join Date: Jul 2018
Posts: 27
Default

Quote:
Originally Posted by zreenmkr View Post
leave the 2nd script alone, dont change anything there. because trigger is interval, it runs silently in the background every x number of mili-seconds (change that at top right corner of eventscript editor, 1000 = 1second) to check if x GB limit is met that is set by the 1st script.

1st script is a controller, allows your to enter x GB limit and also start a new session everytime you select/click on it. to activate the controller, create a button or a menu selector for it. there are 3 options for trigger described but there are also other options to do that.

the 3 commonly used are Toolbar Button at the top, or add menu selector when you Right-Mouse-Click or in the Main menu.

here is the **External links are only visible to Support Staff**..., But the easiest way is after you set trigger to e.g 'Toolbar Button Pressed', go back into eventscripter editor, there is now a button at the top call 'Main Toolbar', click on that, follow the tutorial above to create a button. rename 'Event Scripter' to 'Start Monitor Loaded Bytes'
Quote:
Originally Posted by mgpai View Post
NOTE: Do not delete partiallly/completely downloaded links from the list, when the downloads are running.

Code:
// Limit per download session
// Trigger: Download Controller Started

var limit = 20; // <- Session limit (GB)
var interval = 30; // <- Interval between checks (seconds)

var getLoadedBytes = function() {
    return callAPI("polling", "poll", {
        "aggregatedNumbers": true
    })[0].eventData.data.loadedBytes;
}

var loadedBytes = getLoadedBytes();

while (isDownloadControllerRunning() || isDownloadControllerPaused()) {
    sleep(interval * 1000);
    if ((getLoadedBytes() - loadedBytes) / 1e9 > limit) stopDownloads();
}
Thanks guys, appreciate your help
Reply With Quote