|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
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
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
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
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
thanks what if I have many such scripts? I will just add to each of them this:
inc -u600 %autohi. $+ $nick | if ($($+(%,autohi.,$nick),2) < 3)
or I need anything more? thanks
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
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
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
mmm is there a way to make it all one script? and make a list like: 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
Hoopy frood
|
Hoopy frood
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. 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
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
mmm ok but will it support wildcards/regex in the hi.txt list? eg that will match etc
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
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
Fjord artisan
|
OP
Fjord artisan
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
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Change if $read(Hi.txt,w,$+($1-,*)) { to
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
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
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Just use notepad, and remember to save the file to your mIRC directory.
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
ummm I think I wasnt clear I mean to respond to: with: how will I write this in the Hi.txt file?
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Ooops..sorry..I think you would enter it in the text file like this also, add the p switch to the w in the $read line(s)
|
|
|
|
Joined: Feb 2006
Posts: 307
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
thanks! 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
Hoopy frood
|
Hoopy frood
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 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
Fjord artisan
|
OP
Fjord artisan
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
Babel fish
|
Babel fish
Joined: Oct 2006
Posts: 82 |
try this, it might work [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
Fjord artisan
|
OP
Fjord artisan
Joined: Feb 2006
Posts: 307 |
msg $chan?
what are you talking about?
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
but how do I add the p switch? You read the help file like Russel suggested. Type /help $read
|
|
|
|
|