The450Man 0 Posted February 1, 2016 Report Share Posted February 1, 2016 Has anyone made a UI HTML Panel display to add and remove items to a list? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted February 1, 2016 Report Share Posted February 1, 2016 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) } } } } 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.