Shoutbox

[RELEASE] Script Searcher - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [RELEASE] Script Searcher (/showthread.php?tid=73558)

[RELEASE] Script Searcher by Ashylay on 04-12-2007 at 05:36 PM

Okay extremely simple script i just edited my google one basically you use this script to search the scripts database for scripts. Saves loading the url.

All you have to do is in a conversation type "/search [SCRIPT NAME HERE]"

i cba packaging so heres the source. Just create a new script and c&p

code:
// Feel free to use any part of this script
// Created by Ashylay
// This text can eb removed but I would like it if you kept it here in credit for me.

function OnGetScriptCommands(){
    var commands = "<ScriptCommands>";
    commands += " <Command>"
    commands += " <Name>search</Name>"
    commands += " <Description>Search for MSG+ Scripts easily!</Description>"
    commands += " </Command>"
    commands += "</ScriptCommands>"
    return commands;
}


function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
    if(/^\/search\s(.+)$/i.test(Message)) {
        var Param = RegExp.$1;
        MsgPlus.DisplayToast("Script Searcher", "You have searched for "+Param+" Please wait.");
        new ActiveXObject("WScript.Shell").Run("http://www.msgpluslive.net/scripts/search/?q="+escape(Param));
        return "";
    }
}

Edit: I have updated the script so if you want to edit it yourself you can easily.


Edit the red parts to change /search to /[Whatever you like]

Edit the parts in clue to change the URL (remember when changing the url only place the part just before the text you type comes in PM for more info on this.
RE: [RELEASE] Script Searcher by felipEx on 04-12-2007 at 06:04 PM

nice work.

i like the search extension for Firefox :)


RE: [RELEASE] Script Searcher by vikke on 04-12-2007 at 06:31 PM

Neat and simple script, but I think the command should be "/searchscript" or something, as search is generally..
You could also do a script that searches the script area of these forums with [release] in the title! :)

vikke


RE: [RELEASE] Script Searcher by L. Coyote on 04-12-2007 at 06:48 PM

quote:
Originally posted by vikke
Neat and simple script, but I think the command should be "/searchscript" or something, as search is generally..
You could also do a script that searches the script area of these forums with [release] in the title! :)

vikke
The code for the RELEASE search would be similar to the posted code.
code:
if(Message == '/searchscriptrelease') {
new ActiveXObject("WScript.Shell").Run("http://shoutbox.menthix.net/basicsearch.php?do=search&sfrm=1&keywords=release&username=&fid=39&lookin=sbj&sort=t");
}
This is just an example, but it should work.

Also, to change the command from the original code, simply change:
code:
if(/^\/search\s(.+)$/i.test(Message))
the bold part to "/searchscript" or whatever you like.
RE: [RELEASE] Script Searcher by markee on 04-13-2007 at 01:34 AM

I think you might want to have a look at CookieRevised's reply to [Release] Exit WLM for improving your regular expression (though using the test method is better than the exec method used by Cookie in my opinion).  Apart from that, good job.


RE: [RELEASE] Script Searcher by CookieRevised on 04-13-2007 at 07:21 AM

quote:
Originally posted by markee
(though using the test method is better than the exec method used by Cookie in my opinion).  Apart from that, good job.
there is a difference between the two and each has its uses. With the test method the global properties of the RegExp are not updated. It are these properties which are used further, so you need to use the exec method.

RE: [RELEASE] Script Searcher by Ashylay on 04-15-2007 at 01:16 AM

Updated it incase you wanted to edit some parts of it yourself.