Multi-Network Channel Linker Bot

By PurplesurgeMirc on May 20, 2009

This requires that the user saying !link or !delink is on the User List as level "Linker".
It's pretty self-explanatory, and the format of the !link command is a comment on the first 'on text' script.

Note: This script CAN and WILL get spammy if used to link large channels together and I'm not liable for anyone using this getting network banned for spamming. It is a script meant for smaller rooms with both owners consent.

It can link at most 2 channels on 2 different networks, though can be expanded fairly easily if one understands the script.

Author: Rolo @ #mIRC on Purplesurge

#link on
on *:connect:set % [ $+ [ $network ] $+ [ .cid ] ] $cid

on Linker:text:!link & &:#: {
  ; !link network channel
  if ($$2 == $network) {
    unset %Network*
    set %Chan1 $chan
    if ($me !ison $$3) join $$3
    set %Chan2 $$3
  }
  else {
    var %networkcheck 1
    :netcheck
    if ($scon(%networkcheck).network == $$2) {
      set %Network1 $network
      set %Network2 $$2
    }
    else {
      inc %networkcheck
      goto netcheck
    }
    set %Chan1 $chan
    if ($me !ison $$3) scid % [ $+ [ $$2 ] $+ [ .cid ] ] join $$3
    set %Chan2 $$3
  }
}

on Linker:text:!delink:#: unset %Chan* %Network*

on *:text:*:#:{
  if (!%Network1) {
    if ($chan == %Chan1) .msg %Chan2 $chan $+(<,$nick,>) $remove($1-,$chr(36),$chr(37))
    if ($chan == %Chan2) .msg %Chan1 $chan $+(<,$nick,>) $remove($1-,$chr(36),$chr(37))
  }
  else {
    if ($chan == %Chan1) && ($network != %Network2) scid % [ $+ [ %Network2 ] $+ [ .cid ] ] .msg %Chan2 $chan $+(<,$nick,>) $remove($1-,$chr(36),$chr(37))
    elseif ($chan == %Chan2) && ($network != %Network1) scid % [ $+ [ %Network1 ] $+ [ .cid ] ] .msg %Chan1 $chan $+(<,$nick,>) $remove($1-,$chr(36),$chr(37))
  }
}

on *:join:#:{
  if (!%Network1) {
    if ($chan == %Chan1) .msg %Chan2 $chan * $nick has joined ( $+ $remove($address($nick,0),*!) $+ )
    if ($chan == %Chan2) .msg %Chan1 $chan * $nick has joined ( $+ $remove($address($nick,0),*!) $+ )
  }
  else {
    if ($chan == %Chan1) && ($network != %Network2) scid % [ $+ [ %Network2 ] $+ [ .cid ] ] .msg %Chan2 $chan * $nick has joined ( $+ $remove($address($nick,0),*!) $+ )
    elseif ($chan == %Chan2) && ($network != %Network1) scid % [ $+ [ %Network1 ] $+ [ .cid ] ] .msg %Chan1 $chan * $nick has joined ( $+ $remove($address($nick,0),*!) $+ )
  }
}

on *:part:#:{
  if (!%Network1) {
    if ($chan == %Chan1) .msg %Chan2 $chan * $nick has parted ( $+ $remove($address($nick,0),*!) $+ )
    if ($chan == %Chan2) .msg %Chan1 $chan * $nick has parted ( $+ $remove($address($nick,0),*!) $+ )
  }
  else {
    if ($chan == %Chan1) && ($network != %Network2) scid % [ $+ [ %Network2 ] $+ [ .cid ] ] .msg %Chan2 $chan * $nick has parted ( $+ $remove($address($nick,0),*!) $+ )
    elseif ($chan == %Chan2) && ($network != %Network1) scid % [ $+ [ %Network1 ] $+ [ .cid ] ] .msg %Chan1 $chan * $nick has parted ( $+ $remove($address($nick,0),*!) $+ )
  }
}

on *:rawmode:#:{
  if (!%Network1) {
    if ($chan == %Chan1) .msg %Chan2 $chan * $nick sets mode: $1-
    if ($chan == %Chan2) .msg %Chan1 $chan * $nick sets mode: $1-
  }
  else {
    if ($chan == %Chan1) && ($network != %Network2) scid % [ $+ [ %Network2 ] $+ [ .cid ] ] .msg %Chan2 $chan * $nick sets mode: $1-
    elseif ($chan == %Chan2) && ($network != %Network1) scid % [ $+ [ %Network1 ] $+ [ .cid ] ] .msg %Chan1 $chan * $nick sets mode: $1-
  }
}

on *:action:*:#:{
  if (!%Network1) {
    if ($chan == %Chan1) .msg %Chan2 $chan 6* $nick $remove($1-,$chr(36),$chr(37))
    if ($chan == %Chan2) .msg %Chan1 $chan 6* $nick $remove($1-,$chr(36),$chr(37))
  }
  else {
    if ($chan == %Chan1) && ($network != %Network2) scid % [ $+ [ %Network2 ] $+ [ .cid ] ] .msg %Chan2 $chan 6* $nick $remove($1-,$chr(36),$chr(37))
    elseif ($chan == %Chan2) && ($network != %Network1) scid % [ $+ [ %Network1 ] $+ [ .cid ] ] .msg %Chan1 $chan 6* $nick $remove($1-,$chr(36),$chr(37))
  }
}
#link end

Comments

Sign in to comment.
JDavis   -  May 11, 2010

how to avoid getting banned by networks that don't wanna connect together?? ie: irc.nodrama-irc.net link to irc.abjects.net.

*** You are banned from NoIdeaIRC (Spamming lame network)

was on a proxy thank god!! lmao

 Respond  
iamalion   -  May 10, 2010

woo thanks, worked perfectly

 Respond  
bunnykilla   -  Jan 31, 2010

hao2setlinker

 Respond  
Xaric   -  Jul 29, 2009

update for 6.35..It hangs on linking.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.