quote:
Originally posted by The-Phantom
quote:
Originally posted by CookieRevised
No...
1) nothing will be executed after a return statement
2) when you return the same message, the command will be send to your contact too (as text).
3) in that code you check if the message is _not_ "/ajax-test", it should the opposite.
See the code in my previous post for the proper way.
I still don't get it. If it is the command I need, the if clause is skipped and the handling is performed.
No it is not. the handling of the command (that comment block) is placed after the
return statement in your code. Anything after a
return statement will not get executed.
And, again, you should NEVER perform a negative check (!= or !==) when you want to check for your command, that is realy not the proper way of doing things and it will cripple other stuff. It is also not logical to do it and it requires more code.
Read the scripting documentation about command handling....
The proper way is:
js code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message) {
if (Message.substr(0, 10) === "/ajax-test") {
// your code for the command /ajax-test here
return "";
}
}
quote:
Originally posted by The-Phantom
quote:
There are some things you need to know whenyou want to change recieved text.
Biggest thing is that you can never change recieved text to text which is longer than the original.
Second, text you receive also includes your own send messages.
See OnEvent_ChatWndReceiveMessage event.
All this is also explained in the Plus! Scripting documents.
Yes, yes, I know. How could I be able to make some scripts without reading that first?
You would be surprised to know how many people start scripting without properly reading the docs (and then comming here for help)
Anyways, I posted that because you asked about changing recieved text. Those are the basics to know for doing that. If that is not what you wanted then I misunderstood you. In that case, could you maybe rephrase your question? Or explain in a detailed way what it is that you exactly want to with all of this.