Junior Spellweaver
- Joined
- Apr 15, 2007
- Messages
- 154
- Reaction score
- 0
Ok well due to some problems with the old one aka the "%" problem i went and fixed it up, and added a small little tag along with it.
Now all you have to do is type
!search name
And you can use spaces you DO NOT NEED THE %'S
And after it shows everything it comes up with it will say
Search for "name" was completed.
To remind the gm etc what they searched for or to make sure they didnt misspell it
What this does:
This allows a gm to type
!search monster name/item name/map name
and it will show them a display of everything with that name tag
like so;
TYPE: NAME: ID
Type's = cash,map,monster,item etc..
Credits for fixing it Nukeofwar,
Credits for BASE code intutiondone
Code:
else if (splitted[0].equals("!search")) {
try {
URL url;
URLConnection urlConn;
BufferedReader dis;
String replaced = "";
if (splitted.length > 1) {
replaced = StringUtil.joinStringFrom(splitted, 1).replace(' ', '%');
} else {
mc.dropMessage("Syntax: !search item name/map name/monster name");
}
url = new URL("http://www.mapletip.com/search_java.php?search_value=" + replaced + "&check=true");
urlConn = url.openConnection();
urlConn.setDoInput(true);
urlConn.setUseCaches(false);
dis = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
String s;
while ((s = dis.readLine()) != null) {
mc.dropMessage(s);
}
mc.dropMessage("Search for " + '"' + replaced.replace('%', ' ') + '"' + " was completed.");
dis.close();
}
catch (MalformedURLException mue) {}
catch (IOException ioe) {}
}
Now all you have to do is type
!search name
And you can use spaces you DO NOT NEED THE %'S
And after it shows everything it comes up with it will say
Search for "name" was completed.
To remind the gm etc what they searched for or to make sure they didnt misspell it
What this does:
This allows a gm to type
!search monster name/item name/map name
and it will show them a display of everything with that name tag
like so;
TYPE: NAME: ID
Type's = cash,map,monster,item etc..
Credits for fixing it Nukeofwar,
You must be registered to see links
Credits for BASE code intutiondone