code:var IsItOn = 0; function OnEvent_ChatWndSendMessage(ChatWnd, Message) { if(Message.substr(0,8) == "*PtalkOn") { IsItOn = 1; return ""; } if(Message.substr(0,9) == "*PtalkOff") { IsItOn = 0; return ""; } } function OnEvent_ChatWndReceiveMessage(chatwnd, sOrigin, sMessage, nMessageKind) { if (sMessage.substr(0,2) == "Hi" || sMessage.substr(0,2) == "hi") { if (IsItOn == 1) { pChatWnd.SendMessage("Hey!"); } else { Debug.trace("IsItOns value is " + IsItOn + ", not 1, message not sent"); } } else { Debug.trace("Message is " + sMessage + ", not Hi or hi, nothing done."); } }
quote:Originally posted by Moulin Rouge The greatest thing you'll ever learn, is just to love and be loved in return