mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2015
Posts: 4
P
Poiler Offline OP
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jun 2015
Posts: 4
Hello everyone.
I'm just start write a small script for my self. I have some questions.

1. About on *:TEXT event. How can I get that content of message. There is $nick, $chan. Is there something like $mess or $content that return the content? I already try $1, $2,... but how can I know how many of that? Besides that, $1, $2,... also come with formated. Can I get content only?

2. I want to know if someone trying to send private messages to my bot, bot will forward messages to me. How can I catch the private message event? Can I send that message to other nick?

3. How can I record the content of chanel in .txt file? In some special case like if my nick exists on content, it will record into .txt file.

Thank you for your time!
----------------------------------
EDIT: Thank you for your answer Nillen. I have 1 more problem.
I often use .timer 1 <second> to delay my reply. But during delay time, something might happend, thus the message on queue will have no meaning. How can I handle this?

"stop!" keyword:

Code:
me: !say 20 Hello world!
(...)after 10s
me: stop!
(...)Nothing happend after that

without keyword:
Code:
me: !say 20 Hello world!
(...)after 20s
Bot: Hello world!


Last edited by Poiler; 23/06/15 04:24 PM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
You can get a good feel of the language by using the help files. If you type " /help on text " in the editbox you'll get the window you're looking for.
This will tell your that you can use either $1 to get the first word or $1- to get the full message.
Using $0 will return how many tokens you have in the string.

The private message is also a text event, it just uses private windows. You can select on which window the event triggers by changing the last option in the on text event. The help files should tell you how to tell them apart.

To write stuff to a file you can use /write. " /help /write ". Your string in this case is ofcourse $1-

Edit: Didn't see your question about formatted text. You can use $strip(INSERT STRING HERE) to remove certain aspects about the string. As per always in mIRC you can use the help files for guidance. " /help $strip "

Last edited by Nillen; 23/06/15 03:49 PM.

Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jun 2015
Posts: 4
P
Poiler Offline OP
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jun 2015
Posts: 4
Thank you so much for your answer!

Joined: Jun 2015
Posts: 4
P
Poiler Offline OP
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jun 2015
Posts: 4
Oh I just remember 1 thing.
I try to set the message will send after, for example, 20 second. Can I cancel it when some text recognized?
Something like this with "stop!" keyword:

Code:
me: !say 20 Hello world!
(...)after 10s
me: stop!
(...)Nothing happend after that

without keyword:
Code:
me: !say 20 Hello world!
(...)after 20s
Bot: Hello world!


P/s: Sorry for double post. I forgot about this problem.

Last edited by Poiler; 23/06/15 04:07 PM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
You can assign some name to your timer, like /.timerPublicmsg <something>, and with !stop use on-text event with command /.timerPublicmsg off.


Dont give a fish - teach to fish!
Joined: Jun 2015
Posts: 4
P
Poiler Offline OP
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Jun 2015
Posts: 4
Thank you, I have tried and it's worked. I though /timer was not a global variable.
Thank you again smile


Link Copied to Clipboard