mIRC Home    About    Download    Register    News    Help

Print Thread
#88527 29/06/04 12:39 AM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
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

#88528 29/06/04 12:56 AM
Joined: Mar 2004
Posts: 457
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
$2-

#88529 29/06/04 12:56 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
$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

#88530 29/06/04 03:13 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Ohhh right I see! clever, thank you smile

#88531 29/06/04 03:55 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
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

#88532 29/06/04 04:06 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
On *:text:!msg *:#:{
  • write adds.txt $date $time $nick $+ : $2-
    .msg # Successfully added: $2-
}

#88533 29/06/04 09:49 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
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

#88534 29/06/04 10:15 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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.

#88535 29/06/04 10:36 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Thank you so much! It is now working perfectly, you certainly know your scripting wink

Thanks once again


Link Copied to Clipboard