Il use this topic to continue my topic from here:
http://www.mpscripts.net/showthread.php?tid=79
Reason I post here is since you already started the begining of the problem, and il just continue it.
Now this is the code I managed to make:
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
//Help text
if( Message.match(/!help/i) )
{
ChatWnd.SendMessage('!help = Show this text. !song = Show the song im listening to. !sendsong = Send you the song im listening to.')
}
//Song name
if( Message.match(/!song/i) )
{
ChatWnd.SendMessage('/np')
}
//Send Song
if( Message.match(/!sendsong/i) )
{
ChatWnd.SendMessage('/sendsong')
}
}
But there are a few problems.
1) When you !help it spams it alot.
2) If you say !help in the middle of a sentence, it still works.
3) If you use !help and the !help contains !song and !sendsong it registers it and you get a loop of the commands.
Also I would like to know how to make a new line for the help thingy, so I can separate. And simply make it only work if its in the begining of the message and only the command, nothing else behind or before. Thats simply what I need to fix and this code will work like a dream. ^^ (and remove loop /cry)