builder 0 Posted April 11, 2012 Report Share Posted April 11, 2012 (edited) I have a text file in this format Email:EmailPassword/UserName:Password How can i make it so it can split this data and return only the username and also the username password separately so i can use it to login to a website. navigate("http://ubotstudio.com/playground/simpleform.aspx", "Wait") clear list(%Accounts) clear list(%AccountList) set(#AppFolder, $special folder("Application"), "Global") add list to list(%Accounts, $list from file("{#AppFolder}\\Data\\Accounts.txt"), "Delete", "Global") clear list(%accountdata) set(#account, $list item(%Accounts, 0), "Global") add item to list(%accountdata, $list from text($replace(#account, "/", ":"), ":"), "Delete", "Global") type text(<about me textarea>, $list item(%accountdata, 0), "Standard") Edited April 11, 2012 by builder Quote Link to post Share on other sites
rapt0r 3 Posted April 11, 2012 Report Share Posted April 11, 2012 If this is not possible with the way i am doing it, Is there a different way this can be done? would i need to use csv files instead of text files? (sorry for using a different username to post. The other one is limited to 1 post a day. it was an account i used before i purchased ubot) Quote Link to post Share on other sites
JohnB 255 Posted April 11, 2012 Report Share Posted April 11, 2012 No problem...Your goal would be achieved a lot easier if you used csv files for your data. Are you scraping it into that format? John Quote Link to post Share on other sites
rapt0r 3 Posted April 11, 2012 Report Share Posted April 11, 2012 No problem...Your goal would be achieved a lot easier if you used csv files for your data. Are you scraping it into that format? John I am creating accounts in this format with a different program.Email:EmailPassword/UserName:Password i have a text file with accounts in that format. I am trying to make another program that will log into the accounts but i cant figure out how to split the user name and password from it. If i do use .csv then first i should replace all the ":" and "/" with "," right? I never used the csv or tables functions in ubot before. Would you please be able to tell me what i would have to learn in order to achieve what im trying to do? like which main functions would i have to use to load up my accounts and then have it fill in the form field with the username and password. Thanks Quote Link to post Share on other sites
JohnB 255 Posted April 11, 2012 Report Share Posted April 11, 2012 Yes, replace your current delimeter with commas and save it as a csv file. John Quote Link to post Share on other sites
rapt0r 3 Posted April 13, 2012 Report Share Posted April 13, 2012 I actually got it to working without the need for csv/tables. I was using the $list from text function incorrectly. It looks like the same functions that were in ubot 3.0 work differently in ubot 4.0. here is the working example in case someone needs it. navigate("http://ubotstudio.com/playground/simpleform.aspx", "Wait") clear list(%Accounts) clear list(%AccountsSplit) set(#Account, $nothing, "Global") set(#Account, "Email:EmailPassword/UserName:Password", "Global") set(#AccountReplace, $nothing, "Global") set(#AccountReplace, $replace(#Account, "/", ":"), "Global") add item to list(%Accounts, #AccountReplace, "Don\'t Delete", "Global") add list to list(%AccountsSplit, $list from text(%Accounts, ":"), "Don\'t Delete", "Global") type text(<username field>, $list item(%AccountsSplit, 2), "Standard") type text(<password field>, $list item(%AccountsSplit, 3), "Standard") Quote Link to post Share on other sites
Lombi 34 Posted April 13, 2012 Report Share Posted April 13, 2012 Yup, that's how I use it as well. Remember that to have things done faster you can always change attribute (value) instead of type text. 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.