terranstrat 0 Posted November 7, 2013 Report Share Posted November 7, 2013 Hi, i got this script working with creating accounts, but i cant get it to save to file..I need it to save each account, with a new line for each.i would deeply appreciate if you could help me figure this one out.Many thanksheres the code : ui drop down("Thread Count", "0,1,2,3,4,5,6,7,8,9,10", #Number Threads)ui text box("Number of Accounts", #Number Accounts)ui save file("Save accounts to:", #AccountsFile)ui stat monitor("Stats:", #Stat)Run Script()Wait for threads to finish()Save account infomation()comment("DEFINE COMMANDS")define Run Script { set(#Stat, "Creating accounts...", "Global") clear list(%Accounts) set(#ThreadOpen, 0, "Global") set(#Number Created, 0, "Global") set(#Used Threads, 0, "Global") comment("Check Number Threads") if($comparison(#Number Threads, ">", 0)) { then { comment("Threaded") loop(#Number Accounts) { loop while($comparison(#Used Threads, ">=", #Number Threads)) { wait(1) } wait(1) loop process() } } else { comment("Not Threaded") loop(#Number Accounts) { registration code() } } }}define loop process { increment(#Used Threads) increment(#Number Created) registration procedure()}define registration procedure { thread { in new browser { increment(#ThreadOpen) registration code() decrement(#Used Threads) decrement(#ThreadOpen) } }}define registration code { comment("Run Main Script") if($comparison(#Number Created, "<=", #Number Accounts)) { then { comment("Registration Code") Run Registration Process() } else { } }}define Run Registration Process { comment("Set form details") set(#Username, $account data("Username"), "Local") set(#Password, $account data("Password"), "Local") set(#FirstName, $account data("First Name"), "Local") set(#LastName, $account data("Last Name"), "Local") comment("Fill form") reset account("Any") navigate("http://www.ubotstudio.com/playground/simple-form", "Wait") wait for browser event("Everything Loaded", "") type text(<username field>, #Username, "Standard") wait for browser event("Everything Loaded", "") type text(<password field>, #Password, "Standard") wait for browser event("Everything Loaded", "") type text(<first name field>, #FirstName, "Standard") wait for browser event("Everything Loaded", "") type text(<last name field>, #LastName, "Standard") wait for browser event("Everything Loaded", "") click(<value="Submit">, "Left Click", "No") comment("IF Statement Here. If something exists... then add to list") add item to list(%Accounts, "{#Username},{#Password}", "Don\'t Delete", "Global")}define Wait for threads to finish { set(#Stat, "Waiting for threads to finish..", "Global") loop while($comparison(#ThreadOpen, ">", 0)) { wait for browser event("Everything Loaded", "") wait(2) }}define Save account infomation { set(#Stat, "Saving accounts..", "Global") save to file(#AccountsFile, %Accounts)} Quote Link to post Share on other sites
k1lv9h 76 Posted November 7, 2013 Report Share Posted November 7, 2013 Hi, Small change. Added code to check that the value of #AccountsFile is greater then $nothing.sample-create-accounts-001.ubot Kevin Quote Link to post Share on other sites
terranstrat 0 Posted November 7, 2013 Author Report Share Posted November 7, 2013 Hi, Small change. Added code to check that the value of #AccountsFile is greater then $nothing.http://www.ubotstudio.com/forum/public/style_images/master/attachicon.gifsample-create-accounts-001.ubot KevinKevin! thank you so much for fixing this, now it works like a charm! what a time saver you are! Hope your doing well! Tobbe 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.