JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 13.09.2019, 14:57
athydwsz athydwsz is offline
Modem User
 
Join Date: Sep 2019
Posts: 3
Default How do I accomplish this?

I'm trying to replicate the queuing mechanism of Internet Download Manager (IDM). In IDM, you can create queues. In each queue, you can set to only download one file at at time, and you can also set a schedule. The closest thing I can get this feature on JDownloader 2 is by putting downloads on a package. The problem with that is when you start a package, everything inside it downloads simultaneously.
Reply With Quote
  #2  
Old 13.09.2019, 15:07
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,362
Default

You can only controll via
1.) max global concurrent downloads
2.) max concurrent downloads/per host
I'm sorry but there is no queue system similiar to IDM one. You can also make use of priority system and of course the order of the links/packages
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 13.09.2019, 15:54
athydwsz athydwsz is offline
Modem User
 
Join Date: Sep 2019
Posts: 3
Default

Okay. Thanks!
Reply With Quote
  #4  
Old 13.09.2019, 16:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,362
Default

You're welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #5  
Old 15.09.2019, 04:33
Demongornot Demongornot is offline
Ultra Loader
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 49
Default

Hello, I am new on this forum, I originally registered to ask questions about scripting, then I saw your post @athydwsz and I wrote a script to enable you to have this feature in JDownloader 2.
I only code in Javascript (the language used for scripts in JDownloader 2) since few days, actually starting doing so for writing scripts in JDownloader 2, but I know other programming language so this isn't difficult for me as it is relatively standard.
But I do apologize for any possible errors in the code.

I wrote enough commentaries inside it so you can guess with minimum programming knowledge what it does (to not scare you from running a stranger's code), anyone feel free to use, share and modify it !

The comments on top of the code describe what it does, how it does that (simply) and it contain all the instructions to go from putting it into JDownloader 2 for someone who don't know about the Event Scripter to prepare downloads for the auto starting feature, I think this is pretty foolproof and that it contain every details required to use it fully, but don't hesitate to ask if there is something you don't understand or if you notice an undesired behaviour.

Here is the code :

Code:
/*
Auto Shedule Script by Demongornot for JDownloader 2.
This is a simple script which allow to set a certain minimum starting point for downloads.
You can set individual download to start at(after) an exact time, here is how it work :

First you'll need to enable JDownloader 2 Event Scripter if this isn't already done and then create this script, follow those steps :
Go to JDownloader 2 > Settings > Extension Modules > Event Scripter then on the top right check the Checkbox to enable Event Scripters if this is not already done.
Down left click the "Add" button if the list is empty though one should already be available, but you'll only see a Checkbox, empty space, a drop down menu with "None" and a "edit" button.
Now (double) click on the empty script and name it as you want "Auto Shedule Script by Demongornot" for example.
On the drop down menu right to the name part, click and select "Interval", do NOT check the script checkbox yet, click on the "edit" button.
A windows appear, remove the text already in it and paste this entire code including "/*" at the beginning, check the "Synchronous execution of script" checkbox and set the "Call interval in ms" to 60000 (up right).
Now down right click the "Save" button, the script windows is now closed, check the Checkbox of this script to enable it, and it should now run automatically every minutes.


The script must be set as "Interval" mode, meaning it will check for Downloads to start each x(the number in the bar over) milliseconds, reminder : 1000 milliseconds = 1 second.
I advise you to not set it under 1 second (1000ms), mainly if you have a low performance computer and/or a lot of downloads.
Around/between 30 seconds and few minutes is ideal to not overload small computer and/or big Downloads list and not risk script launching twice at once, while still have a precise enough checking interval.
Checking or unchecking "Synchronous execution of script" is user discretion and overlapping of this script shouldn't cause any issues, but I'd still advise to check this option and set reasonable interval.
Note that it will check and launch every downloads past (and not at/equal) the starting date and time you set.

How to :
What will be checked is downloads in your Downloads list (not in the LinkGrabber) for if they have the keyword + starting date and time as comment.
Simply right click and Disable all downloads you want to download at a specific time (you can still start & add Disabled ones from the LinkGrabber to your Downloads list while they are Disabled).
And add in their Comments that exact key word "AutoSchedule: " (Upper and lower case and the space count) followed by the date and time in this exact format "MM/DD/YYYY HH:MM:SS".
For example Today as the 14th of September at 17h50 (UTC + 01:00) in 2019 as I wrote this, you will write "AutoSchedule: 09/14/2019 17:50:00".
IMPORTANT ! Add a zero before any number smaller than 10, for example from January to September, use the 01 to 09 and NOT 1 to 9, it apply to Month, Days, Hours, Minutes and Seconds.
Note that you are free to add anything you want as comment after the keyword and date & time, no special sign needed, not even a space if you don't want to.
The reason is because this script check an exact number of character, so whatever is after the 2th seconds digit don't matter, which is also why you need to respect the format.
Note that thanks to the 4 digit of the year format, this script technically can work until the end of the year 9999, technically...
You can do it to existing files in your Downloads list or prepare them in your LinkGrabber.
In both case simply right click (or use the "Enable" checkbox in the download list if you Enabled it) and add the command line in the comment as described above.
The downloads in your Downloads list which past their schedule time will automatically be Enabled, meaning if your download "play" button is activated, they will automatically start.
You have an auto start "autoStart" option which allow for automatically start JDownloader download "play" button if set to 1.
In case the auto start is set to 0, the only thing that will be checked is if the download "play" button is Enabled or not.
In pause count as disabled except if you use autoStart mode 2.
Once one of your download is finished, feel free to remove the comment line code, finished download won't be re-Enabled by this script.
Packages and all LinkGrabber Comments won't be read, which is why this is advised to write the starting time in the Comment while your download is still in the LinkGrabber, but you can also do it in Downloads.
Note : To write a comment normally you right click on a download and go to Properties > Comment, but you can also use the comment info column (double click) or use the properties panel if you enabled them.

In short :
1 : Disable your links you want to autostart in both Downloads and LinkGrabber list, for the latter proceed (before or after step 2) to "start download" to move them into your downloads list.
2 : Add exactly "AutoSchedule: MM/DD/YYYY HH:MM:SS" (obviously, replace the letter in this example by the proper date and time numbers) optionally followed by whatever you want in download's comment.
3 : Profit.
*/
var autoStart = 1; //Auto start 1 mean it is enable, and 0 mean disable, optionally 2 allow to still start(enable) scheduled downloads if your downloads are paused.

//_________________________________________________________________________________________________

//Check if the mode allow the main loop to be executed.
if (autoStart == 1 || ((autoStart == 0 && isDownloadControllerRunning() && !(isDownloadControllerPaused())) || (autoStart == 2 && (isDownloadControllerRunning() || isDownloadControllerPaused())))) {
    //Get the list of all Packages in your download list inside the array allMyPackages.
    //If there is none (which also mean no downloads) the script simply don't do anything except checking again at the next interval.
    var allMyPackages = getAllFilePackages();
    if (allMyPackages.length > 0) {
        var keyWord = 'AutoSchedule: ';

        //If there is packages (there can't be packages without downloads anyway) the array allMyDownloads will get all download links inside theses packages.
        var allMyDownloads = [];
        for (var counter = 0; counter < allMyPackages.length; counter++) {
            allMyDownloads.push(allMyPackages[counter].getDownloadLinks());
        }

        //Now only relevant downloads will be copied inside the array scheduledDownloads
        var scheduledDownloads = [];
        for (var counterA = 0; counterA < allMyDownloads.length; counterA++) {
            //alert(allMyDownloads[counterA].length);
            for (var counterB = 0; counterB < allMyDownloads[counterA].length; counterB++) {
                var download = allMyDownloads[counterA][counterB];
                if (download.getComment() != null) {
                    if (download.getComment().length > 0 && download.getComment().length > keyWord.length + 18 && download.isEnabled() == false && download.isFinished() == false) {
                        scheduledDownloads.push(download);
                    }
                }

            }
        }
        //If there is downloads with the key word, disabled and not finished (meaning they are waiting to be auto activated) in the array,
        //Their activation date & time will be checked, and if their activation time has been passed, they'll be activated.
        if (scheduledDownloads.length > 0) {
            var valid = false;
            for (var counter = 0; counter < scheduledDownloads.length; counter++) {
                var time = new Date(scheduledDownloads[counter].getComment().substring(keyWord.length, keyWord.length + 19));
                if (Object.prototype.toString.call(time) === "[object Date]") {
                    if (!(isNaN(time.getTime()))) {
                        if (time < new Date()) {
                            valid = true;
                            scheduledDownloads[counter].setEnabled(true);
                        }
                    }
                }
            }
            //If there is downloads to be started and autoStart is enabled in mode 1 or 2, start downloads if they aren't already.
            if ((isDownloadControllerIdle() || isDownloadControllerStopping()) && valid == true && (autoStart == 1 || autoStart == 2)) {
                startDownloads();
            }
        }
    }
}
Enjoy !

Edit :
I can't believe I was this stupid, I thought you only asked for the auto schedule feature, well I'll try and add tomorrow a feature to only download files with the same "ID" (will work the same way you write time in comment to auto schedule them) will only download one by one even if they also contain schedule informations and the time is date & time is already reached.

Last edited by Demongornot; 15.09.2019 at 04:37.
Reply With Quote
  #6  
Old 16.09.2019, 08:37
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,362
Default

@Demongornot: Wow, thanks for sharing Looks like mgpai got a new student Maybe link it in https://board.jdownloader.org/showthread.php?t=70525 too
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 18.09.2019, 15:49
Demongornot Demongornot is offline
Ultra Loader
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 49
Default

Quote:
Originally Posted by Jiaz View Post
@Demongornot: Wow, thanks for sharing Looks like mgpai got a new student Maybe link it in **External links are only visible to Support Staff**... too
Thanks you !
Well since this isn't really what OP asked for, I'll make a queue script and post it here too, then I'll combine both into a queue and starting time script (as OP asked for) that I'll post in "[Event Scripter] Scripts" with the links of the posts here for the Auto schedule script and the future Queue script, in case if someone want only one of the two feature.
Reply With Quote
  #8  
Old 18.09.2019, 16:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,362
Default

Looks like you're having fun with the Eventscripter

When you need new methods or parameters, please just contact us via support@jdownloader.org
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 18.09.2019, 20:00
Demongornot Demongornot is offline
Ultra Loader
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 49
Default

I guess that mean you saw my Youtube Subtitle Script thingy
Lets say that some script like the Subtitle one I wanted/needed them, but others like the Scheduler is more for helping, in both cases I also love programming, even if sometimes I got stuck and realise I just misplaced a comma or something and it drive me crazy and I also do it for discovering Javascript as I just got started less than a week ago with it, it help me pushing my programming knowledge since it have some unique particularities and coding with the Eventscripter get me motivated to get back to my main personal projects.

Well, maybe, when using the trigger "A new link has been added", we can't get link UUID and package from the "myPackagizerLink", in my Subtitle Script as I needed to set and add link variant, I needed the UUID for both, this mean I was forced to basically go through all "myCrawledLink[] = getAllCrawledLinks();" links and check for matching URL and name to find the right one and finally use ".getUUID()" and ".getPackage().getUUID()".
So having "myPackagizerLink.getUUID()" and "myPackagizerLink.getPackage()" would be useful.

Also being able to get some data (like UUID, name etc) of other files which have been added through the same link while using "A new link has been added" to be able to remove unwanted ones or for my Subtitle Script as example, being able to get the original Youtube video file UUID so the when calling "linkgrabberv2", "addVariantCopy" I can put the Youtube video UUID for the file our added one should get placed after, talking of which, when calling the API for those parameters, it would be awesome if it optionally could return the UUID of the added variant file when we add an additional parameter, like :
/linkgrabberv2/addVariantCopy?linkid&destinationAfterLinkID&destinationPackageID&variantID&getNewFileData

And finally, something for fusionning packages and crawled packages (maybe there is and I missed it) like "myCrawledPackage.copyTo(UUID of the package the files will go to);" rather than looping through all the files inside a package and put each files individually to a the wished package, bu the way is it even possible to do it in a myCrawledLink.setPackage(package UUID); fashion ? because I didn't find it.

Anyway thanks.

Edit :
I am extremely surprised there isn't the "confirm" method nor a method or API function to read a file, I wanted to make a script that allow user to set a list of things "files names and other" and I haven't found any ways to read any files of any kind except those inside core.jar with the API "config" "get"...

Last edited by Demongornot; 20.09.2019 at 20:37.
Reply With Quote
  #10  
Old 19.09.2019, 15:07
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,362
Default

I will answer this tomorrow/monday
__________________
JD-Dev & Server-Admin
Reply With Quote
  #11  
Old 22.09.2019, 12:53
athydwsz athydwsz is offline
Modem User
 
Join Date: Sep 2019
Posts: 3
Default

Is there a way to receive an email when someone responds to this thread? I wouldn't have seen the new replies if I didn't go this website again. Did you guys receive a notification of this comment?
Reply With Quote
  #12  
Old 22.09.2019, 13:36
Demongornot Demongornot is offline
Ultra Loader
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 49
Default

Quote:
Originally Posted by athydwsz View Post
Is there a way to receive an email when someone responds to this thread? I wouldn't have seen the new replies if I didn't go this website again. Did you guys receive a notification of this comment?
Well by default this is disabled, you automatically subscribe to a thread when you post on it or create it, you can manage your subscribed threads by going to the main navigation bar (where there is Home, News, Download, Changelog etc on top of the page), go to Extended > Subscribed Threads (down the list).
If you want email, you go to Extended > Edit Options > (You'll have Login & Privacy, just under it you have) Messaging & Notification > (The second option setting from here is) Default Thread Subscription Mode > You can now choose the option you want.

I just finished the "Beta" of the Download Queue script, I'll put the final touch to it and post it here in like 2 or 3 hours max.
Then I'll proceed to make a script which mix them both so you have both download queue and you'll be able to set schedule for regular downloads and for download queues, it will probably be possible to put a schedule in the middle of a queue, meaning it will pause this queue until it reach its starting time, for the moment in my actual version what you can do is make a package as queue so all downloads inside are queued (and you can still put those you want inside said package as part of another queue) or create a queue from other downloads regardless of their folders.

If you have features to suggest, this is the perfect moment !
By the way I think I'll put a feature to exclude downloads from a queue in a folder.
Reply With Quote
  #13  
Old 22.09.2019, 16:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 611
Default

Quote:
Originally Posted by Demongornot View Post
... I haven't found any ways to read any files of any kind except those inside core.jar with the API "config" "get"...
Eventscripter Global API method:
Code:
var myString = readFile(myString/*filepath*/);/*Read a text file*/
/* Example: */var myString = readFile(JD_HOME+"/license.txt");
Reply With Quote
  #14  
Old 22.09.2019, 18:28
Demongornot Demongornot is offline
Ultra Loader
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 49
Default

Quote:
Originally Posted by mgpai View Post
Eventscripter Global API method:
Code:
var myString = readFile(myString/*filepath*/);/*Read a text file*/
/* Example: */var myString = readFile(JD_HOME+"/license.txt");
Thanks my hero !!!

My code for the Auto Queue Script is done and passed my basic testing, every instructions are written as comment inside it, here is the code :

Code:
/*
Auto Queue Script by Demongornot for JDownloader 2.
This is a simple script which allow to create Queues so downloads start one after the other.
You can create queues from unique downloads or from packages, here is how it work :

First you'll need to enable JDownloader 2 Event Scripter if this isn't already done and then create this script, follow those steps :
Go to JDownloader 2 > Settings > Extension Modules > Event Scripter then on the top right check the Checkbox to enable Event Scripters if this is not already done.
Down left click the "Add" button if the list is empty though one should already be available, but you'll only see a Checkbox, empty space, a drop down menu with "None" and a "edit" button.
Now (double) click on the empty script and name it as you want "Auto Queue Script by Demongornot" for example.
On the drop down menu right to the name part, click and select "Interval", do NOT check the script checkbox yet, click on the "edit" button.
A windows appear, remove the text already in it and paste this entire code including "/*" at the beginning, uncheck the "Synchronous execution of script" checkbox and set the "Call interval in ms" to 60000 (up right).
Now down right click the "Save" button, the script windows is now closed, check the Checkbox of this script to enable it, and it should now run automatically every minutes.


The script must be set as "Interval" mode, meaning it will check for Downloads in queue each x(the number in the bar over) milliseconds, reminder : 1000 milliseconds = 1 second.
I advise you to not set it under 1 second (1000ms), mainly if you have a low performance computer and/or a lot of downloads.
Around/between 30 seconds and few minutes is ideal to not overload small computer and/or big Downloads list and not risk script launching twice at once, while still have a precise enough checking interval.
Checking or unchecking "Synchronous execution of script" is user discretion and overlapping of this script shouldn't cause any issues, but I'd still advise to uncheck this option and set reasonable interval.
Note that the script only control downloads in queue and don't interfere with others, meaning they will run normally alongside.

How to :
What will be checked is downloads in your Downloads list (not in the LinkGrabber) for if they have the keyCode + your queue name + the keySign as comment.
And add in their Comments what is written in keyCode (by default this is "QueueCode: ") (Upper and lower case and the space count) followed by what name you want and ended with the keySign ("#" by default).
For example every downloads and packages with "QueueCode: My Queue 1#" in their comment will be in the same queue, note that space before and after the name will be ignored,
Meaning that "QueueCode: My Queue 1#" and "QueueCode:   My Queue 1   #" will be considered as the same queue, but "QueueCode: My     Queue   1#" won't.
Note that you are free to add anything you want in the comments before and after the queue code, if the queue code isn't exact, don't contain something other than space or the ending sign is missing, it will be ignored.
You have an auto start "autoStart" option which allow for automatically start JDownloader download "play" button if set to 1, so if a queue ended while the script wait for the next interval and the download controller stop,
you won't endup in a situation where your downloads simply stalled while valid files were still available to download.
In case the auto start is set to 0, the only thing that will be checked is if the download "play" button is Enabled or not.
In pause count as disabled except if you use autoStart mode 2.
Once one of your download is finished, feel free to remove the comment line code as you want, the script only look for unfinished downloads.
Note : To write a comment normally you right click on a download and go to Properties > Comment, but you can also use the comment info column (double click) or use the properties panel if you enabled them.

Special notes :
All packages with queue code in their comment will be a queue list of all downloads inside them, you can exclude one by writing the queue code and the excludeCode (by default "Exclude") as queue name.
You can also write another queue name, the downloads with other queue name than the packages will be part of the queue list of the same name they have.
You can set individual downloads regardless of packages as queue, they will all be part of the same queue.
Note that you are free to change the keyCode, keySign and excludeCode as you desire, the keyCode can even start with or include the same character as keySign, so "@Qc: your queue name@" will be valid,
Technically even "@your queue name@" should be valid, though I haven't tested it.
Of course you can't write the keySign inside your queue name as it mark the end, so "QueueCode: Downloads#42#" queue name will be "Downloads" and not "Downloads#42".

In short :
1 : Write keyCode (by default "QueueCode: ") + the name of your queue + keySign (by default "#") in packages and/or download's comments to create queues.
2 : Profit.
*/

var keyCode = 'QueueCode: '; /*Code to write to to set a queue name.*/
var keySign = '#'; /*Code to write at the end of the queue name, can't work without it.'*/
var excludeCode = 'Exclude'; /*Queue name to exclude a download from a package queue*/
var autoStart = 1; /*Auto start 1 mean it is enable, and 0 mean disable, optionally 2 allow to still start(enable) queued downloads if your downloads are paused.*/

//_________________________________________________________________________________________________

//Check if the mode allow the main loop to be executed.
if (autoStart == 1 || ((autoStart == 0 && isDownloadControllerRunning() && !(isDownloadControllerPaused())) || (autoStart == 2 && (isDownloadControllerRunning() || isDownloadControllerPaused())))) {
    /*Get the list of all Packages in your download list inside the array allMyPackages.*/
    /*If there is none (which also mean no downloads) the script simply don't do anything except checking again at the next interval.*/
    var allMyPackages = getAllFilePackages();
    if (allMyPackages.length > 0) {
        /*If there is packages (If there is downloads, there is at least a package), each of them will be readed to see if they contain a valid Queue code in their comment.*/
        var txt = "";
        var downloadQueue = [];
        var codeList = [];
        var kcl = keyCode.length - 1;
        var i = 0;
        for (i = 0; i < allMyPackages.length; i++) {
            var t = allMyPackages[i].getComment();
            var tempArray = [-1, ''];
            if (t != null) {
                var firstPosition = t.indexOf(keyCode);
                var lastPosition = t.indexOf(keySign, firstPosition + kcl);
                if (firstPosition >= 0 && lastPosition > 0) {
                    var keyWord = t.substring(firstPosition + kcl, lastPosition);
                    keyWord = keyWord.trim();
                    //If the package contain a valid queue code and name in its comment, setup all the variables to create a queue from it if it doesn't already exist.
                    var cli = codeList.indexOf(keyWord);
                    if (keyWord.length > 0 && cli < 0) {
                        var dql = downloadQueue.length;
                        downloadQueue[dql] = [i];
                        codeList.push(keyWord);
                        tempArray = [dql, keyWord];
                    } else if (cli > 0) {
                        doanloadQueue[cli][0] = [i];
                        tempArray = [cli, keyWord];
                    }
                }
            }

            //Get the list of all downloads inside the scanned package.
            var packageDownloads = allMyPackages[i].getDownloadLinks();
            var j = 0;
            //Go through all of them and get their comments.
            for (j = 0; j < packageDownloads.length; j++) {
                if (packageDownloads[j].isFinished()) continue;
                var t = packageDownloads[j].getComment();
                /*f there is no comment and the current package have one, they then belong to its queue.*/
                if (t == null) {
                    //if (i > 17 && j < 8) alert('Package name : ' + allMyPackages[i].getName() + '\nPackage comment : ' + allMyPackages[i].getComment() + '\nDownload : ' + packageDownloads[j] + '\nDownload comment : ' + t + '\nArray : ' + tempArray);
                    if (tempArray[0] >= 0) {
                        downloadQueue[tempArray[0]].push([packageDownloads[j].getUUID()]);
                    }
                    /*If the download contain a comment, compute if it contain a valid queue word.*/
                } else {
                    var firstPosition = t.indexOf(keyCode);
                    var lastPosition = t.indexOf(keySign, firstPosition + kcl);
                    /*If the download contain the two key words, check if they encapsulate a word and ignore surrounding spaces*/
                    if (firstPosition >= 0 && lastPosition > 0) {
                        var keyWord = t.substring(firstPosition + kcl, lastPosition);
                        keyWord = keyWord.trim();
                        //If indeed in contain something, process it.
                        if (keyWord.length > 0) {
                            if (keyWord == excludeCode) continue;
                            var keyWordAddr = codeList.indexOf(keyWord);
                            /*If the queue word already exist, simply add this download to the existing queue.*/
                            if (keyWordAddr >= 0) {
                                downloadQueue[keyWordAddr].push([packageDownloads[j].getUUID()]);
                                /*If the queue word don't already exist, then create a new queue with -1 as package address (no package), add the download to the newly created queue and add the queue word in the code list.*/
                            } else {
                                downloadQueue[downloadQueue.length] = [-1, packageDownloads[j].getUUID()];
                                codeList.push(keyWord);
                            }
                        } else {
                            /*If it doesn't contain a queue word and the package's comment have own, add to it.*/
                            if (tempArray[0] >= 0) {
                                downloadQueue[tempArray[0]].push([packageDownloads[j].getUUID()]);
                            }
                        }
                    } else {
                        /*If it doesn't contain a queue code and the package's comment have own, add to it.*/
                        if (tempArray[0] >= 0) {
                            downloadQueue[tempArray[0]].push([packageDownloads[j].getUUID()]);
                        }
                    }
                }
            }

        }
        var pass = false;
        /*Go through all the downloads, enable all the first of the list and disable the rest*/
        for (var i = 0; i < downloadQueue.length; i++) {
            for (var j = 1; j < downloadQueue[i].length; j++) {
                var dl = getDownloadLinkByUUID(downloadQueue[i][j]);
                pass = true;
                dl.setEnabled(false);
                if (j == 1) dl.setEnabled(true);
            }
        }
        //If there is downloads to be started and autoStart is enabled in mode 1 or 2, start downloads if they aren't already.
        if (pass && (isDownloadControllerIdle() || isDownloadControllerStopping()) && (autoStart == 1 || autoStart == 2)) {
            startDownloads();
        }
    }
}
As usual, tell me if you found any issues with it.

Last edited by Demongornot; 22.09.2019 at 20:13. Reason: Remove a variable I didn't filter out from the Auto Schedule script. (valid)
Reply With Quote
  #15  
Old 23.09.2019, 10:33
Demongornot Demongornot is offline
Ultra Loader
 
Join Date: Sep 2019
Location: Universe, Local group, Milky Way, Solar System, Earth, France
Posts: 49
Default

Here is a screenshot of the Queue Script when I was developing it, it show what key words it accept or not, might be more intuitive than the explanations I gave.
https://imgur.com/a/pnnJ2kj
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 21:44.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.