mk21 1 Posted November 13, 2012 Report Share Posted November 13, 2012 So I am trying to build a bot for resale that will allow my customer to access several different accounts. I would like the customer to be able to add and remove accounts on their own using a .csv file. I have the process looped so that it will do the entire list. Currently, the only way for my customers to only check specific accounts would be to delete the account data for those they did not want to check at the moment. Clearly that is a pretty major inconvenience over time. So what I'm looking to do is give them a way to check any number of individual accounts via either check boxes or a list box in the ui panel. I do believe the check box option would be more convenient. I am very much a html rookie, but I'm trying to learn. This just isn't my natural talent. So something I found that has allowed me to at least get started toward a solution is this below: clear list(%Accounts) clear table(&Accounts) create table from file("C:\\Users\\ADMIN\\Desktop\\Combo\\TM accounts.csv", &Accounts) set(#table_row, 0, "Global") loop($table total rows(&Accounts)) { add item to list(%Accounts, $table cell(&Accounts, #table_row, 0), "Delete", "Global") increment(#table_row) } clear list(%html) set list position(%Accounts, 0) loop($list total(%Accounts)) { set(#html, "<INPUT NAME=\"accounts\" TYPE=\"CHECKBOX\" VALUE=\" {$list item(%Accounts, $list position(%Accounts))}\" variable=\"#check_account\" fillwith=\"value\">{$next list item(%Accounts)}<BR>", "Global") add item to list(%html, #html, "Delete", "Global") } set(#html, %html, "Global") ui html panel(#html, 300) Now please don't kill me here. Here's what I do know. TYPE is what makes them a check box, in between the <INPUT> and the <BR> is each account name. What I don't know is whether or not NAME is significant. I suspect not based on the little testing I've done. I suspect that VALUE is significant. I am guessing that I can have the value put somewhere. As for setting the variable and using fillwith, these are just things I've tried going off google and forum searches. I've also seen optgroup mentioned, but I'm just not familiar enough with all this. So if someone could please tell me if I'm making this way too hard or if it's even possible to do this with ubot, I'd really appreciate it. I know that I can do an if then statement to populate the list to loop from if I can figure how to get the checked boxes to mean anything. Thanks. Quote Link to post Share on other sites
mk21 1 Posted November 13, 2012 Author Report Share Posted November 13, 2012 Ok so I have an update to this, but I still have a problem that I'm starting to worry may not be possible in ubot. I wrote this code: clear list(%Accounts) clear table(&Accounts) create table from file("C:\\Users\\ADMIN\\Desktop\\Combo\\TM accounts.csv", &Accounts) set(#table_row, 0, "Global") loop($table total rows(&Accounts)) { add item to list(%Accounts, $table cell(&Accounts, #table_row, 0), "Delete", "Global") increment(#table_row) } clear list(%html) set list position(%Accounts, 0) loop($list total(%Accounts)) { set(#html, "<INPUT NAME=\"account\" TYPE=\"CHECKBOX\" VALUE=\"{$list item(%Accounts, $list position(%Accounts))}\" variable=\"#{$list item(%Accounts, $list position(%Accounts))}\" fillwith=\"checked\">{$next list item(%Accounts)}<BR>", "Global") add item to list(%html, #html, "Delete", "Global") } set(#html, %html, "Global") set(#html, "<form> {%html} </form>", "Global") ui html panel(#html, 300) That gets me a list of all the accounts in the .csv file with a check box next to them, and it creates a variable {#(account name)} for each account. When I click a box, it turns the corresponding variable to $true. Now I seem to be stuck. As far as I know there is no way to loop through variable like a list. In other words I can't figure out a way to loop $list total and test if each variable is $true so I can create a list with all $true results to run my whole loop off. Any advice from anyone? I seem so close. I have a hard time believing ubot can't do this. Quote Link to post Share on other sites
Legend 181 Posted November 13, 2012 Report Share Posted November 13, 2012 One way is to create a column for true/false or yes/no and then loop through the table checking these values, IF the value is true, THEN do this, IF the value is false THEN do that... Quote Link to post Share on other sites
mk21 1 Posted November 13, 2012 Author Report Share Posted November 13, 2012 Thanks for the response Duane. Are you saying create this column for the original account information without using any html or after I've done the html? If it's before, I thought about that already, and I know I can definitely do that, but that's still going to make my user go into their .csv file and change y's to n's and vice versa every time they want to run the bot pretty much. While that's better than not having the option if there's no other way, I don't think that will make the bot seem very professional. It would be much more appealing to be able to do it from the UI panel IMO. Any other suggestions on how to do this in the panel? Quote Link to post Share on other sites
automaton 2 Posted January 21, 2014 Report Share Posted January 21, 2014 mk21, just read through your post nad am trying to do something VERY similar...did you ever get it to work? Quote Link to post Share on other sites
zenos 13 Posted March 25, 2014 Report Share Posted March 25, 2014 mk21, just read through your post nad am trying to do something VERY similar...did you ever get it to work?Need to know too if you get it work Quote Link to post Share on other sites
vonnch 1 Posted March 29, 2014 Report Share Posted March 29, 2014 I tried this. Not sure if I did everything right but it didn't work for me. 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.