Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

"Fixed" !search command[OdinMS]

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.

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,
Credits for BASE code intutiondone
 
Experienced Elementalist
Joined
Jun 22, 2008
Messages
264
Reaction score
0
Re: [Release]"Working" !search command[OdinMS]

One word.
Sweet: )

have you tested this yet?
Ty,
~dXm

EDIT: btw, change 'working' on the thread title to 'Fixed' or w.e, cus the other one worked aswell ;) ~
 
Junior Spellweaver
Joined
Apr 15, 2007
Messages
154
Reaction score
0
Re: [Release]"Working" !search command[OdinMS]

One word.
Sweet: )

have you tested this yet?
Ty,
~dXm

EDIT: btw, change 'working' on the thread title to 'Fixed' or w.e, cus the other one worked aswell ;) ~

Yep tested and working 100%
 
Newbie Spellweaver
Joined
Apr 5, 2008
Messages
20
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

Yeah it builded great but you have to take out the "}" at the end and put "}" right before the "else" at the beginning of the code just like the old one for it to work.

Anyway thanks
 
Custom Title Activated
Loyal Member
Joined
Apr 29, 2008
Messages
1,297
Reaction score
509
Re: [Release]"Fixed" !search command[OdinMS]

For those who cant get it to work.
Remember to add this at the top
Code:
import java.net.URL;
import java.net.URLConnection;
import java.io.BufferedReader;
import java.io.IOException;
import java.net.MalformedURLException;
import java.io.InputStreamReader;
 
Newbie Spellweaver
Joined
Jun 22, 2008
Messages
41
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

This goes in CommandProcessor.java, right?
Sorry, I'm new to Odin. I used to use Titan so I have to relearn it all :)
Thanks.
 
Junior Spellweaver
Joined
Apr 15, 2007
Messages
154
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

You would think people would have the logic to install the old one then the the fix xD
 
Newbie Spellweaver
Joined
Jun 1, 2008
Messages
29
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

When I compiled, it compiled fine, and i replaced the odinms.jar in my dist folder already, but when i tried to use it ingame, it said that !search isnt a valid command.
 
Initiate Mage
Joined
Jun 13, 2008
Messages
3
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

When I compiled, it compiled fine, and i replaced the odinms.jar in my dist folder already, but when i tried to use it ingame, it said that !search isnt a valid command.

Did you just copy it to your dist folder? If yes, then you also need to copy it to your java folder.
 
Newbie Spellweaver
Joined
Jun 1, 2008
Messages
85
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

Where in CommandProcessor.java do you put that code? Anywhere between the others?
 
Experienced Elementalist
Joined
Jun 6, 2008
Messages
242
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

got error when complie
can anyone help me?
 
Experienced Elementalist
Joined
Jun 6, 2008
Messages
242
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

hmm. where do the search should i post under?
 
Newbie Spellweaver
Joined
Jul 22, 2008
Messages
23
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

Hey my !search is not working..

This is what I did.

1 - Edited the CommandProcessor.java
2 - Compiled with NetBeans.
3 - Copied the odinms.jar in dist folder (in my sources folder) and in Java.

"GM Command !search does not exist"

What am I doing wrong ?
 
Master Summoner
Loyal Member
Joined
Apr 27, 2008
Messages
596
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

Amazingly NICE.
 
Newbie Spellweaver
Joined
Jul 22, 2008
Messages
23
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

Regurgitate did it work ? Can you send me yur commandprocessor.java via PM please ?
 
Newbie Spellweaver
Joined
Jul 22, 2008
Messages
23
Reaction score
0
Re: [Release]"Fixed" !search command[OdinMS]

Hey my !search is not working..

This is what I did.

1 - Edited the CommandProcessor.java
2 - Compiled with NetBeans.
3 - Copied the odinms.jar in dist folder (in my sources folder) and in Java.

"GM Command !search does not exist"

What am I doing wrong ?

Buump
 
Back
Top