SmokingCookie
Senior Member
Posts: 815 Reputation: 15
30 / /
Joined: Jul 2007
|
RE: 2 Scripting questions.
First question:
Try this:
code: // code retrieves first word ONLY
var FirstWord;
function OnEvent_CatWndReceiveMessage(pChatWnd,sMessage,mOrigin,kMessageKind) {
if(mOrigin != Messenger.MyName) { // Optional!!
switch(sMessage.charAt(0)) { // I prefer charAt fo single characters than substring(0,1)
case "~":
FirstWord = sMessage.split(" ",1);
break;
}
}
}
Workin' on your 2nd..
This post was edited on 05-18-2008 at 05:33 PM by SmokingCookie.
|
|