mIRC Home    About    Download    Register    News    Help

Print Thread
#230986 27/03/11 06:32 PM
Joined: Mar 2011
Posts: 8
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2011
Posts: 8
Hi,

I've hooked up Mirc with bitlebee and I have my Mirc chatting with people on MSN.. I have it setup to auto accept people and to reply to them.

I just want to know how do I make a delay between my responses?
I don't want to write back instantly.

I'm fairly new to this so please don't give me too much of an overly technical reply.

I've tried using auto talker and auto answer with windows live plus but I don't seem to be able to get them working.

Thanks,
Gilesy

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
mIRC and Windows Live (Plus or otherwise) have nothing to do with each other.

To make an automatic reply delay in mIRC, the simplest way to do this is to use a timer. See /help /timer for details.

Joined: Mar 2011
Posts: 8
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2011
Posts: 8
OK Thanks I'll try that myself now.... I appreciate your help smile

I understood they were separate, plus -->> Mirc but for me chatting to people on MSN, plus is a very simple option, I just couldn't find a good enough tutorial for it to work for me.

Thanks,
Giles

Joined: Mar 2011
Posts: 8
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2011
Posts: 8
Hi,

I've read up about it in the help section but I'm still lost.

Here's an example of what I'm doing -

on 1:TEXT:*New request*:&bitlbee:/msg $chan yes
on *:TEXT:how are you:?:/msg $nick Hey I'm good | /msg $nick hows things?

This is in my scripts editor as you know. As you can see it accepts any friends requests and replies with an answer.

What, how and where should I make a "60 second delay" for example before making the reply to "how are you?".

I'm sure it's so simple, I just don't know if it's a command I put in at the top of the scripts editor or before EVERY single reply in the editor...

Can you somebody just show me a simple piece of code of what it should look like and where I should pasted please?

I really appreciate anybody giving me a reply.
Thanks for your time,
Giles

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Originally Posted By: /help /timer

/timer1 0 20 /ame is AWAY!

Timer1 will repeat an all channel action every 20 seconds until you stop the timer.


As the help file shows, just use it like that. Change the 0 to 1 if you want it send the message once and the 20 to 60 if you want it to wait 60 seconds instead of 20. That comes down to the following:

Code:
/timer 1 60 msg $nick hows things?


In your script, here's what it would look like. Note that I put things on separate lines to keep it clean. You can put things on one line if you really want that.

Code:
on *:TEXT:how are you:?:{
  msg $nick Hey I'm good
  .timer 1 60 msg $nick hows things?
}


You may also want to fix up the grammar there, but again, that's up to you. wink

Btw, you know that the matchtext you have there will not trigger if the person says "How are you?", right? The question mark would make it fail to match. You could put a wildcard on the end of that matchtext if you want it to trigger for any punctuation and other text that may follow.


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2011
Posts: 8
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2011
Posts: 8
Ahhh I get it now!! Thanks so much Riamus!

Can you elaborate about - "You could put a wildcard on the end of that matchtext if you want it to trigger for any punctuation and other text that may follow."

I read a little about this, but I don't fully get the ins and outs of it, does the wild card trigger for anything with - a question mark? Or Just for messages that don't have a suitable answer?

If you guys have any links to threads on this with similar info that I could understand, I'll go read it and save you guys time from posting the same content over and over.

Thanks again Riamus!
Giles

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Right now, your matchtext is: how are you

If it is anything else, even just one character different, it will not match. That means that just adding punctuation (a question mark in this case) will make it fail to match.

You can change the matchtext to: how are you*

That would match anything that starts out with "how are you" regardless of any other text or characters following it. So it would match things like "how are you" and "how are you?" and "how are you, man?" and whatever else. It will not match text with something before it, such as "hey, how are you?" For that, you'd need a * before it as well... matchtext would be: *how are you*

In the event, it would look like:

Code:
on *:text:how are you*:#: { }


Or:

Code:
on *:text:*how are you*:#: { }


You can change the wildcards any way you want to get the results you are looking for.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
As to wildcards, while the * is the most commonly used wildcard, it isn't the only one.
* -> Matches any number of parameters supplied.
& -> Matches any one word.
? -> Matches any one character.

Joined: Mar 2011
Posts: 8
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2011
Posts: 8
Brilliant!!!! smile That's helped me out so much... I can guarantee another noob will come this thread and be greatful too.

With regards to the wildcards you mentioned -
& -> Matches any one word.
? -> Matches any one character.

What use do these have? I can only picture the format *how are you* being of any real use?

Also is there any limits to amount of wildcards/responses you can use? What happens if they conflict? I think Mirc posts both responses, right?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I have used these other wildcards on a bot, using, for example, the question Are you Male or Female? Please enter M or F.
Then I would use something like
Code:
ON *:TEXT:?:?:{
  if $istok(M F,$1,32) {
    set $+(%,gender,$nick) $1
  }
}

In this way, if they enter more than a single character, the matchtext section of the ON TEXT event will not match.

Similarily I could use
Code:
ON *:TEXT:&:?:{
  if $istok(M Male F Female,$1,32) {
    set $+(%,gender,$nick) $1
  }
}
allowing for the single character M or F, as well as the full word Male or Female.

Note that the last ? in each of the ON TEXT events I've shown is to restrict the responses to PM/query only.

Last edited by RusselB; 29/03/11 09:38 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
One of the benefits of using & is when you need a specific number of words for a trigger (no more and no less). Using matchtext of !ban & for example would require that the person include a nick/address or at least *something* after !ban because that would be required. It would also prevent someone entering too many words if you don't want to handle more words.

Using the ? wildcard is not necessarily as helpful in most situations, but it can still be useful. For example, if your trigger was !gray, you might want to also allow for the alternate spelling of !grey. For that, you could use !gr?y as the trigger.

There can be any number of uses for either wildcard. You'll know them when they come up. If * works fine for what you need, then that's all you need to use. If you get to a point where you need more control, then the other wildcards may be useful for you. And, if you need even finer control, there is always regex. laugh


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2011
Posts: 8
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2011
Posts: 8
I understand now... So basically the * wildcard is for everything but if your getting really complex you have the option of replacing any character / word.. this would be handy if your getting really complex...

So how do you setup random replies? I can give back exact replies now but I could say give back to the message -

"how are you" -->> I say "Hey"

I don't have the option of mixing up the responses, but it'd be better if it were like -

"how are you" --->> I say "Hey" or "Hello" or "Ohh Hi!"

I just have one single response, is there a way round this or is this an instance when you go learn regex?

Thanks so much again guys!

Last edited by byrne1916; 30/03/11 08:22 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Depending on the number of responses you want, there are a couple of ways to do this. For only a few different responses, you can do:

Code:
var %responses = response number 1|response number 2|response number 3
msg $nick $gettok(%responses,$r(1,$numtok(%responses,124)),124)


You fill the variable with all of your responses. Separate the responses with a character you won't have in the responses. I just used |, but you can use almost anything you want as long as it's not going to be in the responses.

Then, the message line does the follow. It will choose a random numer ($r) from 1 to the total number of tokens (responses) in the variable ($numtok to get total tokens). It will then display the response token that matches that random number ($gettok gets the token). And 124 is the $chr() value for the | character... so if you use another character, you would change that value to match.

Useful info:
/help $gettok
/help $numtok
/help $rand

* $r is shorthand for $rand


If you have a large number of different responses, then you would be better off using a text file. Fill the text file with responses (one response per line). Then, use:

Code:
msg $nick $read(responses.txt,nt)


That will $read a random line from a text file named responses.txt.

Of course, you can use the text file for few responses or the variable for many if you want. smile


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2011
Posts: 8
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2011
Posts: 8
I've come back to making my varied responses again....

Now here's the script I have but it doesn't seem to work for me??


var %responses = Ooohh hi | howdy! |
on *:TEXT:*how are you*:?:msg $nick $gettok(%responses,$r(1,$numtok(%responses,2)),2)

To me this looks right!?

Ooh and I've been trying for the last hour to reply using a text file also but for the life of me I can't figure out how to upload a text file inside of Mirc. I did alot of forum searching and googling too.

Thanks in advance!!


P.S I think I throw the responses inside of Mirc Programe files??

Last edited by byrne1916; 06/04/11 10:35 PM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
One problem that I see with that code, is the fact that you are trying to use the equivalent of $chr(2) for your token separator. In mIRC, $chr(2) is the character to start/end bolding.

Since you already use the | character, I'd suggest getting the ascii value for that character and using it. I suspect that this is the equivalent of $chr(124). You can determine what the ascii value is by using //echo -a $asc(|)

You also have the setting for the variable in the wrong location.
Here's a little re-write of your current code with my suggestions in place.
Code:
on *:TEXT:*how are you*:?:{
  var %responses = Ooohh hi | howdy!
  .msg $nick $gettok(%responses,$r(1,$numtok(%responses,124)),124)
}



As to using a text file, I suggest you follow these instructions the first time. After that some of them you can bypass as the information will not change.

1) Type //echo -a $mircdir
2) Note the directory path and drive letter that is returned.
3) Open a text editor (Notepad is a good one for a beginner, and it comes with Windows)
4) Create your file in the text editor.
4a) For this situation, I suggest putting one response per line.
5) Save the file in the previously noted directory using File -> Save As.
5a) Recommend you use a .txt file extension, which is the default for Notepad.
6) Here's a suggested re-write of your code using a text file.
Code:
on *:text:*how are you*:?: .msg $nick $read(responses.txt)

Note that I used a filename of responses.txt. There is nothing that says you have to use this.

Joined: Mar 2011
Posts: 8
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Mar 2011
Posts: 8
Well.. thank you very much!!

I'm going to try that now, you've made it really simple to understand so I shouldn't have any problems grin

I have to say the support on this forum is top notch!
It's very much appreciated by me...

Thanks again,
Gilesy


Link Copied to Clipboard