mIRC Homepage
Posted By: Ninko Saving user messages - 29/06/04 12:39 AM
Hi there,
I am trying to make a command that will allow someone to say !msg followed by a message and have that message saved to a text file. So far I am using the following code:

on *:TEXT:!msg *:*:write adds.txt $date $time $nick $+ : $1-

The problem I'm having is its saving the word !msg with the message, is there a way to get it to miss the word !msg out and save the message only?

Thanks
Posted By: Danthemandoo Re: Saving user messages - 29/06/04 12:56 AM
$2-
Posted By: Online Re: Saving user messages - 29/06/04 12:56 AM
$1 = first word
$1- = first word onwards
$2 = second word
$2- = second word onwards
$1-3 = first word to the third word

So, in short, use $2- laugh
Posted By: Ninko Re: Saving user messages - 29/06/04 03:13 PM
Ohhh right I see! clever, thank you smile
Posted By: Ninko Re: Saving user messages - 29/06/04 03:55 PM
Also, what code would I need to add to the end of that to get it to say something to the channel, just so that person knows it has worked.

Sorry I'm very new to scripting.

Thanks
Posted By: Online Re: Saving user messages - 29/06/04 04:06 PM
On *:text:!msg *:#:{
  • write adds.txt $date $time $nick $+ : $2-
    .msg # Successfully added: $2-
}
Posted By: Ninko Re: Saving user messages - 29/06/04 09:49 PM
Ok thanks, almost got it how I want now, but I noticed that when someone whispers it to me it adds what they say to the file but doesn't say that message to them in whisper, is there anyway of fixing that or is that too complex?

Thanks again
Posted By: Online Re: Saving user messages - 29/06/04 10:15 PM
On *:text:!msg *:*:{
  • write adds.txt $date $time $nick $+ : $2-
    .msg $iif(#,#,$nick) Successfully added: $2-
}

Blue words are what I modified. Now the bot will listen to commands on private (whisper) too.
Posted By: Ninko Re: Saving user messages - 29/06/04 10:36 PM
Thank you so much! It is now working perfectly, you certainly know your scripting wink

Thanks once again
© mIRC Discussion Forums