Jump to content

loop my entire script


Recommended Posts

Opt("WinDetectHiddenText",1)

#include <IE.au3>
#include <Array.au3>
#include <File.au3>
#include <MsgBoxConstants.au3>
#include <clear.au3>
#include <ColorConstants.au3>; Including required files
#include <GUIConstantsEx.au3>
#include <file.au3>
#include <string.au3>
Sleep(5000)


Local $emails = "email.txt" ;sets file path
Local $pwd = "pwd.txt" ;sets file path
Local $name = "name.txt"
Local $ArrayEmail[57], $ArrayPwd[57], $ArrayName[57] ;declares array

_FileReadToArray($emails, $ArrayEmail) ;converts file to array
_FileReadToArray($pwd, $ArrayPwd);converts file to array
_FileReadToArray($name, $ArrayName);converts file to array


Local $url= "https://localhost/signup"
Local $oIE = _IECreate($url, 1)

$tags = $oIE.document.GetElementsByTagName("a")
For $tag in $tags
$class_value = $tag.GetAttribute("class")
If string($class_value) = "badge-signup-email-link" Then
    $oCorrectObj = $tag
    ExitLoop

EndIf
Next

If IsObj ( $oCorrectObj ) Then

_IEAction ($oCorrectObj, "click")

EndIf

Local $name = _IEGetObjByName ($oIE, "fullname")
Local $email = _IEGetObjByName ($oIE, "email")
Local $password = _IEGetObjByName ($oIE, "password")

_IEFormElementSetValue($name, $ArrayName[1])
_IEFormElementSetValue($email, "" & ++1 & $Arrayemail[1])
_IEFormElementSetValue($password, $ArrayPwd[1])


$colTags = _IETagNameGetCollection($oIE, "input")
For $oTag In $colTags
If $oTag.value = "Sign Up" Then
    sleep(15000)
    _IEAction($oTag, "click")
_IENavigate($oIE,"javascript:void(0);") ; javascript:void is triggered.
EndIf
Next

I coded this script and silly me forgot to create it in a loop to begin with -.-
now I have tried While & For loop with counters and what not, but I just can't seem to get it to work.

Could someone be of assistance?

Thanks in advance.

Link to comment
Share on other sites

Define "can't seem to get it to work".
Does this mean you get an error message? No results? The wrong results?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

On 17/06/2016 at 10:09 AM, water said:

Define "can't seem to get it to work".
Does this mean you get an error message? No results? The wrong results?

Thank you for your reply.
I ran a while loop and it just seemed to make the script loop forever.
I used

$counter = 0
While $counter <= 5
;ALL MY CODE HERE
$counter = $counter + 1
WEnd

 

Link to comment
Share on other sites

Can't test at the Moment but I'm sure the code you posted Ends after 5 iterations. Test:

$counter = 0
While $counter <= 5
    $counter = $counter + 1
    ConsoleWrite("Loop: " & $counter & @CRLF)
WEnd

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Not really :) I'm sitting at an Airport waiting for my flight to become ready ;) 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

6 minutes ago, water said:

Not really :) I'm sitting at an Airport waiting for my flight to become ready ;) 

Well I meant in means of helping us newbies :)

If you are bored feel free to give me a suggestion here:

Thanks buddy o:)

Link to comment
Share on other sites

On 20.6.2016 at 4:05 PM, RyukShini said:

Well I meant in means of helping us newbies :)

Yes, I'm working my butt off to help newbies ;)
But on the other side I learn something new every day  :)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

3 minutes ago, water said:

Yes, I'm working my butt off to help newbies ;)
But on the other side I learn something new every day  :)

I am very grateful, if it weren't for amazing users such as yourself, I would have a hard time learning!

Thanks again:sweating:

Link to comment
Share on other sites

:)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...