just found out it doesnt works with spaces in it if someone can fix it i would appreciate it lol
|
hey guys im new here and i made a ::itemdb search command
what it does:
when you type ::itemdb texthere
it will open a browser with this url: ItemDB | 724 TYPED TEXT AFTER ::itemdb command
fixed version!!@!@
Code:case "itemdb": String itemsearch = ""; for (int i = 1; i < cmd.length; i++) itemsearch += cmd[i] + ((i == cmd.length - 1) ? "" : "%20"); player.getPackets().sendOpenURL("http://itemdb.biz/index.php?search=" + itemsearch); return true;
just found out it doesnt works with spaces in it if someone can fix it i would appreciate it lol
try using an _ instead of a space
ty i try now
replace (" ", "_"); ..... too easy fix?
not working it does like this itemdb.biz/search=dragon_claws which results in no search results ty for your help though
i have the solution:
Code:case "itemdb": String itemsearch = ""; for (int i = 1; i < cmd.length; i++) itemsearch += cmd[i] + ((i == cmd.length - 1) ? "" : "%20"); player.getPackets().sendOpenURL("http://itemdb.biz/index.php?search=" + itemsearch); return true;
Try + instead on underscore. So like temdb.biz/search=dragon+claws
if(cmd.length > 2)
replaceAll(" ", "+");
Don't take this the wrong way, but why do you need to connect to itemdb.biz for this? Doesn't Matrix already load item defs from cache? If so, then you can just search through the loaded defs on your server.
Good job though, none-the-less.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |