Sign in to follow this  
Followers 0
stevelach1

Vaildate Usernames/Pass Help

5 posts in this topic

Hi all...Im new at autoit and need some help. I have been trying to get this to work on my own just so I can learn the program but just cant get to get this one part of the script to work.

Im checking account to make sure there good..the main prob im having is having the script go though each line of the .txt file check the account and go to the next and do the same till EOF, but I can only get it to running the first line.

Any help would be awsome :D

.txt file formate is user|pass

#include <File.au3>
#include <IE.au3>
Global $n = 1, $mail ,$pass,$line
$oPageTitle = ("craigslist account - Microsoft Internet Explorer")
$oIE = _IECreate ("https://accounts.craigslist.org/")
$oForm = _IEGetObjByName($oIE,"login")
$oUsername = _IEFormElementGetObjByName($oForm, "inputEmailHandle")
$oPW = _IEFormElementGetObjByName($oForm, "inputPassword")

$file = FileOpen("C:\accounts.txt", 0)

;Check to see if file is open
 if $file -1 Then
     msgBox(0x10, "Error", "Unable to open file.")
     Exit
EndIf

while 1 
$line = FileReadLine($file,$n)
    if @error = -1 then ExitLoop
        
        If StringInStr($line, "|") Then
        $break = StringSplit($line, "|")
        $mail1 = StringReplace($break[1], " ", "")
        $pass1 = StringReplace($break[2], " ", "")
        EndIf   

_IEFormElementSetValue($oUsername,$mail1)
_IEFormElementSetValue($oPW,$pass1)

_IEFormSubmit($oForm)
;Sleep(5000)


if _IELinkClickByText($oIE,"settings",0) then
_IELinkClickByText($oIE,"log out")

FileWrite("C:\Live.txt", $line & @CRLF)

EndIf


$n = $n + 1
WEnd
FileClose($file)


;Sleep(5000)

Share this post


Link to post
Share on other sites



One problem I see is with variable $n. It's not defined and initialized to 1 so the line "$n = $n + 1" wont work.

But actually you don't need it. Remove the linenumber ($n) from the FileReadLine statement and (according to the help file) it will read one line after the other starting with the first one.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

thanks...i did try to run this without the var $n but i still get the same results...just stops with the first record.

i wounder if i have the while loop set up right. isn't it supposed to reload the script put in the next record and hit submit again with each new record till eof?

Share this post


Link to post
Share on other sites

Please insert

#AutoIt3Wrapper_Run_Debug_Mode=y

at the top of your script and you will see on the Scite console which statements of your script are executed.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

still no other ideas...i changed the while statment to check of page tile while in the loop but it still not working. i cant seem to find how to keep the script to keep checking while file ins not eof.

im sure this is an easy fix but im stuck :D

Share this post


Link to post
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
Sign in to follow this  
Followers 0