quote:
Originally posted by -DRK-panoz
I too want to make a bot and am not aware of what I'm doing wrong
code:
function OnEvent_ChatWndReceiveMessage("","","!ver",1)
{
ChatWnd.SendMessage("This is v1.0.0a");
}
And then in the Debug I get
code:
Error: Expected identifier.
Line: 1. Code: -2146827278.
Please help. Thanks
function OnEvent_ChatWndReceiveMessage("","","!ver",1)
{
ChatWnd.SendMessage("This is v1.0.0a");
}
-------------------------------------------------------------------------------
when you create that function you cant pass arguements, instead you receive parameters, it should be something like
function OnEvent_ChatWndReceiveMessage(objChatWnd, strUser, strMessage, numMessageType)
{
objChatWnd.SendMessage("This is v1.0.0a");
}
objChatWnd is the ChatWnd object that generated the event
strUser is the name of the user who send the text
strMessage is the message
numMessageType is a number corresponding to the type of message
you can use these variables in the function in if statements or something to do what you want
if you want to report the version number when !ver is typed, it should look like
function OnEvent_ChatWndReceiveMessage(objChatWnd, strUser, strMessage, numMessageType)
{
if(strMessage == "!ver"){
objChatWnd.SendMessage("This is v1.0.0a");
}
}