mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Hello,

I need to be able to echo certain commands from one channel to another. How can I do this?

Thanks in advance.

Joined: Jan 2004
Posts: 26
M
Ameglian cow
Offline
Ameglian cow
M
Joined: Jan 2004
Posts: 26
What do you mean by commands? Be specific please.


It's not in the GUI, it's in the source.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
depends on what commands.. but an example:
Code:
on 1:OP:*: { echo $active $nick got op from $opnick in $chan }

$active is the channel that you have active.. change that to #channel if you only want it to be echoed to 1 channel.. $chan is the channel where the op took place..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Sorry, let me explain a bit better smile

Let's say there is a chat going on in channel #a:

<jon>hello
<bob>hello
<jon>hows it going?
<bob>good
<jon> nice to hear from you

I want to echo everything jon says to channel #b:

<bot>hello
<bot>hows it going?
<bot> nice to hear from you

Or echo only certain things that Jon says, maybe with additional text in channel #b.

Thanks for the replys smile

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
sparta, where would I put that to use that script? in scripts?

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
 
on *:text:*:#a: {
  var %text = $1-
  tokenize 32 $strip($1-)
  if ($nick == jon) {
    ;msg #b %text | halt
    ;^ remarked out as you want only selected statments (see below)
    if (hello* iswm $1-) { msg #b %text | halt }
    if (how* iswm $1-) { msg #b %text | halt }
    if (*bowlingball* iswm $1-) { msg #b %text | halt }
  }
}
 

i store the original text in %text as it might have colors in it, then strip the colors and tokenize it into $1- as this also removes multiple spaces, this makes ISWM matching real easy.

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Thanks for this smile

I will try it out. I take it I should put it in the scripts box in Mirc?

Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
Quote:

DaveC:
i store the original text in %text as it might have colors in it, then strip the colors and tokenize it into $1- as this also removes multiple spaces, this makes ISWM matching real easy.



Actually the spaces are stripped already in the %text variable as $1- strips them.


Code:
//if ( khaled isgod ) echo yes | else echo no
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Press ALT + R in mirc, then paste it there


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Great!
Thanks for the help guys smile

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
It does work perfectly, however I have discovered one little thing about it actually.

It doesn't echo across networks. I have multiple networks open in Mirc, if I wanted to echo from channel #a on efnet to channel #b on linknet, how could I do this?

Thanks so much smile

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
no there not thats the whole reason i said it.

If you have one space colored blue and follwoing that one space colored red, the strip well remove the colors and leave two spaces, if however you happen to be striping colors from the mirc control panel options (options/irc/messages) then the colors have been prestriped and the two spaces wont be there only one, this is exactly what happened to me, i prestrip colors and one day i turned them on, and one of my matching scripts stop working. the resulting text now had 2 spaces not one in it

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Hi Dave,
Could you help changing the script so that echo's from a channel on one network to a channel on another network please?

Thanks laugh

Joined: Jan 2003
Posts: 46
D
DJSi Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jan 2003
Posts: 46
Can anyone help please?


Link Copied to Clipboard