Kev 69 Posted April 9, 2012 Report Share Posted April 9, 2012 Hi all,My first contribution to the forum and I hope it's of some use. In a nutshell I was looking to create some email accounts but needed some first and surnames, passwords and zip codes as well as DOB. So I made this bot this afternoon.The DOB is generated from $rand values 1-12 for months, 1-28 for days and 1950-1982 for year of birth. Ran several hundred names and never had a problem collecting the data. Note, this only gathers the first, surname and zip from the fake names site, the rest is randomly generated and added to a table. It was a useful project for me as I learnt why the Delete and Don't Delete for "add item to list" was important - due to the fact that if I had it set as Delete when a random month was generated twice I would miss it in the table. ui text box("How many names?", #howmany) ui save file("Save to:", #path) clear list(%zip) clear list(%year) clear list(%day) clear list(%month) clear list(%firstname) clear list(%surname) clear list(%password) clear table(&data) loop(#howmany) { navigate("http://www.fakenamegenerator.com/gen-random-us-us.php", "Wait") wait(1) add list to list(%firstname, $scrape attribute(<outerhtml=w"<span class=\"given-name\">*</span>">, "innertext"), "Don\'t Delete", "Global") add list to list(%surname, $scrape attribute(<outerhtml=w"<span class=\"family-name\">*</span>">, "innertext"), "Don\'t Delete", "Global") add list to list(%zip, $scrape attribute(<outerhtml=w"<span class=\"postal-code\">*</span>">, "innertext"), "Don\'t Delete", "Global") add item to list(%month, $rand(1, 12), "Don\'t Delete", "Global") add item to list(%day, $rand(1, 28), "Don\'t Delete", "Global") add item to list(%year, $rand(1950, 1982), "Don\'t Delete", "Global") add item to list(%password, "az{$rand(15478125, 9852647512)}", "Don\'t Delete", "Global") add list to table as column(&data, 0, 0, %firstname) add list to table as column(&data, 0, 1, %surname) add list to table as column(&data, 0, 2, %zip) add list to table as column(&data, 0, 3, %month) add list to table as column(&data, 0, 4, %day) add list to table as column(&data, 0, 5, %year) add list to table as column(&data, 0, 6, %password) } save to file(#path, &data) Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted April 9, 2012 Report Share Posted April 9, 2012 this will only pull 1, and not fully functional to pull multiples ui text box("How many names?", #howmany) ui save file("Save to:", #path) clear list(%data) loop(#howmany) { navigate("http://www.fakenamegenerator.com/gen-random-us-us.php", "Wait") wait(1) add item to list(%data, "{$scrape attribute(<outerhtml=w"<span class=\"given-name\">*</span>">, "innertext")},{$scrape attribute(<outerhtml=w"<span class=\"given-name\">*</span>">, "innertext")},{$scrape attribute(<outerhtml=w"<span class=\"family-name\">*</span>">, "innertext")},{$scrape attribute(<outerhtml=w"<span class=\"postal-code\">*</span>">, "innertext")},{$rand(1, 12)},{$rand(1, 28)},{$rand(1950, 1982)},az{$rand(15478125, 9852647512)}", "Don\'t Delete", "Global") } save to file(#path, %data) Quote Link to post Share on other sites
Kev 69 Posted April 9, 2012 Author Report Share Posted April 9, 2012 And just when I thought I had it Looks a whole lot shorter than my way. Why "add item to list" and not "add list to list"? Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted April 9, 2012 Report Share Posted April 9, 2012 disregard my post, didnt realize it was pulling more then 1 at a time, and thats why i did it the way i did.. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.