XpownX 8 Posted September 6, 2014 Report Share Posted September 6, 2014 Hi I'm making a bot that will create accounts but the username created by ubot studio is longer than 14 char , so i was wondering how to tell to ubot to create a random username that is longer than 4 char and less than 14 char. Thanks! Quote Link to post Share on other sites
stanf 43 Posted September 6, 2014 Report Share Posted September 6, 2014 loop(1) { reset account("Any") set(#raw user name, "{$account data("Username")}{$account data("Zip Code")}", "Global") set(#valid user, $find regular expression(#raw user name, ".\{4,14\}"), "Global")} Quote Link to post Share on other sites
stanf 43 Posted September 6, 2014 Report Share Posted September 6, 2014 loop(1) { clear list(%list of valid names) reset account("Any") set(#raw user name, "{$account data("Username")}{$account data("Zip Code")}", "Global") set(#maxlenth, $rand(5, 13), "Global") wait(1) set(#valid user1, $plugin function("File Management.dll", "$Find Regex First", #raw user name, ".\{4,14\}"), "Global") add item to list(%list of valid names, #valid user1, "Delete", "Global") set(#valid user2, $plugin function("File Management.dll", "$Find Regex First", #raw user name, ".\{4,11\}"), "Global") add item to list(%list of valid names, #valid user2, "Delete", "Global") set(#valid user3, $plugin function("File Management.dll", "$Find Regex First", #raw user name, ".\{4,9\}"), "Global") add item to list(%list of valid names, #valid user3, "Delete", "Global") set list position(%list of valid names, 0) set(#use this name, $random list item(%list of valid names), "Global")} Quote Link to post Share on other sites
LazyBotter 188 Posted September 6, 2014 Report Share Posted September 6, 2014 Here you go this might give you something to play with: define $Create Username(#MinLength, #MaxLength, #MaxTrys) { set(#MinLength, #MinLength, "Local") set(#MaxLength, #MaxLength, "Local") set(#MaxTrys, #MaxTrys, "Local") set(#Generated_Username_Length, 0, "Local") set(#TotalTrys, 0, "Local") loop while($both($either($comparison(#Generated_Username_Length, "<", #MinLength), $comparison(#Generated_Username_Length, ">", #MaxLength)), $comparison(#TotalTrys, "<=", #MaxTrys))) { reset account("Any") set(#Username, $change text casing("{$spin("\{{$account data("First Name")}|{$account data("Last Name")}\}")}{$spin("\{_||.\}")}{$spin("\{|0|1|2|3|4|5|6|7|8|9\}\{|0|1|2|3|4|5|6|7|8|9\}\{|0|1|2|3|4|5|6|7|8|9\}\{|0|1|2|3|4|5|6|7|8|9\}\{|0|1|2|3|4|5|6|7|8|9\}")}", "Lower Case"), "Local") set(#Generated_Username_Length, $text length(#Username), "Local") increment(#TotalTrys) } return(#Username) } Carl :-) Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted September 6, 2014 Report Share Posted September 6, 2014 here guys don't over think it set(#pw, $random text($rand(4, 12)), "Global") TC Quote Link to post Share on other sites
XpownX 8 Posted September 6, 2014 Author Report Share Posted September 6, 2014 loop(1) { reset account("Any") set(#raw user name, "{$account data("Username")}{$account data("Zip Code")}", "Global") set(#valid user, $find regular expression(#raw user name, ".\{4,14\}"), "Global")} here guys don't over think it set(#pw, $random text($rand(4, 12)), "Global") TC Yeah those two are the shothly answer's but work , no need for longer code that do the same thing , short is better.Thanks for the code's ! Quote Link to post Share on other sites
LazyBotter 188 Posted September 6, 2014 Report Share Posted September 6, 2014 Sorry missed the quote above! Great solution! Quote Link to post Share on other sites
stanf 43 Posted September 6, 2014 Report Share Posted September 6, 2014 Here you go this might give you something to play with: define $Create Username(#MinLength, #MaxLength, #MaxTrys) { set(#MinLength, #MinLength, "Local") set(#MaxLength, #MaxLength, "Local") set(#MaxTrys, #MaxTrys, "Local") set(#Generated_Username_Length, 0, "Local") set(#TotalTrys, 0, "Local") loop while($both($either($comparison(#Generated_Username_Length, "<", #MinLength), $comparison(#Generated_Username_Length, ">", #MaxLength)), $comparison(#TotalTrys, "<=", #MaxTrys))) { reset account("Any") set(#Username, $change text casing("{$spin("\{{$account data("First Name")}|{$account data("Last Name")}\}")}{$spin("\{_||.\}")}{$spin("\{|0|1|2|3|4|5|6|7|8|9\}\{|0|1|2|3|4|5|6|7|8|9\}\{|0|1|2|3|4|5|6|7|8|9\}\{|0|1|2|3|4|5|6|7|8|9\}\{|0|1|2|3|4|5|6|7|8|9\}")}", "Lower Case"), "Local") set(#Generated_Username_Length, $text length(#Username), "Local") increment(#TotalTrys) } return(#Username) } Carl :-) nice, its more natural looking 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.