mIRC Home    About    Download    Register    News    Help

Print Thread
#9056 31/01/03 01:00 PM
Joined: Jan 2003
Posts: 9
D
dalbng Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2003
Posts: 9
can someone please give me a simple script that will relay stuff that a certain person said on a certain channel on a certain network, to ANOTHER certain channel on a certain network? grin i need it for my script...

Thanks... you guys rock smile

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Here's the fastest yet self-explanatory code I could think of:
Code:

menu channel {
  Relay channels
  .Start {
    set %rel_net_1 $$?="Enter the first network name"
    set %rel_chan_1 $$?="Enter channel name"
    set %rel_net_2 $$?="Enter the other network name?"
    set %rel_chan_2 $$?="Enter channel name"
    echo -at * Now linking %rel_chan_1 ( $+ %rel_net_1 $+ ) to %rel_chan_2 ( $+ %rel_net_2 $+ ).
  }
  .Stop {
    unset %rel_*_*
    echo -at * No longer linking channels.
  }
}

on *:text:*:%rel_chan_1,%rel_chan_2:{
  ;
  ; The tokenized result will be:
  ;
  ; $1 = target network
  ; $2 = target channel
  ; $3- = text
  ;
  if $network $chan == %rel_net_1 %rel_chan_1 {
    tokenize 32 %rel_net_2 %rel_chan_2 $1-
  }
  else {
    tokenize 32 %rel_net_1 %rel_chan_1 $1-
  }
  ;
  ; /scid -at1 loops through any active connection
  ; to find the target network, then messages the target channel.
  ;
  scid -at1 if $1 == $!network && $!me ison $2 { msg $2 ( $+ $nick $+ @ $+ $network $+ ) $3- }
}

If you want an another example, check this addon.

Joined: Jan 2003
Posts: 9
D
dalbng Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2003
Posts: 9
thanks for the quick reply!

although, i want to relay a CERTAIN NICK, and not a whole channel... you think you can help me with that?

thanks again! cool

Joined: Jan 2003
Posts: 9
D
dalbng Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2003
Posts: 9
and another thing...

your script makes relays from one network to another, and vice versa...

can you adjust it so that ONLY the messages from the FIRST network are sent to the second one, and messages from the second will NOT be sent to the first?

thanks for the help...

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Hi, apologizes for the late reply. of course it's possible
Code:

menu nicklist {
  Relay
  .Start {
    set %source_nick $1
    set %source_chan #
    set %source_net $network
    set %target_net $$?="Target network?"
    set %target_chan $$?="Target channel?"
  }
  .Stop { unset %source_* %target_* }
}
On *:text:*:%source_chan:{
  if $nick == %source_nick && $network == %source_net {
    scon -at1 if $!network == %target_net && $!me ison %target_chan { msg %target_chan $+(<,$nick,@,$network,>) $1- }
  }
}

Joined: Jan 2003
Posts: 9
D
dalbng Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
D
Joined: Jan 2003
Posts: 9
Works great! THANKS!

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
you're welcome smile


Link Copied to Clipboard