From Colossal Butterfly, 2 Years ago, written in C#.
This paste will perish in 1 Second.
Embed
  1.  
  2. //==================//
  3. //script Written by: ••AviramDayan•• 23/12/2019 01:30PM - Version 1
  4. //Last Update: 09/04/2020 03:00PM - Version 8
  5. //==================//
  6.  
  7. using System;
  8. using System.IO;
  9. using FaucetCollector.Script;
  10. using OpenQA.Selenium;
  11. //css_inc ShortLinkUtilities
  12. //css_inc RecaptchaUtilities
  13.  
  14.  
  15. public class GetZen : FaucetScript
  16. {
  17.     /// <summary>
  18.     /// List of Settings that will be shown in the bot when selecting this Faucet in the bot.
  19.     /// You can get the value the user entered with the methods: GetSetting("[Name of the FaucetSetting]"), GetBoolSetting and GetDateTimeSetting
  20.     /// You can also create a new setting value using SetSetting("[Name you want to use]", "value")
  21.     /// </summary>
  22.     public override FaucetSettings Settings
  23.     {
  24.         get
  25.         {
  26.             return new FaucetSettings("https://GetZen.Cash")
  27.             {
  28.                 new FaucetSetting(){Name="Email",Display="Email",Type=EditorType.TextBox,Required=true},
  29.                 new FaucetSetting(){Name="Pass",Display="Password",Type=EditorType.Password,Required=true},
  30.                 new FaucetSetting(){Name="Address",Display="Address HORIZEN - ZEN ",Type=EditorType.TextBox,Required=true},
  31.                                
  32.                 new FaucetSetting(){Name="FaucetClaim",Display="FaucetClaim",Type=EditorType.CheckBox,Default=true},
  33.                 new FaucetSetting(){Name="Bonus_5_days",Display="Bonus_5_days",Type=EditorType.CheckBox,Default=true},
  34.                 new FaucetSetting(){Name="Bonus_Aff",Display="Bonus_Aff",Type=EditorType.CheckBox,Default=false},
  35.                                
  36.                 //insert user settings here
  37.                 //new FaucetSetting {
  38.                 //    Name = "Name of your setting",
  39.                 //    Display = "Display shown in Faucet Collector",
  40.                 //    Type = EditorType.TextBox | EditorType.Password | EditorType.CheckBox | EditorType.Wallet | EditorType.Numeric | EditorType.ComboBox | EditorType.CheckComboBox,
  41.                 //    Required = true | false,
  42.                 //    Default = "Optionally a default value" | true | false | null.
  43.                 //    Items = new List<string> { "item1", "item2" } (only valid for ComboBox or CheckComboBox)
  44.                 //}
  45.             };
  46.         }
  47.     }
  48.  
  49.        
  50.  
  51.     //My DomainName
  52.     //string DomainName_String = "https://GetZen.Cash";
  53.         //example - GoToUrl(DomainName_String);
  54.     //==========//
  55.        
  56.        
  57. //============================================================//
  58. //the number of "successes" in the script - when are finished  
  59. //============================================================//
  60.     public override void Start()
  61.     {
  62.                 ad=false;
  63.                
  64.         //Title that shows in the browser. Is used to identify and close popup windows
  65.         Title = "HORIZEN";
  66.  
  67.         //After we did try to claim on the faucet we search for these elements to determine if it was a success or a fail
  68.         SuccessXPath = "//*";  //*[text()='']
  69.         FailXPath = "//*"; //*[text()='']
  70.  
  71.         //Let Faucet Collector start up everything
  72.         base.Start();
  73.     }
  74. //============================================================//
  75. //the number of "successes" in the script - when are finished  
  76. //============================================================//
  77.        
  78.        
  79.        
  80.         bool ad;
  81.        
  82.        
  83.     public override int DoInit()
  84.     {
  85.  
  86.            
  87.         //Let Faucet Collector continue.
  88.         return base.DoInit();
  89.     }
  90.  
  91.        
  92.        
  93.        
  94. //==================//
  95. //save Login Cookies
  96. //==================//
  97.     public override bool IsLoggedIn()
  98.     {
  99.  
  100.         //In this case we check for en element with the class "loggedIn"
  101.                 return ElementByXPath("//ul[@class='user-nav']//a[contains(@href,'auth/logout')]")!= null;
  102.                 //return true;
  103.     }
  104. //==================//
  105. //save Login Cookies
  106. //==================//
  107.        
  108.        
  109.        
  110.     /// <summary>
  111.     /// This method gets called if IsLoggedIn returned false, right before the DoLogin method is called.
  112.     /// </summary>
  113.     public override int BeforeLogin()
  114.     {
  115.                
  116.                
  117.         //This faucet has nothing to do here. We will let Faucet Collector handle it.
  118.         return base.BeforeLogin();
  119.     }
  120.        
  121.        
  122.        
  123.        
  124.        
  125.  
  126.        
  127. //=============//
  128. //start DoLogin
  129. //=============//
  130.     public override int DoLogin()
  131.     {
  132.  
  133.  
  134.          //var checks login or exit
  135.      var ExitButton = ElementByXPath("//ul[@class='user-nav']//a[contains(@href,'auth/logout')]"); //SIGN OUT
  136.  
  137.                  
  138.          //if i NOT Login - go to Login Page
  139.          if (!IsVisible(ExitButton))
  140.          {
  141.                
  142.         //else go to normal login
  143.                 GoToUrl("https://GetZen.Cash/");
  144.         Wait();
  145.             Wait(2);           
  146.        
  147.         var StartLoginButton = ElementByXPath("//ul[@class='user-nav']//a[@class='link-login']");
  148.             if (IsVisible(StartLoginButton))
  149.             {
  150.                  Click(StartLoginButton);
  151.             }
  152.         Wait();
  153.             Wait(2);   
  154.                
  155.         if (IsVisible(ElementByXPath ("//form[@class='login-form']//input[@name='email']") ))
  156.             {
  157.          var box_user = ElementByXPath("//form[@class='login-form']//input[@name='email']");
  158.          SetText(box_user, GetSetting("Email"));
  159.             }
  160.                
  161.         Wait(2);
  162.  
  163.         if (IsVisible(ElementByXPath ("//form[@class='login-form']//input[@name='password']") ))
  164.             {
  165.          var box_pass = ElementByXPath("//form[@class='login-form']//input[@name='password']");
  166.          SetText(box_pass, GetPassword("Pass"));
  167.             }
  168.                
  169.         Wait(2);
  170.                
  171.         if (IsVisible(ElementByXPath ("//form[@class='login-form']//button[@type='submit']") ))
  172.             {
  173.         var ButtonLog = ElementByXPath("//form[@class='login-form']//button[@type='submit']");
  174.         Click(ButtonLog);
  175.             }
  176.                
  177.         Wait();        
  178.        
  179.          }      //end ExitButton
  180.  
  181.          
  182.         //This faucet has nothing to do here.    
  183.         return base.DoLogin();
  184.     }
  185. //=============//
  186. //start DoLogin
  187. //=============//
  188.        
  189.  
  190.        
  191.        
  192.        
  193.        
  194. //==========//
  195. //AfterLogin
  196. //=========//
  197.  public override int AfterLogin()
  198.  {
  199.  
  200.          
  201.         //This faucet has nothing to do here. We will let Faucet Collector handle it.
  202.         return base.AfterLogin();
  203.  }
  204. //==========//
  205. //AfterLogin
  206. //=========//
  207.        
  208.        
  209.        
  210.  
  211.        
  212. //=============//
  213. //GetFaucetWaitTime
  214. //=============//
  215.  public override int GetFaucetWaitTime()
  216.  {
  217.  
  218.     if(ad)
  219.         {
  220.         ad=false; //solve the problem in start - after he return to script again
  221.         return GetWaitSetting();  
  222.  
  223.     }   //end ad
  224.                
  225.                
  226.    //let Faucet Collector continue.
  227.    return base.GetFaucetWaitTime();
  228.  }
  229. //=============//
  230. //GetFaucetWaitTime
  231. //=============//
  232.        
  233.        
  234.        
  235.        
  236.  
  237.     public override int BeforeSolveCaptcha()
  238.     {
  239.         //This faucet has nothing to do here. We will let Faucet Collector handle it.
  240.         return base.BeforeSolveCaptcha();
  241.     }
  242.  
  243.  
  244.     public override int DoSolveCaptcha()
  245.     {
  246.  
  247.         //This faucet has nothing to do here. We will let Faucet Collector handle it.
  248.         return base.DoSolveCaptcha();
  249.     }
  250.  
  251.  
  252.     public override int AfterSolveCaptcha()
  253.     {
  254.         //This faucet has nothing to do here. We will let Faucet Collector handle it.
  255.         return base.AfterSolveCaptcha();
  256.     }
  257.        
  258.        
  259.  
  260.     public override int BeforeSolveFaucet()
  261.     {
  262.         //This faucet has nothing to do here. We will let Faucet Collector handle it.
  263.         return base.BeforeSolveCaptcha();
  264.     }
  265.        
  266.        
  267.        
  268.  
  269.  
  270. //=============//
  271. //DoSolveFaucet
  272. //=============//
  273.   public override int DoSolveFaucet()
  274.   {
  275.  
  276.       //=============//
  277.       //Bonus_5_days
  278.       //=============//
  279.          if (GetBoolSetting("Bonus_5_days"))
  280.          {
  281.                          
  282.                    GoToUrl("https://GetZen.Cash/");
  283.            Log("Bonus_5_days");        
  284.                Wait();
  285.                Wait(2);
  286.                    
  287.            var Bonus_Not_Eligible_Button = ElementByXPath("//li[contains(@data-target,'modal-jackpot-not-eligible')]");
  288.                if (!IsVisible(Bonus_Not_Eligible_Button))
  289.                {
  290.  
  291.             var Bonus_Available = ElementByXPath("//li[contains(@data-target,'modal-jackpot')]");
  292.                     Click(Bonus_Available);
  293.                     Log("Bonus_5_days - Bonus_Available");
  294.             Wait();
  295.             Wait(2);
  296.                        
  297.             var MassageError = ElementByXPath("//div[@class='modal-body' and contains(text(),'After using the faucet for five')]");
  298.                
  299.                         if (IsVisible(MassageError))
  300.                 {
  301.                     Log("Bonus_5_days - Bonus_Available");
  302.                         }
  303.                        
  304.                 if (!IsVisible(MassageError))
  305.                 {
  306.                     Log("Bonus_5_days - do function");
  307.             Bonus_Function();//call    
  308.             Wait();
  309.                 }
  310.                        
  311.                } //end Bonus_Not_Eligible_Button
  312.  
  313.       } //end Bonus_5_days
  314.       //=============//
  315.  
  316.  
  317.  
  318.       //=============//
  319.       //Bonus_Aff
  320.       //=============//
  321.          if (GetBoolSetting("Bonus_Aff"))
  322.          {
  323.  
  324.                    GoToUrl("https://getzen.cash/user/referral");
  325.            Log("Bonus_Aff");   
  326.            Wait();     
  327.                Wait(2);
  328.                        
  329.            var ClaimNow_Available = ElementByXPath("//tr[*]//button[contains(text(),'Claim now')]");
  330.                if (IsVisible(ClaimNow_Available))
  331.                {
  332.                      Log("Bonus_Aff - Available");
  333.              var TimeToWaitForBreak = DateTime.Now.AddSeconds(65);
  334.              while (true)
  335.              {
  336.                var Bonus_Available = ElementByXPath("//tr[*]//button[contains(text(),'Claim now')]");
  337.                        Click(Bonus_Available);
  338.                        Log("Bonus_Aff - Bonus_Available");
  339.                Wait();
  340.                Wait(2);
  341.                        Log("Bonus_Aff - do function");
  342.                Bonus_Function();//call  
  343.                Wait();
  344.                            
  345.                            Driver.Navigate().Refresh(); //refresh page
  346.                Wait(4);
  347.                            
  348.                if (!IsVisible(ElementByXPath ("//tr[*]//button[contains(text(),'Claim now')]") ))
  349.                    {
  350.                          Log("Bonus_Aff - break - not Available");
  351.                  break; //after break the while  
  352.                    }
  353.                            
  354.                if (DateTime.Now > TimeToWaitForBreak) //if the time above 65 sec
  355.                {
  356.                        Log("Bonus_Aff - break - TimeToWaitForBreak");
  357.                break; //break the wait loop
  358.                }
  359.                            
  360.              } //end while (true)
  361.                          
  362.                } // end ClaimNow_Available
  363.          } //end Bonus_Aff
  364.       //=============//
  365.          
  366.          
  367.       //=============//
  368.       //FaucetClaim
  369.       //=============//
  370.       if (GetBoolSetting("FaucetClaim"))
  371.       {
  372.  
  373.         //go to CancelSecurity FaucetClaim page
  374.                 GoToUrl("https://GetZen.Cash/");
  375.         Log("FaucetClaim");            
  376.             Wait();
  377.             Wait(2);
  378.  
  379.  
  380.         if (!IsVisible(ElementByXPath ("//div[contains(@class,'input-group')]//button[contains(text(),'Remove')] ") )) // Remove address not visible
  381.             {
  382.  
  383.            var inputAddress = ElementByXPath("//form[@id='form-claim-zen']//input[@name='zen_address']");
  384.            if (IsVisible(inputAddress))
  385.                {
  386.             Log("inputAddress");
  387.             SetText(inputAddress, GetSetting("Address"));
  388.            }
  389.                    
  390.                Wait(2);
  391.                    
  392.            var SaveAddress = ElementByXPath("//button[contains(@class,'btn btn-success') and contains(text(),'Save') ]");
  393.            if (IsVisible(SaveAddress))
  394.            {
  395.            Log("SaveAddress");
  396.            Click(SaveAddress);
  397.                    }
  398.                    
  399.                 }
  400.        
  401.                
  402.             Wait(2);
  403.  
  404.         var RecaptchaOpen_Iframe = ElementByXPath ("//textarea[contains(@name,'recaptcha') and contains(@style,'block')] | //div[contains(@class,'recaptcha')] | //iframe[contains(@src,'recaptcha')] "); //iframe[contains(@src,'recaptcha')]
  405.         if (IsVisible(RecaptchaOpen_Iframe))
  406.         {
  407.           var result = DoSolveCaptcha();
  408.           if (result > 0)
  409.           {
  410.              return Fail("fail not solve"); //return to solve again - if something wrong
  411.           }
  412.           Wait();
  413.         }
  414.  
  415.             Wait(2);
  416.                
  417.         var Claim_Button = ElementByXPath("//form[@id='form-claim-zen']//button[@type='submit']");      
  418.                 if (IsVisible(Claim_Button))
  419.         {
  420.          Log("Claim_Button - 1");
  421.          Click(Claim_Button);
  422.                 }
  423.        
  424.                 Wait(5);
  425.                
  426.         var ProceedToClaimButton = ElementByXPath("//button[contains(@class,'btn-claim js-Claim') and contains(text(),'claim')]");      
  427.                 if (IsVisible(ProceedToClaimButton))
  428.         {
  429.          Log("ProceedToClaimButton");
  430.          Click(ProceedToClaimButton);
  431.                 }
  432.  
  433.                 Wait(5);
  434.  
  435.         if (!IsVisible(ElementByXPath ("//div[@class='modal-content']//div[@id='result1' and contains(text(),'claimed Zen in the last')] | //td[text()='You Won:']") ))
  436.                         {
  437.          Log("Claim_Button - 2 - again");
  438.          Click(Claim_Button);
  439.                 }
  440.        
  441.                 Wait(5);
  442.  
  443.         var StatusCheck_Success = ElementByXPath("//td[text()='You Won:']");      
  444.                 if (IsVisible(StatusCheck_Success))
  445.         {
  446.          var SuccessAmountMessage = ElementByXPath("//div[@id='result1']//tr[1]/td[2]");      
  447.          Log("success"+SuccessAmountMessage.Text);             
  448.          //ad = true; //success
  449.                  ClaimSuccess(); //Marks the claim as a success
  450.                 }
  451.  
  452.         if (!IsVisible(StatusCheck_Success))
  453.                 {
  454.          Log("fail - need to wait");   
  455.          return GetWaitSetting(); //fail  
  456.                 }
  457.  
  458.       } //end FaucetClaim
  459.       //=============//
  460.  
  461.    return GetWaitSetting();
  462.  
  463.   //This faucet has nothing to do here. We will let Faucet Collector handle it.
  464.   return base.DoSolveFaucet();
  465.   }
  466.        
  467.        
  468.  
  469.  
  470.        
  471.        
  472.     public override int AfterSolveFaucet()
  473.     {
  474.         //This faucet has nothing to do here. We will let Faucet Collector handle it.
  475.         return base.AfterSolveFaucet();
  476.     }
  477.        
  478.        
  479.        
  480.  
  481.     /// <summary>
  482.     /// This method gets called in the end after the BeforeSolveFaucet/DoSolveFaucet and AfterSolveFaucet methods were done.
  483.     /// The base.CheckFaucetResult will try to find a visible element on the page using the XPath from SuccessXPath and FailXPath (see the Start method)
  484.     /// These properties should contain XPath expressions to find certain elements on the page.
  485.     /// For example if it finds one of the elements from the SuccessXPath, and it is visible, then it will flag the claim attempt as a success.
  486.     /// Or if it finds one of the elements from the FailXPath, and it is visible, then it will flag the claim attempt as a failure.
  487.     /// </summary>
  488.     public override int CheckFaucetResult()
  489.     {
  490.         //This faucet has nothing to do here. We will let Faucet Collector handle it.
  491.         return base.CheckFaucetResult();
  492.     }
  493.        
  494.        
  495.        
  496.       //=================//
  497.       //Bonus_Function
  498.       //=================//
  499.  
  500.       public int Bonus_Function()
  501.       {
  502.            if (IsVisible(ElementByXPath ("//div[@class='modal-body']//input[@name='zen_address']") ))
  503.                {
  504.             var box_address = ElementByXPath("//div[@class='modal-body']//input[@name='zen_address']");
  505.             SetText(box_address, GetSetting("Address"));
  506.                         Log("Bonus_Function - set Address");
  507.                }
  508.                    
  509.            Wait(2);
  510.                    
  511.            if (IsVisible(ElementByXPath ("//div[@class='modal-body']//button[contains(text(),'Play')]") ))
  512.                    {   
  513.             var ButtonSpin = ElementByXPath("//div[@class='modal-body']//button[contains(text(),'Play')]");
  514.             Click(ButtonSpin);
  515.                         Log("Bonus_Function - ButtonSpin");
  516.                    }
  517.                    
  518.            var TimeToWaitForBreak = DateTime.Now.AddSeconds(65);                         
  519.            while (true)
  520.            {
  521.                            
  522.                      Wait(); //wait until
  523.  
  524.              var TitleVAR = ElementByXPath("//div[@class='sm-result']/div[@class='sm-result-msg']//h4");
  525.              var DescriptionVAR = ElementByXPath("//div[@class='sm-result']/div[@class='sm-result-msg']//p");
  526.                          
  527.              if (IsVisible(TitleVAR))
  528.              {
  529.                           Log("Bonus_Function - your results is - " + TitleVAR.Text + " " + DescriptionVAR.Text);
  530.               break; //after break the while  
  531.                      }
  532.                          
  533.              if (DateTime.Now > TimeToWaitForBreak) //if the time above 65 sec
  534.              {
  535.                      Log("Bonus_Function - break - TimeToWaitForBreak");
  536.              break; //break the wait loop
  537.              }
  538.                          
  539.            } //end while (true)                    
  540.          
  541.             return 0;
  542.       }//end Bonus_Function
  543.       //=================//    
  544.        
  545.        
  546. } //public class
  547.