mIRC Home    About    Download    Register    News    Help

Print Thread
#166354 09/12/06 08:35 PM
Joined: Dec 2005
Posts: 54
B
Bundy Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Dec 2005
Posts: 54
on 1:TEXT:*hi, how are you doing*:#coast:/msg =Cow 1 | /msg =Cow 2 | /msg =Cow 3 | /msg =Cow 4

----

This gets triggerd when someone says 'hi, how are you doing' in channel #coast. Then reply to the nick 'Cow', in the already existing DCC window.

What can I change, so that if I don't have a DCC going with that nick it will not try to send something to the nick.

Thanx!

Joined: Mar 2003
Posts: 612
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
Code:
on 1:TEXT:*hi, how are you doing*:#coast:{
  if $chat($nick,1) {
    /msg =Cow 1 | /msg =Cow 2 | /msg =Cow 3 | /msg =Cow 4
  }
}

btk


billythekid
Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
...
if $chat($nick) { msg $nick asdf }
...

/help $chat

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
not $chat($nick) but $chat(COW)...

on 1:TEXT:*hi, how are you doing*:#coast:{ if ($chat(COW)) { msg =Cow 1 | msg =Cow 2 | msg =Cow 3 | msg =Cow 4 } }

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
I just assumed he would substitute his own nicks since those seemed like "fake" ones so to speak.

Joined: Dec 2005
Posts: 54
B
Bundy Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Dec 2005
Posts: 54
Thanx for ALL the help, its gr8ly appreciated!

Another thing: I want that string to trigger when a spesific nick (Merdock) says my nick.

How would I be able to do that? Maybe like this?

on 1:TEXT:Merdock:*$me*:#coast: etc... (I'm not sure if the mask (regards to $me - spaces, or no spaces?) is done correctly, and positioning of Merdock.)

Thanx again!

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Code:
on *:text:* $+ $me $+ *:#coast: {
  if ($nick == Merdock) {
    do whatever you want here
  }
}


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2005
Posts: 54
B
Bundy Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Dec 2005
Posts: 54
Is this correct then:

Code:
on *:text:* $+ $me $+ *:#coast: {
  if ($nick == Merdock) 
  if ($chat(Merdock)) {
    msg =Merdock 1 | msg =Merdock 2 | msg =Merdock 3 | msg =Merdock 4 }
}

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Close.

Code:
on *:text:* $+ $me $+ *:#coast: {
  if ($nick == Merdock) {
    if ($chat(Merdock)) {
      msg =Merdock 1 | msg =Merdock 2 | msg =Merdock 3 | msg =Merdock 4 }
  }
}


I'm curious, though... are you really meaning to check if a person types in a channel, then if they do, you're going to automatically type something in a chat window to them? That seems strange to me.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
don't forget $() in the matchtext:

Code:
on *:text:$($+(*,$me,*)):#coast:{


if you want $me evaluated whistle


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Heh. I so rarely use identifiers there that I forget if it needs evaluated or not.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2005
Posts: 54
B
Bundy Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Dec 2005
Posts: 54
Am I correct in saying, after all is said and done, this is the final code.

Code:
on *:text:$($+(*,$me,*)):#coast:{
  if ($nick == Merdock) {
    if ($chat(Merdock)) {
      msg =Merdock 1 | msg =Merdock 2 | msg =Merdock 3 | msg =Merdock 4 }
  }
}


It's part of a game I'm working on Riamus2 - still learning to code as I go along. Many thanx for the help!

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yes, it is.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard