JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 12.09.2021, 12:20
tunayx's Avatar
tunayx tunayx is offline
JD Legend
 
Join Date: Mar 2009
Location: Xp Sp3 wth Java 7 No Firewall / Turkey
Posts: 739
Default Referenceerror name is not definied

The error appears only when I power on my pc, open JD2, press start download button. After that even I close, open JD2 add the same links and start the downloads it doesn't appear.

**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**

12.09.21 12.09.50 <--> 12.09.21 12.15.35 jdlog://6377825302851/

Example links
**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**

Last edited by tunayx; 12.09.2021 at 12:26.
Reply With Quote
  #2  
Old 12.09.2021, 12:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,371
Default

Quote:
Originally Posted by tunayx View Post
The error appears only when I power on my pc, open JD2, press start download button. After that even I close, open JD2 add the same links and start the downloads it doesn't appear.
According to you screenshot it is caused by eventscripter script named "split packages". Can take look if you post the script here.
Reply With Quote
  #3  
Old 12.09.2021, 18:46
tunayx's Avatar
tunayx tunayx is offline
JD Legend
 
Join Date: Mar 2009
Location: Xp Sp3 wth Java 7 No Firewall / Turkey
Posts: 739
Default

Quote:
Originally Posted by mgpai View Post
According to you screenshot it is caused by eventscripter script named "split packages". Can take look if you post the script here.
This is your own script here. also it appers not only at first start but during download a file.

https://board.jdownloader.org/showthread.php?t=70525

Last edited by tunayx; 12.09.2021 at 21:17.
Reply With Quote
  #4  
Old 13.09.2021, 08:25
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,371
Default

Quote:
Originally Posted by tunayx View Post
This is your own script here. also it appers not only at first start but during download a file.
That script uses linkgrabber context menu button tirgger, so any errors related to the script should only appear when you click the corresponding button. If the error appears during startup or download, it could most likely be due to a different trigger being used for the script, instead of the recommended/required trigger.
Reply With Quote
  #5  
Old 13.09.2021, 10:55
tunayx's Avatar
tunayx tunayx is offline
JD Legend
 
Join Date: Mar 2009
Location: Xp Sp3 wth Java 7 No Firewall / Turkey
Posts: 739
Default

I've just copied and pasted your script. This is the script I have. Also error occurs without using context menu or pressing anything. It just appears when a download starts and happens randomly.

Code:
// Split Packages and create sub-folder based on package length
// Trigger : Linkgrabber Contextmenu Button Pressed
// Forum Topic: https://board.jdownloader.org/showthread.php?t=70979

if (name == "Split Packages") {
    var package = lgSelection.getContextPackage();
    var links = package.getDownloadLinks();
    var newSize = 100; // Specify max number of links per package
    var UUIDS = [];
    var count = 1;

    if (links.length > newSize) {
        for (i = 0; i < links.length; i++) {
            var link = links[i];
            UUIDS.push(link.getUUID());
        }

        while (UUIDS.length) {
            var oldFolder = package.getDownloadFolder();
            var packageName = package.getName();
            var splitUUIDS = UUIDS.splice(0, newSize);
            var newFolder = oldFolder + "/" + pad(count);
            setNewFolder();
            count++;
        }
    }
}

// Add sub folder
function setNewFolder() {
    callAPI("linkgrabberv2", "movetoNewPackage", splitUUIDS, [], packageName, newFolder);
}

// Pad number with leading zeros
function pad(num) {
    var a = num + "";
    var b = (links.length / newSize).toFixed(0);
    while (a.length < b.length) a = "0" + a;
    return a;
}
Reply With Quote
  #6  
Old 13.09.2021, 18:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@tunayx: It's important to set the correct event type! You cannot simply change it when script relies on information only available on specific event type.
In this case the even type/trigger must be set to
Quote:
Trigger : Linkgrabber Contextmenu Button Pressed
Your screenshot shows that you did set on wrong one! looks like ON_PACKAGE_FINISHED
__________________
JD-Dev & Server-Admin
Reply With Quote
  #7  
Old 14.09.2021, 12:46
tunayx's Avatar
tunayx tunayx is offline
JD Legend
 
Join Date: Mar 2009
Location: Xp Sp3 wth Java 7 No Firewall / Turkey
Posts: 739
Default

Quote:
Originally Posted by Jiaz View Post
@tunayx: It's important to set the correct event type! You cannot simply change it when script relies on information only available on specific event type.
In this case the even type/trigger must be set to

Your screenshot shows that you did set on wrong one! looks like ON_PACKAGE_FINISHED
Thank you very much.
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 23:11.
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 - 2021, Jelsoft Enterprises Ltd.