1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

iMacro AddMeFast Script Error

Discussion in 'Social Networking Sites' started by dr4goncl5ws, Jul 11, 2017.

  1. dr4goncl5ws

    dr4goncl5ws Junior Member

    Joined:
    Aug 21, 2012
    Messages:
    174
    Likes Received:
    42
    Location:
    Behind You
    I have a script for FB share for AddMeFast. Every time I play it I get this error:
    Code:
    TypeError: checkAvailableAds.contains is not a function, line 163 (Error code: -991)
    Anyone know what would cause this? Here's the JavaScript for the script:
    Code:
    var email = "[email protected]";
    var pass = "jj062700";
    
    var loopRandom = Math.floor(Math.random()*5 + 5); loopRandom;
    var points = 1; //click all set to 1
    
    
    var loginAmf;
    loginAmf =  "CODE:";
    loginAmf +=  "TAG POS=1 TYPE=INPUT:EMAIL FORM=NAME:NoFormName ATTR=NAME:email CONTENT={{EMAIL}}" + "\n";
    loginAmf +=  "SET !ENCRYPTION NO" + "\n";
    loginAmf +=  "TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:NoFormName ATTR=NAME:password CONTENT={{PASSWORD}}" + "\n";
    loginAmf +=  "TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:NoFormName ATTR=NAME:remember CONTENT=YES" + "\n";
    loginAmf +=  "TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:NoFormName ATTR=NAME:login_button&&VALUE:Login" + "\n";
    
    
    var errorOne = "#EANF#";
    var errorOneLowercase = "#eanf#";
    var errorTwo = "null";
    var counter = 0;
    var countNoAds = 0;
    var pointcount = 0;
    
    
    var tabClose;
        tabClose = "CODE:";
        tabClose += "TAB CLOSE";
        
        
    var tabsCloseAll;
        tabsCloseAll = "CODE:";
        tabsCloseAll += "TAB CLOSEALLOTHERS";
    
    var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
    .getInterface(Components.interfaces.nsIWebNavigation)
    .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
    .rootTreeItem
    .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
    .getInterface(Components.interfaces.nsIDOMWindow);
    
    function TabLeft()
    {
    mainWindow.gBrowser.tabContainer.advanceSelectedTab(-5, true);
    return "True";
    }       
        
    var scrollTop;
        scrollTop = "CODE:";
        scrollTop += "URL GOTO=javascript:window.scrollBy(0,-5000)" + "\n";
        
    var waitSeconds;
        waitSeconds = "CODE:";
        waitSeconds += "WAIT SECONDS=2";
    
        
    var skip;
    skip =  "CODE:";
    skip +=  "TAG POS=2 TYPE=DIV ATTR=TXT:Skip" + "\n";
    skip +=  "WAIT SECONDS=2" + "\n";
    
        
        
        
    var waitSecondsThree;
        waitSecondsThree = "CODE:";
        waitSecondsThree += "WAIT SECONDS=3";
        
    var waitSecondsTen;
        waitSecondsTen = "CODE:";
        waitSecondsTen += "WAIT SECONDS=10";
        
    var waitSecondsSeven;
        waitSecondsSeven = "CODE:";
        waitSecondsSeven += "WAIT SECONDS=7";
    
    var startingUrl;
    startingUrl =  "CODE:";
    startingUrl +=  "SET !TIMEOUT_PAGE 15" + "\n";
    startingUrl +=  "URL GOTO=http://addmefast.com" + "\n";
    
    var loggedInLink = "http://addmefast.com/free_points";
    var loggedOutLink = "http://addmefast.com/";
    var facebookLikesPage = "http://addmefast.com/free_points/facebook_likes";
    
    var facebookLikesLink;
    facebookLikesLink =  "CODE:";
    facebookLikesLink +=  "TAG POS=1 TYPE=A ATTR=TXT:Facebook<SP>Likes" + "\n";
    facebookLikesLink +=  "WAIT SECONDS=2" + "\n";
    
    
    var facebookLikes;
    facebookLikes =  "CODE:";
    facebookLikes +=  "SET !TIMEOUT_PAGE 10" + "\n";
    facebookLikes +=  "SET !TIMEOUT_STEP 2" + "\n";
    facebookLikes +=  "TAG POS=1 TYPE=DIV ATTR=TXT:Like" + "\n";
    facebookLikes +=  "FRAME F=0" + "\n";
    facebookLikes +=  "WAIT SECONDS=3" + "\n";
    
    var facebookLikesTwo;
    facebookLikesTwo =  "CODE:";
    facebookLikesTwo +=  "SET !TIMEOUT_PAGE 10" + "\n";
    facebookLikesTwo +=  "SET !TIMEOUT_STEP 2" + "\n";
    facebookLikesTwo +=  "TAG POS=2 TYPE=DIV ATTR=TXT:Like" + "\n";
    facebookLikesTwo +=  "FRAME F=0" + "\n";
    facebookLikesTwo +=  "WAIT SECONDS=3" + "\n";
    
    var likefacebookPage;
    likefacebookPage =  "CODE:";
    likefacebookPage +=  "TAG POS=1 TYPE=BUTTON ATTR=TXT:Like" + "\n";
    
    
    iimPlay(startingUrl);
    
    if (loggedInLink != window.location){
        iimSet("EMAIL", email);
        iimSet("PASSWORD", pass);
        iimPlay(loginAmf);
             }
    
    iimPlay(facebookLikesLink);
    var stopButton = "Macro stopped manually";
    
    for (i = 1; i <= 10000; i++) {
    
    ////Check for stopButton
    var macroError = iimGetLastError();
    if (macroError == stopButton){
    break;
    }
    //
    
    iimDisplay("Current loop: "+ i);
    
    var loopNumberCheck = i === 25 || i === 50 || i === 75 || i === 100 || i === 125 || i === 150 || i === 175 || i === 200 || i === 225 || i === 250;
    
    if(loopNumberCheck === true){
    iimPlay(waitSecondsTen);
    }
    
    
    if (window.location == loggedOutLink){
        iimSet("EMAIL", email);
        iimSet("PASSWORD", pass);
        iimPlay(loginAmf);
        iimPlay(facebookLikesLink);
             }
            
            
    if (window.location != facebookLikesPage) {
    iimPlay(facebookLikesLink);
    }     
            
            
    //Check if the page has ads   
    var checkAvailableAds;
        checkAvailableAds = "CODE:";
        checkAvailableAds += "TAG POS=1 TYPE=DIV ATTR=ID:site-links-list EXTRACT=TXT";
    iimPlay(checkAvailableAds);
    var checkAvailableAds = iimGetLastExtract().toLowerCase();
    var checkAvailableAdsCheck = checkAvailableAds.contains("no items in this network for now. please try later.");
    
    if (checkAvailableAdsCheck === true){
    countNoAds++
    iimPlay ("CODE:WAIT SECONDS=1");
    iimPlay(facebookLikesLink);
    iimPlay ("CODE:WAIT SECONDS=1");
    
    ///Second check <<
    var checkAvailableAds;
        checkAvailableAds = "CODE:";
        checkAvailableAds += "TAG POS=1 TYPE=DIV ATTR=ID:site-links-list EXTRACT=TXT";
    iimPlay(checkAvailableAds);
    var checkAvailableAds = iimGetLastExtract().toLowerCase();
    var checkAvailableAdsCheck = checkAvailableAds.contains("no items in this network for now. please try later.");
    
    if (checkAvailableAdsCheck === true){
    countNoAds++
    iimPlay(waitSeconds);
    } else {
    var countNoAds = 0;
    iimPlay ("CODE:WAIT SECONDS=1");
    }
    
    
    
    } else {
    var countNoAds = 0;
    }
    
    if (countNoAds >= 2){
    iimDisplay("No more ads in network. Try again later.");
    break;
    }
          
    /////
    ///     
    
    var extractTitle;
    extractTitle =  "CODE:";
    extractTitle +=  "SET !TIMEOUT_STEP 2" + "\n";
    extractTitle +=  "TAG POS=1 TYPE=DIV ATTR=CLASS:likedPagesSingle EXTRACT=TXT" + "\n";
    
    iimPlay(extractTitle);
    var extractTitle = iimGetLastExtract().toLowerCase();
    var extractTitleCheck = extractTitle.contains("you will get") && extractTitle.contains("points for liking.");
    
    
    //////////added v1.2
    if (extractTitleCheck  != true) {
    iimPlay(waitSecondsThree);
    
    var extractTitle;
    extractTitle =  "CODE:";
    extractTitle +=  "SET !TIMEOUT_STEP 6" + "\n";
    extractTitle +=  "TAG POS=1 TYPE=DIV ATTR=CLASS:likedPagesSingle EXTRACT=TXT" + "\n";
    
    iimPlay(extractTitle);
    var extractTitle = iimGetLastExtract().toLowerCase();
    var extractTitleCheck = extractTitle.contains("you will get") && extractTitle.contains("points for liking.");
    
    }
    ////////////////
    
    
    if (extractTitleCheck  === true) {
    
    
    
    
    
    /////////added v2.1
    var numberPattern = /\d+/g;
    var renum = extractTitle.match(numberPattern);
    
    if(renum[0] >= points){
    pointcount = 0;
            
    iimPlay(facebookLikes);
    
    if (window.location == facebookLikesPage) {
    iimPlay(facebookLikesTwo);
    }
    
    ////Check for stopButton
    var macroError = iimGetLastError();
    if (macroError == stopButton){
    break;
    }
    //
    
    //////check if page loaded
    var checkPageActive = window.location;
    var checkActivePage = String(checkPageActive).contains("facebook.com");
    if (checkActivePage === true){
    /////
    
    
    var extractLikeInfo;
    extractLikeInfo =  "CODE:";
    extractLikeInfo +=  "SET !TIMEOUT_STEP 1" + "\n";
    extractLikeInfo +=  "TAG POS=1 TYPE=SPAN ATTR=ID:pagesHeaderLikeButton EXTRACT=TXT" + "\n";
    
    iimPlay(extractLikeInfo);
    var extractLikeInfo = iimGetLastExtract();
    var extractLikeInfoCheck = extractLikeInfo.contains("Liked");
    
    if (extractLikeInfoCheck !== true){
    iimPlay(scrollTop);
    iimPlay(likefacebookPage);
    iimPlay(scrollTop);
    iimPlay ("CODE:WAIT SECONDS=3");
    }
    ////Check for stopButton
    var macroError = iimGetLastError();
    if (macroError == stopButton){
    break;
    }
    //
    
    
    var currentWindow = window.location;
    var currentWindowCheck = String(currentWindow).contains("facebook.com");
    if (currentWindowCheck === true){
        iimPlay(tabClose);
             }
    
    
    iimPlay(scrollTop);
    var randomNumber = Math.floor(Math.random()*3 + 3); randomNumber;
    
    var waitSecondsRandom;
        waitSecondsRandom = "CODE:";
        waitSecondsRandom += "WAIT SECONDS={{SECONDS}}";
        
    iimSet("SECONDS", randomNumber);
    iimPlay(waitSecondsRandom);
    
    ////Check for stopButton
    var macroError = iimGetLastError();
    if (macroError == stopButton){
    break;
    }
    //
    
    ///////////////////////
    //////////////////////Check for points success message
    var extractError = function()
    {
    extractErrorMessage =  "CODE:";
    extractErrorMessage +=  "SET !TIMEOUT_STEP 1" + "\n";
    extractErrorMessage +=  "TAG POS=1 TYPE=DIV ATTR=CLASS:error_like EXTRACT=TXT" + "\n";
    iimPlay(extractErrorMessage);
    }   
    
    var extractSuccess = function()
    {
    extractSuccessMessage =  "CODE:";
    extractSuccessMessage +=  "SET !TIMEOUT_STEP 1" + "\n";
    extractSuccessMessage +=  "TAG POS=1 TYPE=DIV ATTR=CLASS:success_like EXTRACT=TXT" + "\n";
    iimPlay(extractSuccessMessage);
    }
    
    extractError();
    extractErrorMessage = iimGetLastExtract().toLowerCase();
    extractSuccess();
    extractSuccessMessage = iimGetLastExtract().toLowerCase();
    
    if (extractErrorMessage == errorOneLowercase && extractSuccessMessage == errorOneLowercase){
    iimPlay(waitSecondsSeven);
    extractError();
    extractErrorMessage = iimGetLastExtract().toLowerCase();
    extractSuccess();
    extractSuccessMessage = iimGetLastExtract().toLowerCase();
    }
    
    
    if (extractSuccessMessage != errorOneLowercase) {
    var counter = 0;
    } else {
    iimPlay(facebookLikesLink);
    counter++
    }
    ///////////////////
    //////////////
    
    if(counter >= 3){
    break;
    }
    
    
    ////addition
    } else{
    TabLeft();
    iimPlay(tabsCloseAll);
    iimPlay(facebookLikesLink);
    
    
    
    
    
    
    //------------
    var extractTitle;
    extractTitle =  "CODE:";
    extractTitle +=  "SET !TIMEOUT_STEP 2" + "\n";
    extractTitle +=  "TAG POS=1 TYPE=DIV ATTR=CLASS:likedPagesSingle EXTRACT=TXT" + "\n";
    
    iimPlay(extractTitle);
    var extractTitle = iimGetLastExtract().toLowerCase();
    var extractTitleCheck = extractTitle.contains("you will get")
    if(extractTitleCheck != true){
    iimPlay("CODE:WAIT SECONDS=7");
    }
    //-------------
    
    ////Check for stopButton
    var macroError = iimGetLastError();
    if (macroError == stopButton){
    break;}
    //
    
    
    ////second check
    iimPlay(facebookLikes);
    
    if (window.location == facebookLikesPage) {
    iimPlay(facebookLikesTwo);
    }
    
    var checkPageActive = window.location;
    var checkActivePage = String(checkPageActive).contains("facebook.com");
    if (checkActivePage === false){
    TabLeft();
    iimPlay(tabsCloseAll);
    iimDisplay("Facebook is not loading correctly.");
    break;
    }else{
    TabLeft();
    iimPlay(tabsCloseAll);
    iimPlay(facebookLikesLink);
    }
    ///
    
    
    }
    /////
    
    
    //update v2.1 // if points lower than wanted,
    }else{
    iimPlay(waitSeconds);
    
    ////Check for stopButton
    var macroError = iimGetLastError();
    if (macroError == stopButton){
    break;}
    //
    
    iimPlay(skip);
    iimPlay(scrollTop);
    pointcount++
    
    ////Check for stopButton
    var macroError = iimGetLastError();
    if (macroError == stopButton){
    break;}
    //
    
    if(i > 1){
    i--
    }
    
    if(pointcount >= 7){
    iimDisplay("7 loop point check error: Cant find any ads that meet your requirements." + "\n" + "Try again Later.");
    break;
    }
    
    }
    //end v2.1
    
    
    
    } else {
    iimPlay(waitSeconds);
    iimPlay(facebookLikesLink);
    }
    
    TabLeft();
    iimPlay(tabsCloseAll);
    
    var current = window.location;
    if (String(current).contains("about")){
    iimPlay(startingUrl);
    }
    
    ////Check for stopButton
    var macroError = iimGetLastError();
    if (macroError == stopButton){
    break;
    }
    //
    
    }