Optimus Prime 4 Posted January 26, 2013 Report Share Posted January 26, 2013 i have the following code: ui list box("Listbox", "aol , yahoo, bing , lycos, infoseek, mama, dogpile", #listbox)if($comparison(#listbox, "=", "aol")) { then { navigate("www.aol.com", "Wait") } else { navigate("www.yahoo.com", "Wait") }}ui stat monitor("The current site is:", $url) I simply want to select an item from that listbox and then have ubot go to the select site. I want to be able to have the choice to select any site and have ubot go to that site.. can someone please give me an idea on how this works... thanks Quote Link to post Share on other sites
VaultBoss 310 Posted January 26, 2013 Report Share Posted January 26, 2013 You should use ELSE IF instead of simply ELSE there, for multiple options, like you have Quote Link to post Share on other sites
Optimus Prime 4 Posted January 26, 2013 Author Report Share Posted January 26, 2013 ui list box("Listbox", "aol , yahoo, bing ", #listbox)if($comparison(#listbox, "=", "aol")) { then { navigate("www.aol.com", "Wait") } else if($comparison(#listbox, "=", "yahoo")) { then { navigate("http://www.yahoo.com/", "Wait") } else if($comparison(#listbox, "=", "bing")) { then { navigate("http://www.bing.com/", "Wait") } } }}ui stat monitor("The current site is:", $url) this is my code and it doesnt work. can someone modify this and make it work thank you Quote Link to post Share on other sites
Bliss 194 Posted January 26, 2013 Report Share Posted January 26, 2013 Here you go, this works :- ui list box("Listbox", "aol,yahoo,bing", #listbox) if(#listbox = "aol") { then { navigate("www.aol.com", "Wait") } else if(#listbox = "yahoo") { then { navigate("http://www.yahoo.com/", "Wait") } } else if(#listbox = "bing") { then { navigate("http://www.bing.com/", "Wait") } } } ui stat monitor("The current site is:", $url) hope that helps 1 Quote Link to post Share on other sites
Optimus Prime 4 Posted January 26, 2013 Author Report Share Posted January 26, 2013 Here you go, this works :- ui list box("Listbox", "aol,yahoo,bing", #listbox) if(#listbox = "aol") { then { navigate("www.aol.com", "Wait") } else if(#listbox = "yahoo") { then { navigate("http://www.yahoo.com/", "Wait") } } else if(#listbox = "bing") { then { navigate("http://www.bing.com/", "Wait") } } } ui stat monitor("The current site is:", $url) hope that helps Thank you so much! Quote Link to post Share on other sites
VaultBoss 310 Posted January 26, 2013 Report Share Posted January 26, 2013 BTW, else if doesn't require the THEN node within itself... 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.