Hi, did a quick stab at this:
function ulx.search( calling_ply, engine, search )
if engine == "twitch" or engine == "Twitch" then
link = "\"http://www.twitch.tv/search?query="
engine = "Twitch"
end
if engine == "youtube" or engine == "Youtube" then
link = "\"http://www.youtube.com/results?search_query="
engine = "Youtube"
end
if engine == "google" or engine == "Google" then
link = "\"http://www.google.com.au/#q="
engine = "Google"
end
if engine == "bing" or engine == "Bing" then
link = "\"http://www.bing.com/search?q="
engine = "Bing"
end
if engine == "yahoo" or engine == "Yahoo" then
link = "\"http://search.yahoo.com/search?p="
engine = "Yahoo"
end
if link == undefined or link == null then
ULib.tsayError( calling_ply, "An error occurred, please try again.", true )
return
else
search = search .. "\""
ULib.tsayError( calling_ply, "You searched for \"" .. search .. " on " .. engine, true )
calling_ply:SendLua("gui.OpenURL(".. link .. search ..")")
end
end
local search = ulx.command( "Tom's Fun", "ulx search", ulx.search, "!search", true )
search:addParam{ type=ULib.cmds.StringArg, hint="Engine: (Twitch, Youtube, Google, Bing, Yahoo." }
search:addParam{ type=ULib.cmds.StringArg, hint="Search" }
It works fine but for some reason it remembers what link was used previously (not the "search" part) It also isn't appearing in a category on the menu.
Example:
If I type "ulx search google Pie" in console, it will work fine.
then If I type "ulx search asdfasdf poop" in console, it will search google for "poop" (and its not because of line 14)
And as far as I see it should be showing in "Tom's Fun" category, but nope.