Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Little Msn Script help
#1
Hello, This is someone elses script but i want to edit it for my personal use. Anyway here is the code;

Code:
function FilterString( str )
{
    var googleMatches = null;
    
    //While a match is found to the regular expression
    while( (googleMatches = str.match( "Google\\(.*?\\)" )) != null )
    {
        //Get string
        var googleString = googleMatches[0];
        Debug.Trace( googleString )
        
        //Get the search text
        var searchText = googleString.substring(7, googleString.length-1);
        
        //Replace all spaces with +'s
        searchText = searchText.replace(' ', '+');
        
        //Make it into it's final form
        searchText = "http://lmgtfy.com/?q=" + searchText;
        
        //Replace
        str = str.replace( googleString, searchText );
    }
    
    //Return
    return str;
}

function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
    return FilterString( Message );
}

What i want to change it instead of it replace the text that i send e.g 'Google(test)'

I want it to send 'Google (test)' then the link.
Thanks for help Smile
Reply


Messages In This Thread
Little Msn Script help - by davidelliott- - 12-24-2009, 12:09 PM
RE: Little Msn Script help - by Gaijin - 12-24-2009, 12:19 PM
RE: Little Msn Script help - by davidelliott- - 12-28-2009, 03:35 AM
RE: Little Msn Script help - by Gaijin - 12-30-2009, 11:50 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)