mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
make autoreply to work only once or twice #173978 01/04/07 02:37 PM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
hello

I have this script

on *:text:hi:?: .timer 1 3 msg $nick hello!

but I want to make it not to work for the same nick for more than 1-2 times

I mean if someone pastes hi for multiple times, I dont want to reply all the times, just the first

is it possible?

thanks

Re: make autoreply to work only once or twice [Re: nataliad] #173980 01/04/07 02:45 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
on *:text:hi:?: {
  inc -u600 %autohi. $+ $nick
  if ($($+(%,autohi.,$nick),2) < 3) { .timer 1 3 msg $nick hello! }
}


That will allow it to reply only 2 times to the word "hi" from the same nick within 10 minutes. Note that the 10 minute timer restarts if the nick says "hi" again. So if someone says "hi" every 5 minutes for an hour, you'd only auto-reply 2 times to that person. If someone says "hi" twice, then says "hi" again 15 minutes after the last "hi" by that person, then you'll auto-reply again.

I'm not sure I explained that well, so if you don't understand what I mean, let me know.


Invision Support
#Invision on irc.irchighway.net
Re: make autoreply to work only once or twice [Re: Riamus2] #175456 22/04/07 11:28 PM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
thanks

what if I have many such scripts?

I will just add to each of them this:

Code:
inc -u600 %autohi. $+ $nick | if ($($+(%,autohi.,$nick),2) < 3)


or I need anything more?

thanks

Re: make autoreply to work only once or twice [Re: nataliad] #175462 23/04/07 01:15 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Just replace the 2 occurences of "autohi" with some other name (different for every script).


Invision Support
#Invision on irc.irchighway.net
Re: make autoreply to work only once or twice [Re: Riamus2] #175553 24/04/07 10:16 PM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
mmm

is there a way to make it all one script?

and make a list like:

Code:
hi - hello!
how are you? - fine, thanks!
etc


the script will recognize everytime text of the left list is mentioned and it will respond the appropriate of the right list

Re: make autoreply to work only once or twice [Re: nataliad] #175557 25/04/07 12:15 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Conditional that you can guarantee that the - is used to separate the two "sides", and only in that location, then yes it can.
Code:
on *:text:*:?: {
  if $read(Hi.txt,w,$+($1-,*)) {
    inc -u600 %autohi. $+ $nick
    if ($($+(%,autohi.,$nick),2) < 3) {
      .timer 1 3 msg $nick !$gettok($read(Hi.txt,$readn),-1,45)
    }
  }
}


Re: make autoreply to work only once or twice [Re: RusselB] #175559 25/04/07 12:52 AM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
mmm ok

but will it support wildcards/regex in the hi.txt list?

eg
Code:
hi* - hello!

that will match
Code:
hi!
hi,

etc

Re: make autoreply to work only once or twice [Re: nataliad] #175564 25/04/07 02:07 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The search uses a wildcard match, so that it looks for the text that is entered followed by any other text.

The * for the wildcard match isn't required, as I have it included in the code.

Re: make autoreply to work only once or twice [Re: RusselB] #175582 25/04/07 03:54 PM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
mmm

I want the script not to add wildcards by its own

I want to determine on my own the appropriate wildcards

eg

Code:
hi
* hi*
hi?
* hi! *
etc

Re: make autoreply to work only once or twice [Re: nataliad] #175593 25/04/07 06:05 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Change
Code:
if $read(Hi.txt,w,$+($1-,*)) {
to
Code:
if $read(Hi.txt,w,$1-) {


Re: make autoreply to work only once or twice [Re: RusselB] #175606 25/04/07 09:28 PM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
thanks

how to I write in the Hi.txt this:

hi! - hello! <newline> How are you?

in other words, to respond two sentences instead of one

thanks

Re: make autoreply to work only once or twice [Re: nataliad] #175611 25/04/07 10:23 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Just use notepad, and remember to save the file to your mIRC directory.

Re: make autoreply to work only once or twice [Re: RusselB] #175617 25/04/07 10:59 PM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
ummm

I think I wasnt clear

I mean to respond to:

Code:
hi


with:

Code:
hello!
how are you?


how will I write this in the Hi.txt file?

Re: make autoreply to work only once or twice [Re: nataliad] #175622 25/04/07 11:44 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Ooops..sorry..I think you would enter it in the text file like this
Quote:
hi-hello! | how are you?


also, add the p switch to the w in the $read line(s)


Re: make autoreply to work only once or twice [Re: RusselB] #175688 26/04/07 11:39 PM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
thanks!

Originally Posted By: RusselB

also, add the p switch to the w in the $read line(s)


mm can you tell me how the script will be please?

1) how can I have the text of Hi.txt inside the remote.ini?
2) how can I make it not to msg the same ip for more than 2 times (while now it wont msg the same nick for two times) ?

Last edited by nataliad; 27/04/07 12:27 AM.
Re: make autoreply to work only once or twice [Re: nataliad] #175693 27/04/07 01:31 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1) You can't. They are two different files.
2) Unless you have IRCops status, you can't be guaranteed of being able to get a person's IP address, so I don't recommend this.
3) Please read the New to the forums sticky, specifically the section that says
Quote:
e) Realize YOU have to do work to solve the problem you are having. People here can offer ideas/suggestions/input and maybe even solve things entirely, but it's up to YOU to do the work.


Taking what we've already given you, and combining it with some reading of the help file, should be more than sufficient to get you the code.

Re: make autoreply to work only once or twice [Re: RusselB] #175695 27/04/07 01:38 AM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
thanks
the two read lines are these:

if $read(Hi.txt,w,$+($1-,*)) {
.timer 1 3 msg $nick !$gettok($read(Hi.txt,$readn),-1,45)

but how do I add the p switch?

as for the ip, I know the ips, so can you tell me the script with ips please

thank you

Re: make autoreply to work only once or twice [Re: nataliad] #175795 28/04/07 03:15 PM
Joined: Oct 2006
Posts: 82
B
BritishGent Offline
Babel fish
Offline
Babel fish
B
Joined: Oct 2006
Posts: 82
try this, it might work smile

[code]
on 1:text:hi*:#: {
if ($2 == all) {
msg $chan <all> hi $nick
msg $chan <all> $nick how are you?
halt
}


Never ASSUME!!!

As it often makes and ASS out of U and ME!!
Re: make autoreply to work only once or twice [Re: BritishGent] #175815 29/04/07 02:14 AM
Joined: Feb 2006
Posts: 307
N
nataliad Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
msg $chan?

what are you talking about?

Re: make autoreply to work only once or twice [Re: nataliad] #175823 29/04/07 11:29 AM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Originally Posted By: nataliad
but how do I add the p switch?


You read the help file like Russel suggested. Type /help $read

Page 1 of 2 1 2