mIRC Home    About    Download    Register    News    Help

Print Thread
#205229 17/10/08 07:05 PM
Joined: Oct 2007
Posts: 7
N
Nemmet Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
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
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
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
Code:
msg $chan $nick $+ , blah blah blah.


to

Code:
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
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
Just use this then:


Code:
on *:TEXT:*:#: { msg # $+(<,$nick,>) $1- }


Cheers,

Jay

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
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
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
Ok, so both options here:

Code:

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
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Buggs2008, your code won't work. Did you test it before posting?

However, this will work:

Code:
on *:TEXT:*:#: { if (blah isin $1-) { msg $chan $+(<,$nick,>) $str(blah $chr(32),3) } } 

Joined: Oct 2007
Posts: 7
N
Nemmet Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
N
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
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,193
Code:
on *:text:$(* $me *):#:msg $chan $replace($1-,$me,$nick)


not tested but should works

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Code:
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
H
Hoopy frood
Offline
Hoopy frood
H
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
W
Hoopy frood
Offline
Hoopy frood
W
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
H
Hoopy frood
Offline
Hoopy frood
H
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 ... whistle

Nemmet, try this one after all:
Code:
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
W
Hoopy frood
Offline
Hoopy frood
W
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

Link Copied to Clipboard