Jump to content
chain

prefect relay

Recommended Posts

  • Administrators

This will allow you to relay, or link, if you will, two or more channels across two or more networks.this code only work in
mirc 6.35 with nbs-irc 2.39 version.thanks
then press alt+r
copy this code in remote
and
Documentation at the top of the script.
please pass your comments on my effort.

 

;======================================================
;                   Relay by R3b3|
;======================================================
;
;    This will allow you to relay, or link, if you
; will, two or more channels across two or more 
; networks.
;   
;
; Configuration:
;   Relay.networks, this is a list, seperated by a 
;     space, of all the networks we are going to be 
;     relaying across.
alias -l relay.networks { return HellsWinter NFinate UnderNet }
;
;   Relay.channels, this is a list, seperated by a 
;     space, of the channel names that we are going 
;     to be relaying, the channel names corrispond to 
;     the relay.networks above.
alias -l relay.channels { return #hw-test #nf-test #un-test }
;
;   Relay.fmt.text, this is the format of normal 
;     relayed text.
;     $1  = Nick
;     $2  = Channel
;     $3  = Network
;     $4- = Text
alias -l relay.fmt.text { return $+(<,$1,/,$2,@,$3,>) $4- }
;
;   Relay.fmt.action, this is the format of /me 
;     relayed text.
;     $1  = Nick
;     $2  = Channel
;     $3  = Network
;     $4- = Text
alias -l relay.fmt.action { return * $+($1,/,$2,@,$3,) $4- }
;
;   Relay.fmt.quit, this is the format of relayed
;     quits.
;     $1  = Nick
;     $2  = Channel
;     $3  = Network
;     $4- = Quit Message
;
alias -l relay.fmt.quit { return * $+($1,@,$3) Quit $4- }
;
;   Relay.fmt.join, this is the format of relayed 
;     joins.
;     $1  = Nick
;     $2  = Channel
;     $3  = Network
alias -l relay.fmt.join { return * $+($1,@,$3) Joins $2 }
;
;   Relay.fmt.part, this is the format of relayed
;     parts.
;     $1  = Nick
;     $2  = Channel
;     $3  = Network
;     $4- = Part Message (if available)
alias -l relay.fmt.part { return * $+($1,@,$3) Parts $2 ( $+ $4- $+ ) }
;
;   Relay.fmt.kick, this is the format of relayed
;     parts.
;     $1  = Nick
;     $2  = Channel
;     $3  = Network
;     $4  = Kicker
;     $5- = Kick Message
alias -l relay.fmt.kick { return * $+($4,@,$3) Kicks $+($1,@,$3) Out of $2 ( $+ $5- $+ ) }
;
;   Relay.fmt.mode, this is the format of relayed 
;     modes.
;     $1  = Nick
;     $2  = Channel
;     $3  = Network
;     $4- = Modes
alias -l relay.fmt.mode { return * $+($1,@,$3) Sets mode: $4- }
;
;   Relay.fmt.topic, this is the format of relayed 
;     topics.
;     $1  = Nick
;     $2  = Channel
;     $3  = Network
;     $4- = Topic
alias -l relay.fmt.topic { return * $+($1,@,$3) Sets topic: $4- }
;
;
; Examples:
;   alias -l relay.networks { return UnderNet QuakeNet Efnet }
;   alias -l relay.channels { return #mycoolchannel #my.cool.channel #my_cool_channel }
;     This will set up a relay between the following
;       three channels:
;       #mycoolchannel (on undernet)
;       #my.cool.channel (on quakenet)
;       #my_cool_channel (on efnet)
;
;
; Contact:
;   Cobi@winbots.org
;   Cobi on NFinate (irc.nfinate.org, #nfinate)
;   Cobi on Undernet (#phase, #rss, #game-trivia)
;   Cobi on Winbots (#winbots)
;   Cobi-Wan-Kenobi on Quakenet (#icechat)
;   Cobi on SearchIRC Forums
;   Winbots on UnrealIRCd Forums
;   Cobi on mirc.net
;
; ChangeLog:
;   1.0
;     Initial Release.
;
; Source Code:

on *:text:*:#:{ 
  var %tok = $findtok($relay.networks,$network,1,32) 
  if ($chan == $gettok($relay.channels,%tok,32)) { 
    var %lcv = 1 
    var %tot = $gettok($relay.networks,0,32) 
    while (%lcv <= %tot) { 
      var %cid = $cid 
      var %ncid = $getcidfromnet($gettok($relay.networks,%lcv,32)) 
      if (%ncid != %cid) { 
        var %net = $network 
        scid %ncid 
        msg $gettok($relay.channels,%lcv,32) $relay.fmt.text($nick,$chan,%net,$1-) 
        scid %cid 
      } 
      inc %lcv 
    } 
  } 
} 
on *:action:*:#: { 
  var %tok = $findtok($relay.networks,$network,1,32) 
  if ($chan == $gettok($relay.channels,%tok,32)) { 
    var %lcv = 1 
    var %tot = $gettok($relay.networks,0,32) 
    while (%lcv <= %tot) { 
      var %cid = $cid 
      var %ncid = $getcidfromnet($gettok($relay.networks,%lcv,32)) 
      if (%ncid != %cid) { 
        var %net = $network 
        scid %ncid 
        msg $gettok($relay.channels,%lcv,32) $relay.fmt.action($nick,$chan,%net,$1-)
        scid %cid 
      } 
      inc %lcv 
    } 
  } 
} 
on *:quit: { 
  var %tok = $findtok($relay.networks,$network,1,32) 
  if ($nick ison $gettok($relay.channels,%tok,32)) { 
    var %lcv = 1 
    var %tot = $gettok($relay.networks,0,32) 
    while (%lcv <= %tot) { 
      var %cid = $cid 
      var %ncid = $getcidfromnet($gettok($relay.networks,%lcv,32)) 
      if (%ncid != %cid) { 
        var %net = $network 
        scid %ncid 
        msg $gettok($relay.channels,%lcv,32) $relay.fmt.quit($nick,$gettok($relay.channels,%tok,32),%net,$1-)
        scid %cid 
      } 
      inc %lcv 
    } 
  } 
} 
on *:join:#: { 
  if ($nick != $me) { 
    var %tok = $findtok($relay.networks,$network,1,32) 
    if ($chan == $gettok($relay.channels,%tok,32)) { 
      var %lcv = 1 
      var %tot = $gettok($relay.networks,0,32) 
      while (%lcv <= %tot) { 
        var %cid = $cid 
        var %ncid = $getcidfromnet($gettok($relay.networks,%lcv,32)) 
        if (%ncid != %cid) { 
          var %net = $network 
          scid %ncid 
          msg $gettok($relay.channels,%lcv,32) $relay.fmt.join($nick,$chan,%net)
          scid %cid 
        } 
        inc %lcv 
      } 
    } 
  } 
} 
on *:part:#: { 
  if ($nick != $me) { 
    var %tok = $findtok($relay.networks,$network,1,32) 
    if ($chan == $gettok($relay.channels,%tok,32)) { 
      var %lcv = 1 
      var %tot = $gettok($relay.networks,0,32) 
      while (%lcv <= %tot) { 
        var %cid = $cid 
        var %ncid = $getcidfromnet($gettok($relay.networks,%lcv,32)) 
        if (%ncid != %cid) { 
          var %net = $network 
          scid %ncid 
          msg $gettok($relay.channels,%lcv,32) $relay.fmt.part($nick,$chan,%net,$1-) 
          scid %cid 
        } 
        inc %lcv 
      } 
    } 
  } 
} 
on *:KICK:#: { 
  var %tok = $findtok($relay.networks,$network,1,32) 
  if ($chan == $gettok($relay.channels,%tok,32)) { 
    var %lcv = 1 
    var %tot = $gettok($relay.networks,0,32) 
    while (%lcv <= %tot) { 
      var %cid = $cid 
      var %ncid = $getcidfromnet($gettok($relay.networks,%lcv,32)) 
      if (%ncid != %cid) { 
        var %net = $network 
        scid %ncid 
        msg $gettok($relay.channels,%lcv,32) $relay.fmt.kick($knick,$chan,%net,$nick,$1-) 
        scid %cid 
      } 
      inc %lcv 
    } 
  } 
} 
on *:rawmode:#: { 
  var %tok = $findtok($relay.networks,$network,1,32) 
  if ($chan == $gettok($relay.channels,%tok,32)) { 
    var %lcv = 1 
    var %tot = $gettok($relay.networks,0,32) 
    while (%lcv <= %tot) { 
      var %cid = $cid 
      var %ncid = $getcidfromnet($gettok($relay.networks,%lcv,32)) 
      if (%ncid != %cid) { 
        var %net = $network 
        scid %ncid 
        msg $gettok($relay.channels,%lcv,32) $relay.fmt.mode($nick,$chan,%net,$1-)
        scid %cid 
      } 
      inc %lcv 
    } 
  } 
} 
on *:topic:#: { 
  var %tok = $findtok($relay.networks,$network,1,32) 
  if ($chan == $gettok($relay.channels,%tok,32)) { 
    var %lcv = 1 
    var %tot = $gettok($relay.networks,0,32) 
    while (%lcv <= %tot) { 
      var %cid = $cid 
      var %ncid = $getcidfromnet($gettok($relay.networks,%lcv,32)) 
      if (%ncid != %cid) { 
        var %net = $network 
        scid %ncid 
        msg $gettok($relay.channels,%lcv,32) $relay.fmt.topic($nick,$chan,%net,$1-) 
        scid %cid 
      } 
      inc %lcv 
    } 
  } 
} 
alias -l getcidfromnet { 
  var %lcv = 1 
  var %tot = $scon(0) 
  while (%lcv <= %tot) { 
    if ($scon(%lcv).network == $1) { return $scon(%lcv).cid } 
    inc %lcv 
  } 
} 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...