Jump to content
UBot Underground

Problem With Dropdown In Ui Editor Vs. Ui Drop Down


Recommended Posts

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. 

Link to post
Share on other sites

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 selection

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(&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 dropdown

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)
    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)
  • Like 1
Link to post
Share on other sites
  • 2 weeks later...

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 by Sebastian Rooks
Link to post
Share on other sites

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")
    }
}
  • Like 1
Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...