ReferenceError: iimset is not defined Error code -991

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

ReferenceError: iimset is not defined Error code -991

by ookiemon on Fri Apr 10, 2015 10:46 am

Need help as i'm completely stuck and just cant find my way out

I have set of macros, that should run based on some conditioning. i set the whole thing in javascript - including the macros themselves as "CODES" (like var PRECHECKS = "CODE:"; ....)

what should happen (basically) is this:
1. Exract info on site A and put it into some variables (works)
2. go into site b and search one of the extracted variables in their search (retpre)
a: if found > go to site C and search it there, then return the result (works)
b: if NOT FOUND - search site B AGAIN, with different phrasing (retpre2). THEN if found continue to Site C.. if not continue to site D.

2b is where i have a problem. apparently i cant pass the variables i need for the second search correctly in the javascript code or it stops with ReferenceError: iimset is not defined, line 618 (Error code: -991).

variable 'Submitted_FoVed_SPACED_FileName' shows fine in the alert command just before the iimset command that suppose to pass it through 'MYSubmitted_FoVed_SPACED_FileName' to retpre2 (SingleMacro15) but then the code stops with 'ReferenceError: iimset is not defined Error code -991'

I really need the help as i just can't figure out what in my code is wrong and google/searching this forum just doesn't help. The code is pretty long

using iMacros for Firefox 8.9.2 and FireFox 36.0.4

var PRECHECK = iimPlay(PRECHECKS);
if (PRECHECK > 0) {
alert('PRECHECK > 0' + '\n' + 'Submitted_FoVed_FileName: ' + Submitted_FoVed_FileName + '\n' + 'Submitted_ByteNum: ' + Submitted_ByteNum + '\n' + 'Submitted_FoVed_SPACED_FileName:' + Submitted_FoVed_SPACED_FileName)
// *****************/ / puts extracted file name into a variable * * * * * * * * * * * * //
var SubmittedFileNameWITHext = (iimGetLastExtract(1)).trim()
var SubmittedFileName = iimGetLastExtract(2)
var Submitted_ByteNum = iimGetLastExtract(3); //(3) submitted byte size

[here comes lots of conditioning and phrasing for the 2nd search that i just removed as they irrelevant for my question i believe]

if (!/FoV/i.test(group)) var Submitted_FoVed_SPACED_FileName = SPACEDwoTitle;
else var Submitted_FoVed_SPACED_FileName = Submitted_FoVed_SPACED_woTitle;


iimSet("MYSubmitted_FoVed_FileName", Submitted_FoVed_FileName); //

var retPRE = iimPlay(SingleMacro);

PRE_CORRUPT_DIR_name = iimGetLastExtract(1); // = {{!VAR1}} =(3) DIR name from PRE.CORRUPT//07.02.2015 >!extract (1).. or maybe two

retSCNLOG = 0;
var retPRE2 = 0;
var Nuke_Reason;
var my_content = '';
if (retPRE > 0) { //(must have iimset for "MYSubmitted_FoVed_FileName" here or srrdb will go to 404page after pre.corrupt)

iimSet("MYSubmitted_FoVed_FileName", Submitted_FoVed_FileName); // = {{VAR2}} = (1) file name from torrent / foved. submitted file name w/o ext UNLESS its FOV (and then its converted) ///!!changed VAR1 to VAR2 as VAR1 is with space after SxxExx now to find pres even if submitter removed ep titles
iimSet("MYPRE_CORRUPT_DIR_name", PRE_CORRUPT_DIR_name); // = {{!VAR1}} =(3) DIR name from PRE.CORRUPT
iimSet("MYSubmitted_ByteNum", Submitted_ByteNum); // = {{VAR3}} = (2) submitted byte size
var retSRRDB = iimPlay(SingleMacro2);
if (retSRRDB < 0) {
if (retSRRDB == -933) { //933 is 404error
Submitted_SCNLGed_FileName = Submitted_FoVed_FileName.replace(/[^a-zA-Z '_' 0-9\\\\-]+/g, '-'); //changes the filename to scnlog url format ('-' for '.').looks like it should work also for fov names
iimSet("MYSubmitted_FoVed_FileName", Submitted_FoVed_FileName);
iimSet("MYSCNLGFileName", Submitted_SCNLGed_FileName);
iimSet("MYTorrentByteSize", Submitted_ByteNum);
iimSet("MYDIRNamePRECorrupt", PRE_CORRUPT_DIR_name);
var retSCNLOG = iimPlay(SCNLOGmacro);
if (retSCNLOG < 0) {
if (retSCNLOG == -990) alert(iimGetLastError() + '\n' +
if ((retSCNLOG == -933) && (iimGetLastError()
.indexOf("RuntimeError: Error loading page http://scnlog.eu") === 0)) {
err = 'Nothing Found';
iimPlay("CODE:TAB T=0");
alert(err);
}
if ((retSCNLOG == -1340) && (iimGetLastError()
.indexOf("MacroError:") === 0)) alert(iimGetLastError()); // + '\n' + '\'' + Submitted_FoVed_FileName + '\'' + '\n' + '\'' +PRE_CORRUPT_DIR_name + '\'' ); // -1340 = stops for macroerror
}
}
}
}
if (retPRE < 0) { //in this section IS WHERE THE -991 ERROR COME
alert('Submitted_FoVed_SPACED_FileName:' + Submitted_FoVed_SPACED_FileName) //VARIABLE SHOWS FINE IN THE ALERT
if (retPRE == -990) {
// if ((iimGetExtract().indexOf("Nothing") >= 0)) {

iimset("MYSubmitted_FoVed_SPACED_FileName", Submitted_FoVed_SPACED_FileName) //HERE IS WHERE THE -991 ERROR COME

var retPRE2 = iimPlay(SingleMacro15);
PRE_CORRUPT_DIR_name = iimGetLastExtract(1); // = {{!VAR1}} =(3) DIR name from PRE.CORRUPT
alert('Submitted_FoVed_FileName: ' + Submitted_FoVed_FileName + '\n' + ' Submitted_ByteNum: ' + Submitted_ByteNum + '\n' + 'Submitted_FoVed_SPACED_FileName: ' + Submitted_FoVed_SPACED_FileName + '\n' + 'PRE_CORRUPT_DIR_name: ' + PRE_CORRUPT_DIR_name);
alert('retPRE2: ' + retPRE2)
if (retPRE2 < 0) {}
if (retPRE2 > 0) {

iimSet("MYSubmitted_FoVed_FileName", PRE_CORRUPT_DIR_name); //
iimSet("MYPRE_CORRUPT_DIR_name", PRE_CORRUPT_DIR_name); // = {{!VAR1}} =(3) DIR name from PRE.CORRUPT
iimSet("MYSubmitted_ByteNum", Submitted_ByteNum); // = {{VAR3}} = (2) submitted byte size
var retSRRDB = iimPlay(SingleMacro2);
}
}
}
if ((retPRE == -1340) && (iimGetLastError()
.indexOf("MacroError:") === 0)) alert(iimGetLastError() + '\n' + '\'' + Submitted_FoVed_FileName + '\'' + '\n' + '\'' + PRE_CORRUPT_DIR_name + '\''); // -1340 = stops for macroerror
if (retPRE == -991) alert("life suck" + '\n' + iimGetLastError()); //
if (retPRE == -990) { // -990 = Fail_If_Found. will divert to this is release is not found in search pre.corrupt, or it's nuked
Nuke_Reason = iimGetExtract();
iimPlay("CODE:TAB T=0");
alert(Nuke_Reason); //will brings ERROR and not continuing to the rest if Nuke_Reason is not defined in the beginning as it is (Nuke_Reason = 0) [(if there isn't nuke reason]
}
}
ookiemon
 
Posts: 28
Joined: Sat Sep 08, 2012 8:04 pm

Re: ReferenceError: iimset is not defined Error code -991

by chivracq on Fri Apr 10, 2015 11:31 am

ookiemon wrote:Need help as i'm completely stuck and just cant find my way out

I have set of macros, that should run based on some conditioning. i set the whole thing in javascript - including the macros themselves as "CODES" (like var PRECHECKS = "CODE:"; ....)

what should happen (basically) is this:
1. Exract info on site A and put it into some variables (works)
2. go into site b and search one of the extracted variables in their search (retpre)
a: if found > go to site C and search it there, then return the result (works)
b: if NOT FOUND - search site B AGAIN, with different phrasing (retpre2). THEN if found continue to Site C.. if not continue to site D.

2b is where i have a problem. apparently i cant pass the variables i need for the second search correctly in the javascript code or it stops with ReferenceError: iimset is not defined, line 618 (Error code: -991).

variable 'Submitted_FoVed_SPACED_FileName' shows fine in the alert command just before the iimset command that suppose to pass it through 'MYSubmitted_FoVed_SPACED_FileName' to retpre2 (SingleMacro15) but then the code stops with 'ReferenceError: iimset is not defined Error code -991'

I really need the help as i just can't figure out what in my code is wrong and google/searching this forum just doesn't help. The code is pretty long

using iMacros for Firefox 8.9.2 and FireFox 36.0.4
Code: Select all
   var PRECHECK = iimPlay(PRECHECKS);
   if (PRECHECK > 0) {
     alert('PRECHECK > 0' + '\n' + 'Submitted_FoVed_FileName: ' + Submitted_FoVed_FileName + '\n' + 'Submitted_ByteNum: ' + Submitted_ByteNum + '\n' + 'Submitted_FoVed_SPACED_FileName:' + Submitted_FoVed_SPACED_FileName)
       // *****************/ / puts extracted file name into a variable * * * * * * * * * * * * //
     var SubmittedFileNameWITHext = (iimGetLastExtract(1)).trim()
     var SubmittedFileName = iimGetLastExtract(2)
     var Submitted_ByteNum = iimGetLastExtract(3); //(3) submitted byte size
   
[here comes lots of conditioning and phrasing for the 2nd search that i just removed as they irrelevant for my question i believe]

     if (!/FoV/i.test(group)) var Submitted_FoVed_SPACED_FileName = SPACEDwoTitle;
     else var Submitted_FoVed_SPACED_FileName = Submitted_FoVed_SPACED_woTitle;
   
   
         iimSet("MYSubmitted_FoVed_FileName", Submitted_FoVed_FileName); //
   
     var retPRE = iimPlay(SingleMacro);
   
      PRE_CORRUPT_DIR_name = iimGetLastExtract(1); // = {{!VAR1}} =(3)  DIR name from PRE.CORRUPT//07.02.2015 >!extract (1).. or maybe two
   
     retSCNLOG = 0;
     var retPRE2 = 0;
     var Nuke_Reason;
     var my_content = '';
     if (retPRE > 0) { //(must have iimset for "MYSubmitted_FoVed_FileName" here or srrdb will go to 404page after pre.corrupt)
     
       iimSet("MYSubmitted_FoVed_FileName", Submitted_FoVed_FileName); // = {{VAR2}} = (1) file name from torrent / foved. submitted file name w/o ext UNLESS its FOV (and then its converted) ///!!changed VAR1 to VAR2 as VAR1 is with space after SxxExx now to find pres even if submitter removed ep titles
       iimSet("MYPRE_CORRUPT_DIR_name", PRE_CORRUPT_DIR_name); // = {{!VAR1}} =(3) DIR name from PRE.CORRUPT
       iimSet("MYSubmitted_ByteNum", Submitted_ByteNum); // = {{VAR3}} = (2) submitted byte size
       var retSRRDB = iimPlay(SingleMacro2);
       if (retSRRDB < 0) {
         if (retSRRDB == -933) { //933 is 404error
           Submitted_SCNLGed_FileName = Submitted_FoVed_FileName.replace(/[^a-zA-Z '_' 0-9\\\\-]+/g, '-'); //changes the filename to scnlog url format ('-' for '.').looks like it should work also for fov names
           iimSet("MYSubmitted_FoVed_FileName", Submitted_FoVed_FileName);
           iimSet("MYSCNLGFileName", Submitted_SCNLGed_FileName);
           iimSet("MYTorrentByteSize", Submitted_ByteNum);
           iimSet("MYDIRNamePRECorrupt", PRE_CORRUPT_DIR_name);
           var retSCNLOG = iimPlay(SCNLOGmacro);
           if (retSCNLOG < 0) {
             if (retSCNLOG == -990) alert(iimGetLastError() + '\n' +
               if ((retSCNLOG == -933) && (iimGetLastError()
                 .indexOf("RuntimeError: Error loading page http://scnlog.eu") === 0)) {
                 err = 'Nothing Found';
                 iimPlay("CODE:TAB T=0");
                 alert(err);
               }
               if ((retSCNLOG == -1340) && (iimGetLastError()
                 .indexOf("MacroError:") === 0)) alert(iimGetLastError()); // + '\n' + '\'' + Submitted_FoVed_FileName + '\'' + '\n' + '\'' +PRE_CORRUPT_DIR_name + '\'' ); //  -1340 = stops for macroerror 
             }
           }
         }
       }
         if (retPRE < 0) {  [b]//in this section  IS WHERE THE -991 ERROR COME[/b]
                       alert('Submitted_FoVed_SPACED_FileName:' + Submitted_FoVed_SPACED_FileName) [b]//VARIABLE SHOWS FINE IN THE ALERT[/b]
                 if (retPRE == -990) {
                              //     if ((iimGetExtract().indexOf("Nothing") >= 0)) {
         
[b]          iimset("MYSubmitted_FoVed_SPACED_FileName", Submitted_FoVed_SPACED_FileName)  //HERE IS WHERE THE -991 ERROR COME [/b]
         
           var retPRE2 = iimPlay(SingleMacro15);
          PRE_CORRUPT_DIR_name = iimGetLastExtract(1); // = {{!VAR1}} =(3)  DIR name from PRE.CORRUPT
           alert('Submitted_FoVed_FileName: ' + Submitted_FoVed_FileName + '\n' + ' Submitted_ByteNum: ' + Submitted_ByteNum + '\n' + 'Submitted_FoVed_SPACED_FileName: ' + Submitted_FoVed_SPACED_FileName + '\n' + 'PRE_CORRUPT_DIR_name: ' + PRE_CORRUPT_DIR_name);
           alert('retPRE2: ' + retPRE2)
           if (retPRE2 < 0) {}
           if (retPRE2 > 0) {
           
             iimSet("MYSubmitted_FoVed_FileName", PRE_CORRUPT_DIR_name); //
             iimSet("MYPRE_CORRUPT_DIR_name", PRE_CORRUPT_DIR_name); // = {{!VAR1}} =(3) DIR name from PRE.CORRUPT
             iimSet("MYSubmitted_ByteNum", Submitted_ByteNum); // = {{VAR3}} = (2) submitted byte size
             var retSRRDB = iimPlay(SingleMacro2);
           }
         }
       }
       if ((retPRE == -1340) && (iimGetLastError()
         .indexOf("MacroError:") === 0)) alert(iimGetLastError() + '\n' + '\'' + Submitted_FoVed_FileName + '\'' + '\n' + '\'' + PRE_CORRUPT_DIR_name + '\''); //  -1340 = stops for macroerror 
       if (retPRE == -991) alert("life suck" + '\n' + iimGetLastError()); //
       if (retPRE == -990) { // -990 = Fail_If_Found. will divert to this is release is not found in search pre.corrupt, or it's nuked
         Nuke_Reason = iimGetExtract();
         iimPlay("CODE:TAB T=0");
         alert(Nuke_Reason); //will brings ERROR and not continuing to the rest if Nuke_Reason is not defined in the beginning as it is (Nuke_Reason = 0) [(if there isn't nuke reason]
       }
     }

Foufff, that's stg of a Script...! I hardly know anything about JavaScript as I don't use (yet...) .js Scripts, but it couldn't stg that stupid like you are using "iimset" instead of "iimSet" everywhere in the Script...?

The only thing I notice (or don't understand as I'm no JavaScript Guru...!) is the triple "===" just before your -911 Error in:
Code: Select all
if ((retSCNLOG == -1340) && (iimGetLastError()
                 .indexOf("MacroError:") === 0)) alert(iimGetLastError());
But maybe, it's just that I don't know this Syntax/Operator...

Good luck otherwise with some JavaScript Guru(s) trying to debug your Script..., I'm afraid I won't be able to help you...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6484
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: ReferenceError: iimset is not defined Error code -991

by ookiemon on Fri Apr 10, 2015 12:16 pm

Foufff, that's stg of a Script...! I hardly know anything about JavaScript as I don't use (yet...) .js Scripts, but it couldn't stg that stupid like you are using "iimset" instead of "iimSet" everywhere in the Script...?

iimset is scripting interface command , and all the ones before the one (that i MARKED IN BOLT letters in the code) work just fine. i thought i followed same steps/ commands order in trying to pass variables from one macro to another in the same way with the iimset command, but something is wrong in my code or its a bug.

I throw the word bug as i googled "ReferenceError: iimset is not defined" and found nothing, which i found pretty odd tbh.


The only thing I notice (or don't understand as I'm no JavaScript Guru...!) is the triple "===" just before your -911 Error in:
Code: Select all
if ((retSCNLOG == -1340) && (iimGetLastError()
                 .indexOf("MacroError:") === 0)) alert(iimGetLastError());
But maybe, it's just that I don't know this Syntax/Operator...


triple '=' exists in js (not that im nothing more than a beginner) .
=== equal value and equal type (http://www.w3schools.com/js/js_comparisons.asp)
ookiemon
 
Posts: 28
Joined: Sat Sep 08, 2012 8:04 pm

Re: ReferenceError: iimset is not defined Error code -991

by chivracq on Fri Apr 10, 2015 12:25 pm

ookiemon wrote:
Foufff, that's stg of a Script...! I hardly know anything about JavaScript as I don't use (yet...) .js Scripts, but it couldn't stg that stupid like you are using "iimset" instead of "iimSet" everywhere in the Script...?

iimset is scripting interface command , and all the ones before the one (that i MARKED IN BOLT letters in the code) work just fine. i thought i followed same steps/ commands order in trying to pass variables from one macro to another in the same way with the iimset command, but something is wrong in my code or its a bug.

I throw the word bug as i googled "ReferenceError: iimset is not defined" and found nothing, which i found pretty odd tbh.

OK for Triple '==='...

About 'iimSet()', yep of course I know it's an iMacros Scripting Interface Command... But what I mean is that that and maybe all Commands are maybe Case Sensitive, as you spelled it "iimset" instead of "iimSet" (Capital 'S') and everywhere else in your Script where it works you spelled it "iimSet" (except in one Comment...).
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6484
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: ReferenceError: iimset is not defined Error code -991

by ookiemon on Fri Apr 10, 2015 12:38 pm

Foufff, that's stg of a Script...! I hardly know anything about JavaScript as I don't use (yet...) .js Scripts, but it couldn't stg that stupid like you are using "iimset" instead of "iimSet" everywhere in the Script...?


wait a minute! i take what i said in previous post back. YOU sir.. have a set of incredible sharp eyes :o :shock:
ookiemon
 
Posts: 28
Joined: Sat Sep 08, 2012 8:04 pm

Re: ReferenceError: iimset is not defined Error code -991

by ookiemon on Fri Apr 10, 2015 12:42 pm

chivracq you have my eternal gratitude <3
works now!

regarding the triple '=' - i cant remember what made me change it from double '=' to triple but there was a reason and it worked better somehow i think.
ookiemon
 
Posts: 28
Joined: Sat Sep 08, 2012 8:04 pm

Re: ReferenceError: iimset is not defined Error code -991

by chivracq on Fri Apr 10, 2015 12:55 pm

ookiemon wrote:chivracq you have my eternal gratitude <3
works now!

regarding the triple '=' - i cant remember what made me change it from double '=' to triple but there was a reason and it worked better somehow i think.

OK, so..., good to know that those iimSet/iimPlay/etc... Commands are Case Sensitive..., I searched for stg about it in the Wiki but couldn't find anything, but that's stg I will remember now...!
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6484
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: ReferenceError: iimset is not defined Error code -991

by ookiemon on Fri Apr 10, 2015 1:06 pm

OK, so..., good to know that those iimSet/iimPlay/etc... Commands are Case Sensitive..., I searched for stg about it in the Wiki but couldn't find anything, but that's stg I will remember now...!


Indeed!
ookiemon
 
Posts: 28
Joined: Sat Sep 08, 2012 8:04 pm


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 4 guests

-->