Sebastian Rooks 3 Posted January 26, 2016 Report Share Posted January 26, 2016 So, here's the problem I'm having. What I want to do is be able to load account data from a .csv to a dropdown menu, so that I can select which account to log into one at a time, instead of going through all of them. I found this code on this forum that works for me using ui drop down, but the rest of my bot uses the UI Editor, so I have to have this is a separate tab. That just can't be right, and helping a brother straighten that out would be much appreciated. How do I make this code work with a drop down in UI Editor without making my head explode? clear table(&npip) create table from file(#openfile,&npip) ui drop down("Select account by name or proxy","{$replace("{$plugin function("TableCommands.dll", "$list from table", &npip, "Column", 0)}{$plugin function("TableCommands.dll", "$list from table", &npip, "Column", 2)}",$new line,",")},",#name) ui check box("Or loop through file",#loopaccount) if($comparison(#loopaccount,"= Equals",$false)) { then { set(#rowincrement,$plugin function("TableCommands.dll", "$table search", &npip, #name, "Row Index"),"Global") } } The second thing I haven't figured out yet regarding this function, is that I'd like to populate the drop down list with multiple columns from the table/.csv file so that I can choose based on different criteria than just "name". How about "name" "proxy" "account status", and "phone number", for example. So, my drop down list would be populated with columns 0,2,3,6. That'd be spectacular. I'm just so happy that I got the names to feed in the dropdown menu, and now proxies below them. I wish I could get them on the same row, then add more columns. But as important as that is to me, it's not as important as figuring out how to integrate that whole thing with the drop down from the UI Editor. Thanks for any help. Ive been studying, googling, and experimenting with UBot for 12 solid days and I I feel like my head might explode. Quote Link to post Share on other sites
acamso 55 Posted January 26, 2016 Report Share Posted January 26, 2016 Let me know if this is what youre looking for.. All row information for each selection separating columns by "|"on load("Bot Loaded") { set(#csv_file,"{$special folder("Desktop")}\\csv_file.csv","Global") clear table(&csv_file) create table from file(#csv_file,&csv_file) clear list(%csv_rows) add list to list(%csv_rows,$list from text($replace(&csv_file,",","|"),$new line),"Delete","Global") set(#csv_rows,$replace(%csv_rows,$new line,","),"Global") } ui html panel("<select variable=\"#account\" list=\"#csv_rows\" list-fillwith=\"options\"></select>",2000) Each cell for each selectionon load("Bot Loaded") { set(#csv_file,"{$special folder("Desktop")}\\csv_file.csv","Global") clear table(&csv_file) create table from file(#csv_file,&csv_file) clear list(%csv_rows) add list to list(%csv_rows,$list from text(&csv_file,$new line),"Delete","Global") set(#csv_rows,$replace(%csv_rows,$new line,","),"Global") } ui html panel("<select variable=\"#account\" list=\"#csv_rows\" list-fillwith=\"options\"></select>",2000) Each column as a dropdownon load("Bot Loaded") { set(#csv_file,"{$special folder("Desktop")}\\csv_file.csv","Global") clear table(&csv_file) create table from file(#csv_file,&csv_file) clear list(%csv_rows) clear list(%csv_rows_a) clear list(%csv_rows_ add list to list(%csv_rows,$list from text(&csv_file,$new line),"Delete","Global") set list position(%csv_rows,0) loop($list total(%csv_rows)) { set(#row,$next list item(%csv_rows),"Global") clear list(%row) add list to list(%row,$list from text(#row,","),"Delete","Global") add item to list(%csv_rows_a,$list item(%row,0),"Don\'t Delete","Global") add item to list(%csv_rows_b,$list item(%row,1),"Don\'t Delete","Global") } set(#csv_rows,$replace(%csv_rows,$new line,","),"Global") set(#csv_rows_a,$replace(%csv_rows_a,$new line,","),"Global") set(#csv_rows_b,$replace(%csv_rows_b,$new line,","),"Global") set(#csv_rows,$replace(%csv_rows,$new line,","),"Global") } ui html panel("<select variable=\"#account\" list=\"#csv_rows_a\" list-fillwith=\"options\"></select> <select variable=\"#account\" list=\"#csv_rows_b\" list-fillwith=\"options\"></select>",2000) 1 Quote Link to post Share on other sites
Sebastian Rooks 3 Posted February 6, 2016 Author Report Share Posted February 6, 2016 (edited) Hey thank you so much! This looks like exactly what I'm after, I'm sorry I didn't see it sooner. "Follow this topic", who knew? When I try to run it, I get an error for "on load". Limitation of professional edition, maybe? But it works for me when I remove that part. Thanks so much. I'm sure so many things are going to be built in the future using what you've shown me. Unfortunately, I get an error for the ui html panel also. But at least my problem is partly solved, and I'm learning new things! Edited February 6, 2016 by Sebastian Rooks Quote Link to post Share on other sites
acamso 55 Posted February 6, 2016 Report Share Posted February 6, 2016 Hey, no problem.. Im glad to help. Not too sure on the errors. What are the errors saying? 1 Quote Link to post Share on other sites
Sebastian Rooks 3 Posted February 6, 2016 Author Report Share Posted February 6, 2016 "Script Error Error: Source "myfilename"-> ui html panel" Sorry, I'm sure that's not super helpful, but that's all that it tells me. Quote Link to post Share on other sites
acamso 55 Posted February 6, 2016 Report Share Posted February 6, 2016 Hmm sorry, not too sure on that. 1 Quote Link to post Share on other sites
Sebastian Rooks 3 Posted February 6, 2016 Author Report Share Posted February 6, 2016 Thank you anyway! Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 6, 2016 Report Share Posted February 6, 2016 ui html panel is a developer edition feature so if you don't have the dev edition that may be why you get an error. 1 Quote Link to post Share on other sites
Sebastian Rooks 3 Posted February 6, 2016 Author Report Share Posted February 6, 2016 ahah, That's kind of what I was thinking. I think that once I reach the capacity of the edition I've got, I'd be willing to spring for the last upgrade. But for now I've still got so much more to learn. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 6, 2016 Report Share Posted February 6, 2016 But back to your original problem: the standard GUI won't refresh on it's own so you can probably only do this by using an on load command (not sure if that's a dev feature or not). There may be some other way to refresh it, for example I think if you switch to code view and back it will refresh but that won't help you in a compiled bot. So this should work, but if you edit the file you will have to restart the bot: on load("Bot Loaded") { set(#openfile,"FILE NAME HERE","Global") clear table(&npip) create table from file(#openfile,&npip) } ui drop down("Select account by name or proxy","{$replace("{$plugin function("TableCommands.dll", "$list from table", &npip, "Column", 0)}{$plugin function("TableCommands.dll", "$list from table", &npip, "Column", 2)}",$new line,",")},",#name) ui check box("Or loop through file",#loopaccount) if($comparison(#loopaccount,"= Equals",$false)) { then { set(#rowincrement,$plugin function("TableCommands.dll", "$table search", &npip, #name, "Row Index"),"Global") } } 1 Quote Link to post Share on other sites
Sebastian Rooks 3 Posted February 6, 2016 Author Report Share Posted February 6, 2016 There you go, coming to my rescue again! I suspect that "on load" is dev only too, because I get the same kind of error when I try to run it. I'll absolutely be trying this though. Thanks! Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 6, 2016 Report Share Posted February 6, 2016 There you go, coming to my rescue again! I suspect that "on load" is dev only too, because I get the same kind of error when I try to run it. I'll absolutely be trying this though. Thanks! Hmm then that is an issue for you because on load will get the data for you before the GUI is built and so it will be there to populate the drop down menu. Without that you can try switching to code view and back and I think it will refresh it for you. Otherwise you can try Aymens File Management Plugin, it's free and has a dropdown dialog box that you can use and I think it will work for you. The only thing is that it is a dialog box so it will pop up instead of being inside of the GUI. 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.