Jump to content
UBot Underground

Ui Html Panel Add And Remove To List


Recommended Posts

Here you go:

ui html panel("Item: <input type=\"text\" variable=\"#item\"> <input type=\"button\" value=\"Add\" onclick=\"ubot.runScript(\'Add Item\');\">
Remove: <select variable=\"#remove_item\" list=\"#list_items\" list-fillwith=\"options\"></select> <input type=\"button\" value=\"Remove\" onclick=\"ubot.runScript(\'Remove Item\');\">",100)
define Add Item {
    add item to list(%list,#item,"Don\'t Delete","Global")
    set(#list_items,$text from list(%list,","),"Global")
}
define Remove Item {
    set list position(%list,0)
    set(#remove_item_num,0,"Global")
    loop($list total(%list)) {
        if($comparison(#remove_item,"=",$list item(%list,#remove_item_num))) {
            then {
                remove from list(%list,#remove_item_num)
                set(#list_items,$text from list(%list,","),"Global")
                stop script
            }
            else {
                increment(#remove_item_num)
            }
        }
    }
}
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...