quote:
Originally posted by whiz
Why?
Do you even read what you're highlighting?
js code:
if (Parameter[1] == "google")
{
>>> Search(Parameter[1].length + 1,Parameter[1]);<<<
}
else if (Parameter[1] == "yahoo")
{
>>> Search(Parameter[1].length + 1,Parameter[1]);<<<
}
else
{
Look what you're sending as your first parameter. What is the result of executing "Parameter[1].length + 1", you think? ...A string? I don't think so. You're taking the length of Parameter[1] ("google" or "yahoo", so 6 or 5) and add 1 to it, resulting in either 7 or 6 - just like you found out.
My guess is that you wanted to get the
substring starting at that position, since that's where your search terms start. So, basically, you replace the first two highlighted lines with:
js code:
Search(Message.substr(Parameter[1].length + 1), Parameter[1]);
These are the kind of things a script developer should be able to debug and find the problem by himself...