Jump to content
UBot Underground

When and where to put the increment command?.


Guest kiseki

Recommended Posts

Guest kiseki

Hi,

 

I'm still a newbie about Ubot. and Ive created a loop so my csv file which contains my accounts that will automatically fill up to the designated field, and click register, then after veriying it will redirect me to another page where i can input again the the same information that already fill up in the first creation. then I will need to scrape that information including the public url and save it to the designated csv file. where should I put the increment command so it will go to the next row when after successfully creating an account.

 

 

PS: Inside my first loop I also have 2 other loops and if command which have different variables and list, because i need it to connect two time for the mail server.

 

Thank you.

Kiseki

Link to post
Share on other sites

If you know for sure how many times a loop may have to run, then you don't need an increment if you're not using that as a variable to pull data specifically from a certain list item or table cell, etc...

...because a simple LOOP will automatically restart from its beginning for the set number of times you specified.

 

However, if you NEED the loop index to select list items with $list item or table cells, etc... then you will use the increment command at the end of the instructions contained in a LOOP WHILE so that you instruct the loop to restart, as long as its condition is still met, after the increment.

 

If you are looping backwards (very useful, many times) then you can even place a decrement command at the beginning of the loop.

Link to post
Share on other sites
Guest kiseki

This is the code view of what im working on right now..please let me know what is wrong about it. thanks...

 

navigate("http://www.website.com", "Wait")
wait(3)
ui text box("Posting Title", #Posting Title)
ui block text("Description", #Description)
ui open file("Image", #Imagefile)
ui text box("Email", #Email)
ui text box("Password", #password)
navigate("http://www.website.com", "Wait")
wait for browser event("Everything Loaded", "")
type text(<name="subject">, #Posting Title, "Standard")
wait(5)
type text(<class="redactor_ redactor_editor">, #Description, "Standard")
wait(5)
type text(<id="tag_1">, "house cleaning", "Standard")
wait(2)
type text(<tabindex=2>, "house cleaners", "Standard")
wait(2)
type text(<tabindex=3>, "cleaning house", "Standard")
wait(2)
change file field(<name="img_name_input[1]">, #Imagefile)
wait(2)
type text(<name="mapStreet">, "Address", "Standard")
wait(1)
type text(<city field>, "City", "Standard")
wait(4)
type text(<name="mapZip">, 01772, "Standard")
wait(5)
click(<id="showInMapButton">, "Left Click", "No")
wait(5)
type text($element offset(<email field>, 0), #Email, "Standard")
wait(2)
type text($element offset(<email field>, 1), #Email, "Standard")
wait(5)
pause script
click(<name="post_directly">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
if($search page("Sorry")) {
    then {
        alert("Your account is not successful")
        pause script
    }
    else {
        alert("Success")
        wait(5)
    }
}
connect to mail server("POP3 With SSL", #Email, #password, "pop3.live.com", 995) {
    create table from emails(&emails)
    set(#rowcounter, 0, "Global")
    loop($table total rows(&emails)) {
        if($contains($table cell(&emails, #rowcounter, 2), "Activate")) {
            then {
                load html($table cell(&emails, #rowcounter, 5))
                wait(5)
                click(<style="color: #fff; text-decoration: none;">, "Left Click", "No")
            }
        }
        increment(#rowcounter)
    }
}
wait for browser event("Page Loaded", "")
if($search page("Activated.")) {
    then {
        alert("Your Post has been activated")
        click(<value="Proceed">, "Left Click", "No")
    }
    else {
        alert("Its Not been activated")
        pause script
    }
}
wait for browser event("Page Loaded", "")
navigate("https://www.website.com", "Wait")
wait(5)
type text(<email field>, #Email, "Standard")
wait(1)
click(<value="register">, "Left Click", "No")
click(<id="contact_button">, "Left Click", "No")
wait for element(<id="captcha">, "", "Appear")
type text($element offset(<email field>, 1), #Email, "Standard")
wait(3)
wait for element(<outerhtml=w"<img id=\"captcha\" src=\"/run/captcha/*\" width=\"*\" height=\"*\">">, "", "Appear")
type text(<name="response_field">, $solve captcha(<outerhtml=w"<img id=\"captcha\" src=\"/run/captcha/*\" width=\"*\" height=\"*\">">), "Standard")
wait(3)
click(<value="Register">, "Left Click", "No")
wait for element(<innertext="Next step:">, "", "Appear")
connect to mail server("POP3 With SSL", #Email, #password, "pop3.live.com", 995) {
    create table from emails(&emails2)
    set(#rowcounter2, 0, "Global")
    loop($table total rows(&emails2)) {
        if($contains($table cell(&emails2, #rowcounter2, 2), "Locanto: Activate your account")) {
            then {
                load html($table cell(&emails2, #rowcounter2, 5))
                wait(5)
                wait for element(<src="website.com">, "", "Appear")
                click(<innertext="here">, "Left Click", "No")
            }
        }
        increment(#rowcounter2)
    }
}
wait for browser event("Everything Loaded", "")
reset account("Any")
set(#gender, $account data("Gender"), "Global")
type text(<name="nickname">, $account data("Username"), "Standard")
type text(<name="given_name">, $account data("First Name"), "Standard")
if($comparison(#gender, "=", "Male")) {
    then {
        click(<id="salutation_mr">, "Left Click", "No")
    }
    else {
        click(<id="salutation_mrs">, "Left Click", "No")
    }
}
wait(1)
type text(<name="name">, $account data("Last Name"), "Standard")
wait(1)
change dropdown(<name="standard_areaID">, "Sydney")
wait(1)
type text($element offset(<password field>, 0), #password, "Standard")
wait(1)
type text($element offset(<password field>, 1), #password, "Standard")
wait(1)
change checkbox(<terms of service checkbox>, "Checked")
wait(10)
click(<value="Save password & log in">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
click(<innertext="click to proceed">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
set(#publicurl, $scrape attribute(<outerhtml=w"<a href=\"http://website.com/ID_*.html\">*">, "href"), "Global")
add item to list(%accounts, "{$account data("Username")}, {#password}, {#Email},{#password},  {#Posting Title},{#publicurl}", "Delete", "Global")
save to file("{$special folder("Desktop")}\\file.csv", %accounts)
click(<outerhtml=w"<a href=\"http://website.com/ID_*.html\">*">, "Left Click", "No")
clear cookies

 

 

 

here is the code view of the bot im working on..actually I want to pull data from a csv file one row increement and  each time the whole process are done then it will automatically get the new data in the next row.

 

if anyone can help Thanks in advance.

Edited by kiseki
Link to post
Share on other sites

Try this

 

navigate("http://www.website.com""Wait")
wait(3)
ui text box("Posting Title"#Posting Title)
ui block text("Description"#Description)
ui open file("Image"#Imagefile)
ui text box("Email"#Email)
ui text box("Password"#password)
navigate("http://www.website.com""Wait")
wait for browser event("Everything Loaded""")
type text(<name="subject">#Posting Title"Standard")
wait(5)
type text(<class="redactor_ redactor_editor">#Description"Standard")
wait(5)
type text(<id="tag_1">"house cleaning""Standard")
wait(2)
type text(<tabindex=2>"house cleaners""Standard")
wait(2)
type text(<tabindex=3>"cleaning house""Standard")
wait(2)
change file field(<name="img_name_input[1]">#Imagefile)
wait(2)
type text(<name="mapStreet">"Address""Standard")
wait(1)
type text(<city field>"City""Standard")
wait(4)
type text(<name="mapZip">, 01772, "Standard")
wait(5)
click(<id="showInMapButton">"Left Click""No")
wait(5)
type text($element offset(<email field>, 0), #Email"Standard")
wait(2)
type text($element offset(<email field>, 1), #Email"Standard")
wait(5)
pause script
click(<name="post_directly">"Left Click""No")
wait for browser event("Everything Loaded""")
if($search page("Sorry")) {
    then {
        alert("Your account is not successful")
        pause script
    }
    else {
        alert("Success")
        wait(5)
    }
}
connect to mail server("POP3 With SSL"#Email#password"pop3.live.com", 995) {
    create table from emails(&emails)
    comment("If your tables don't have headers ie EMAIL,LINK,USERNAME etc
then leave at -1 then it will start on row 0 which is the first row.
In this case increment needs to be at beginning of loop
to not exceed table total rows. If you do have headers change
it back to 0 (zero) so it starts on row 2 (position 1). List and tables are zero based
which means they start at zero and then 1,2,3 and so on. Not 1,2,3 but
0,1,2,3,4,5. Look in debugger everything starts at 0.")
    set(#rowcounter"-1""Global")
    loop($table total rows(&emails)) {
        increment(#rowcounter)
        if($contains($table cell(&emails#rowcounter, 2), "Activate")) {
            then {
                load html($table cell(&emails#rowcounter, 5))
                wait(5)
                click(<style="color: #fff; text-decoration: none;">"Left Click""No")
            }
        }
    }
}
wait for browser event("Page Loaded""")
if($search page("Activated.")) {
    then {
        alert("Your Post has been activated")
        click(<value="Proceed">"Left Click""No")
    }
    else {
        alert("Its Not been activated")
        pause script
    }
}
wait for browser event("Page Loaded""")
navigate("https://www.website.com""Wait")
wait(5)
type text(<email field>#Email"Standard")
wait(1)
click(<value="register">"Left Click""No")
click(<id="contact_button">"Left Click""No")
wait for element(<id="captcha">"""Appear")
type text($element offset(<email field>, 1), #Email"Standard")
wait(3)
wait for element(<outerhtml=w"<img id=\"captcha\" src=\"/run/captcha/*\" width=\"*\" height=\"*\">">, "", "Appear")
type text(<name="response_field">, $solve captcha(<outerhtml=w"<img id=\"captcha\" src=\"/run/captcha/*\" width=\"*\" height=\"*\">">), "Standard")
wait(3)
click(<value="Register">, "Left Click", "No")
wait for element(<innertext="Next step:">, "", "Appear")
connect to mail server("POP3 With SSL", #Email, #password, "pop3.live.com", 995) {
    create table from emails(&emails2)
    set(#rowcounter2, "-1", "Global")
    loop($table total rows(&emails2)) {
        increment(#rowcounter2)
        if($contains($table cell(&emails2, #rowcounter2, 2), "Locanto: Activate your account")) {
            then {
                load html($table cell(&emails2, #rowcounter2, 5))
                wait(5)
                wait for element(<src="website.com">, "", "Appear")
                click(<innertext="here">, "Left Click", "No")
            }
        }
    }
}
wait for browser event("Everything Loaded", "")
reset account("Any")
set(#gender, $account data("Gender"), "Global")
type text(<name="nickname">, $account data("Username"), "Standard")
type text(<name="given_name">, $account data("First Name"), "Standard")
if($comparison(#gender, "=", "Male")) {
    then {
        click(<id="salutation_mr">, "Left Click", "No")
    }
    else {
        click(<id="salutation_mrs">, "Left Click", "No")
    }
}
wait(1)
type text(<name="name">, $account data("Last Name"), "Standard")
wait(1)
change dropdown(<name="standard_areaID">, "Sydney")
wait(1)
type text($element offset(<password field>, 0), #password, "Standard")
wait(1)
type text($element offset(<password field>, 1), #password, "Standard")
wait(1)
change checkbox(<terms of service checkbox>, "Checked")
wait(10)
click(<value="Save password & log in">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
click(<innertext="click to proceed">, "Left Click", "No")
wait for browser event("Everything Loaded", "")
set(#publicurl, $scrape attribute(<outerhtml=w"<a href=\"http://website.com/ID_*.html\">*">, "href"), "Global")
add item to list(%accounts, "{$account data("Username")}, {#password}, {#Email},{#password},  {#Posting Title},{#publicurl}", "Delete", "Global")
save to file("{$special folder("Desktop")}\\file.csv", %accounts)
click(<outerhtml=w"<a href=\"http://website.com/ID_*.html\">*">, "Left Click", "No")
clear cookies

 

You also want clear cookies before navigating to site

hope that helps

 

TC

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...