mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Feb 2006
Posts: 307
N
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

Joined: Oct 2004
Posts: 8,330
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
Joined: Feb 2006
Posts: 307
N
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

Joined: Oct 2004
Posts: 8,330
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
Joined: Feb 2006
Posts: 307
N
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

Joined: Aug 2004
Posts: 7,252
R
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)
    }
  }
}


Joined: Feb 2006
Posts: 307
N
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

Joined: Aug 2004
Posts: 7,252
R
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.

Joined: Feb 2006
Posts: 307
N
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

Joined: Aug 2004
Posts: 7,252
R
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-) {


Joined: Feb 2006
Posts: 307
N
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

Joined: Aug 2004
Posts: 7,252
R
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.

Joined: Feb 2006
Posts: 307
N
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?

Joined: Aug 2004
Posts: 7,252
R
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)


Joined: Feb 2006
Posts: 307
N
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.
Joined: Aug 2004
Posts: 7,252
R
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.

Joined: Feb 2006
Posts: 307
N
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

Joined: Oct 2006
Posts: 82
B
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!!
Joined: Feb 2006
Posts: 307
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Feb 2006
Posts: 307
msg $chan?

what are you talking about?

Joined: Sep 2005
Posts: 2,881
H
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

Link Copied to Clipboard