#1
|
|||
|
|||
[Event Scripter] Help for a script
Hi, I'm trying to achieve a simple JD behaviour, but I don't know how to write the script. I've tried to modify the below script, but without succeeding.
Code:
//Pause downloads during extraction // Trigger Required: Any Extraction Event // Enable "Synchrounous Execution" checkbox in the top panel // Related Post: https://board.jdownloader.org/showpo...&postcount=398 (function() { if (!isDownloadControllerRunning()) return; if (!callAPI("extraction", "getQueue").length) return; if (!isDownloadControllerPaused()) setDownloadsPaused(true); while (callAPI("extraction", "getQueue").length) sleep(1000); if (isDownloadControllerPaused()) setDownloadsPaused(false); })(); I'd like that when an extraction start the download gets stopped until the extraction is finished, then I'd like that the download starts again. A help would be very appreciated, I really don't understand how to figure it out. Thanks. Last edited by Kayn; 25.01.2021 at 00:45. |
#2
|
|||
|
|||
Quote:
Code:
/* Stop downloads during extraction Trigger Required: Any Extraction Event */ if (isDownloadControllerRunning()) { stopDownloads(); while (callAPI("extraction", "getQueue").length) { sleep(1000); } startDownloads(); } |
#3
|
|||
|
|||
Thanks a million, that works like a charm However now the option "shutdown after downloads completed" or even "close Jdownloader after downloads completed" don't work anymore
|
#4
|
|||
|
|||
Does not close/shut down at all, or closes/shuts down before the downloads are finished?
|
#5
|
|||
|
|||
Not shuts itself down/close at all...
|
#6
|
|||
|
|||
There is a possibility of closing/shutting down when downloads are pending, since JD may trigger shutdown because downloads have stopped. But I do not see it preventing close/shutdown. I can confirm it since during my test I was able to both close/shutdown when the downloads were interrupted by the script.
Check the shutdown extension settings. By default it resets every session. There is a setting to prevent it. |
#7
|
|||
|
|||
Sorry if I pick this up after long time, but I moved to JDownloader on Synology and I'm not able to save the script
I mean it saves the script but it doesn't run it or even memorize it properly because when I came back to check the script is disappered...any tip ? |
#8
|
|||
|
|||
Are you adding the script using GUI (Desktop) or WebUI?
|
#9
|
|||
|
|||
|
#10
|
|||
|
|||
Install/test the script in GUI and then copy the "EventScripter.scripts" value from advanced settings to headless install using WebUI OR copy "org.jdownloader.extensions.eventscripter.EventScripterExtension.scripts.json" file from the 'cfg' folder in GUI, to the headless install.
If it still does not work, copy the "EventScripter.scripts" value from WebUI advanced settings and post it here. |
#11
|
|||
|
|||
Quote:
|
Thread Tools | |
Display Modes | |
|
|