|
Joined: Oct 2007
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Oct 2007
Posts: 7 |
I want a script that, whenever someone says, for example:
nemmet blah blah blah
I want to immediately respond to it with
<that person's username> blah blah blah
The same message but with the other person's name replaced with mine.
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
on *:TEXT:$($+(*,$nick,*)):#: {
if ($regex($1-,(blah blah blah))) {
msg $chan $nick $+ , blah blah blah.
}
} If you want to basically repeat what that person says without his or her nickname shown, do this: Change msg $chan $nick $+ , blah blah blah. to msg $chan blah blah blah. Note: It will only trigger when that person types more than three blahs. You'll just repeat three unless you edit it to saying more.
|
|
|
|
Joined: Oct 2007
Posts: 214
Fjord artisan
|
Fjord artisan
Joined: Oct 2007
Posts: 214 |
Just use this then:
on *:TEXT:*:#: { msg # $+(<,$nick,>) $1- }
Cheers, Jay
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
Buggs2008, your code will repeat everything a person has to say. It will be as annoying as spamming.
|
|
|
|
Joined: Oct 2007
Posts: 214
Fjord artisan
|
Fjord artisan
Joined: Oct 2007
Posts: 214 |
Ok, so both options here:
on *:TEXT:*:#: {
if (bla bla bla isin $1-) { msg # $+(<,$nick,>) $1- }
elseif ($1- == bla bla bla) { msg # $+(<,$nick,>) $1- }
}
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
Buggs2008, your code won't work. Did you test it before posting? However, this will work: on *:TEXT:*:#: { if (blah isin $1-) { msg $chan $+(<,$nick,>) $str(blah $chr(32),3) } }
|
|
|
|
Joined: Oct 2007
Posts: 7
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Oct 2007
Posts: 7 |
Ok, I think I've been misunderstood
I want a script that can do this:
<person1> Hey person2 <person2> Hey person1
<person1> Boy, I've never met someone like person2 <person2> Boy, I've never met someone like person1
No matter what the message is, if my username is included, I want to repeat the message but with their name replacing mine.
Odd request, but it is needed.
|
|
|
|
Joined: Jul 2006
Posts: 4,193
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,193 |
on *:text:$(* $me *):#:msg $chan $replace($1-,$me,$nick) not tested but should works
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
on *:text:*:#YOURCHAN: {
if ($findtok($1-,$me,32)) { msg $chan $puttok($1-,$nick,$v1,32) }
} $me could be replaced with a 3rd persons nick, this is the word to be replaced with the nick that sent the triggering messagge.
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
I suppose you meant matchtext $($+(*,$me,*)) to make a wildcard-matching $replace ? Else $(* $me *) wouldnt match if $me is e.g. the last token.
Last edited by Horstl; 17/10/08 11:28 PM.
|
|
|
|
Joined: Jul 2006
Posts: 4,193
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,193 |
Yep, but $($+(*,$me,*)) will match when $me is stick to text, and it could not be the desired effect..., $istok is better in this case.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Nov 2006
Posts: 1,559
Hoopy frood
|
Hoopy frood
Joined: Nov 2006
Posts: 1,559 |
Hum, another flaw of the code I gave myself is that it would replace only the first occurance of $me ... Nemmet, try this one after all: on *:text:*:#YOURCHAN: {
if ($istok($1-,$me,32)) { msg $chan $reptok($1-,$me,$nick,0,32) }
} This will message back, replacing all "by word" occurances of your nick.
|
|
|
|
Joined: Jul 2006
Posts: 4,193
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,193 |
Yeah, that why you're findtok was just longer than an istok :p the 0 parameter in $***tok identifiers is really a good thing. Also, a $strip could be added in the istok
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
|