Multi-Server Channel Relay Script

By PuNkTuReD on Feb 22, 2009

Multi-Server Channel Relay Script

add to your remotes
set your channel by right clicking and going to "Set Relay Channel"
Events Supported:
on text
on action
on part
on quit
on kick
on nick

Modes Supported:
q,e,a,o,h,v,b (it uses rawmode so it should relay all mode changes)

menu * { 
  Set Relay Channel:set %rchan $$?="Channel name: example: #Help" 
}
on *:text:*:%rchan:relayevent $iif($network = $null,Unknown-Network,$v1) $+($chr(60),$nick,$chr(62)) $1-
on *:action:*:%rchan:relayevent $iif($network = $null,Unknown-Network,$v1) $+($chr(60),$nick) $1-
on *:join:%rchan:relayevent $iif($network = $null,Unknown-Network,$v1) $nick joined #
on *:part:%rchan:relayevent $iif($network = $null,Unknown-Network,$v1) $nick parted #
on *:rawmode:%rchan:relayevent $iif($network = $null,Unknown-Network,$v1) $nick sets mode(s) $1 on $2-
on *:kick:%rchan:relayevent $iif($network = $null,Unknown-Network,$v1) $nick kicked $knick from #
on *:quit: {
  var %a = $comchan($nick,0)
  while %a {
    if ($comchan($nick,%a) == %rchan) { relayevent $iif($network = $null,Unknown-Network,$v1) $nick quit: $iif($1-,$v1,No Quit Message) | dec %a }
    else dec %a
} }
on *:nick: {
  var %a = $comchan($newnick,0)
  while (%a) {
    if ($comchan($newnick,%a) == %rchan) { relayevent $iif($network == $null,Unknown-Network,$v1) $nick is now known as $newnick | dec %a }
    else { dec %a }
} }
alias relayevent {
  var %a = $scon(0)
  while %a {
    if ($scon(%a).network == $1) dec %a
    else { scon %a msg %rchan $+(.:,$remove($$2,$chr(60),$chr(62)),@,$1,:.) $remove($3-,$chr(36)) | dec %a }
  }
}

Comments

Sign in to comment.
Known   -  Apr 23, 2013

Sorry for basically grave digging this snippet, but it seems that when the user puts in too many characters it'll make the bot just say something with the relay prefix. A short example is like:

<Known> Hellooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

Then on the other end (the bot's relay):

<Bot> .:Known@Network:. Hellooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
<Bot> ooooooooooooooooooooooo

I'm not sure exactly how to fix this, so I thought I might as well ask the creator (or anyone who is able to fix this problem.

Otherwise it's an amazing snippet!

fluentmsl  -  Apr 24, 2013

Depends what the maximum count of characters per sentence the server allows. If it's too many, the server will break it down.
So it's not the bot, it's the server.

Known  -  Apr 28, 2013

Is there anyway to limit the amount of characters in one message and then send the rest into another one? I have no clue to do this in mIRC :/

Sign in to comment

Pangaea   -  Oct 10, 2011

Well i just tried this out today.. wonderful script,, works flawlessly, easy to strip out stuff and tweak it too.

just one thing tho...
"PuNkTuReD - May 09, 2009 : this is only a one channel one, but ill work on a multi channel one for ya m8."
did you perhaps make any progress with that? :D
this would script would increase its usefulness tenfold if it was able to link chans of different names.

putting all that aside, its still the best mutli server chan relay ive tested. well done :)

 Respond  
BigSteve   -  Jun 03, 2011

k Punky you got msn ? would be so much easier to speak there

 Respond  
PuNkTuReD   -  Jun 03, 2011

on this line

    else { scon %a msg %rchan $+(.:,$remove($$2,$chr(60),$chr(62)),@,$1,:.) $remove($3-,$chr(36)) | dec %a }

remove the @,$1

 Respond  
BigSteve   -  Apr 09, 2011

how would I get this script not saying the $network name ?

 Respond  
Korvin   -  Mar 02, 2010

yeah it shouldnt unless it is the same command or halts other commands

 Respond  
StonaJakey   -  Mar 02, 2010

even if i have multiple scripts loaded? so next time i start it will load all scripts?
and creating a new one doesnt stop the others from working? sorry for all the n00b questions.

Thanks a bunch korvin. hope my scripts run faster now :D

 Respond  
Korvin   -  Mar 02, 2010

yes it auto loads.

 Respond  
StonaJakey   -  Mar 02, 2010

i have a kinda n00b question. when i put scripts in a new remote, does it auto load them every time i open mIRC? or do i have to load it every time? oh, or maybe a script to load my scripts ? :P

 Respond  
Korvin   -  Mar 02, 2010

ahh, so youre transferring all text from both one chan to all the others and vice versa?

 Respond  
PuNkTuReD   -  Mar 02, 2010

did you put it in a new blank remote file?

if you did, you can try "ordering" your scripts, and move this script to the top of the list, as you might have another on text event which is halting your scripts.

 Respond  
StonaJakey   -  Mar 02, 2010

for some reason, it wont show any text on my channels. only joins, parts etc etc

 Respond  
Hottwire   -  Dec 16, 2009

How much code would need to change so that it can take text from one server relay to another but not vice versa

example:

server1 [#a][relaying to server2 #b]
bot says hit
server2 [#b] [relay bot] bot says hi
but if some one was to say something in server2 [#b] it wouldnt be taken back to server 1 [a] ?

 Respond  
PuNkTuReD   -  Jul 20, 2009

yea well thats the difference between mine and yours,
yours is a spy
mine is a channel linker

 Respond  
Aurora801   -  Jul 20, 2009

I've got mine now set up so that you set a "Relay Server" so that any message, on any server, in any channel, is relayed in one channel, on one network. so you can have a "Spy Server with Room" and spy on all the servers your bot is on, without being on all the servers. It also logs Nickname changes, Modes, kicks, quits, joins, URL posts, and parts.

 Respond  
PuNkTuReD   -  Jul 19, 2009

Updated:

now shows in channel like this:

[08:32] .:(PuNkTuReD@Rizon):. PuNkTuReD joined #SassIRC.com
[08:32] .:(ChanServ@Rizon):. ChanServ sets mode +o on PuNkTuReD
[08:32] .:(PuNkTuReD@Rizon):. testing relay

 Respond  
Aurora801   -  Jul 19, 2009

I have a channel spy system.. I can try to make it a more usable for multiple servers. I'll work on that. I'm actually working on mine for multiple networks so that it can send the info from all the networks it's on to one single server. :]

 Respond  
trooper666   -  Jun 23, 2009

i know this is prob really simple but is there a way to get it to show that what has been siad is on a linked server so say test on server0 said hi it would say botname> hi

also i know it can connect 2 rooms on 2 servers but is it also possible to have it connect the same 2 rooms like #test and #test1 on 2 different servers so like #test@server1 and #test@server2 then #test1@server1 and #test1@server2 or would i need to just run a second version of the script with a slightly modified menu command?

thanks

 Respond  
montague   -  May 10, 2009

awesome.. i just couldn't wait too use it.. \m/

 Respond  
PuNkTuReD   -  May 09, 2009

this is only a one channel one, but ill work on a multi channel one for ya m8.

 Respond  
montague   -  May 09, 2009

how to make it relayed on another chans PunkTuReD, is it possible?

 Respond  
PuNkTuReD   -  May 08, 2009

yea i know it still displayed it, thats because of this here:

if ($scon(%a).network == $1) { dec %a }
else { scon %a msg %rchan $1- | dec %a }

as your server returns null for $scon(%a).network
it goes to the else statement.

 Respond  
montague   -  May 08, 2009

owh ok :D

 Respond  
PuNkTuReD   -  May 08, 2009

yip cos one of the servers your on doesnt support the $network identifier
:-)

 Respond  
montague   -  May 08, 2009

:/me test ur updated snippets.
have you got a server window open that is not connected?
:i guess ure rite punktured, sorry.

any message passed FROM webmaster.webchat.org
would not display the nicks name,
:well it does

and it would also display the message on that server.
as you know its not supposed to msg the room the msg originated from.
:/me nods

i couldnt test it on arcor.de.eu.dal.net because they klined my host.
:it works just fine.

code lines: if ($scon(%a).network == $1) { dec %a }
else { scon %a msg %rchan $$2- | dec %a }
} }

if i changed it too: if ($scon(%a).network == $1) { dec %a }
else { scon %a msg %rchan $$1- | dec %a }
} }

the output in server webmasters.webchat.org it will be like this:

RAPE <@Mongol> Unknown-Network RAPE tyvm for the help PunkTuReD.
 Respond  
PuNkTuReD   -  May 07, 2009

have you got a server window open that is not connected?

i cant duplicate your problem but in the process of trying, i found another.

any message passed FROM webmaster.webchat.org
would not display the nicks name, and it would also display the message on that server.
as you know its not supposed to msg the room the msg originated from.

i havent got it to stop msging the room, but i fixed the network problem.

also, i couldnt test it on arcor.de.eu.dal.net because they klined my host.

 Respond  
montague   -  May 07, 2009

i got an error, it says in status:

  • /msg: not connected to server
    im running this snippet in server arcor.de.eu.dal.net, webmaster.webchat.org & proxy.tengkorak.org

if a msgs from a nick relayed to server dalnet & webchat from server tengkorak, well it works just fine, but if it tries to relay it from dalnet too webchat & tengkorak.org, it doesn't work, & so on..

 Respond  
PuNkTuReD   -  Apr 20, 2009

the way this works is:

example:

your in #example
on 4 servers

turn this on, set it to channel #example

and it will relay to and from all 4 servers

its a multi-directional relay script.

if you would like it to state which network the msg/ban/ what ever, originated from.

replace

alias relayevent {
  var %a = $scon(0)
  while (%a) {
    if ($scon(%a).network == $1) { dec %a }
    else { scon %a msg %rchan $2- | dec %a }
} }

with this

alias relayevent {
  var %a = $scon(0)
  while (%a) {
    if ($scon(%a).network == $1) { dec %a }
    else { scon %a msg %rchan $1- | dec %a }
} }
 Respond  
Keiro   -  Apr 20, 2009

Interesting. Pops up a input dialog where I want to put in a channel name for it to relay. Edit: Ah, I see it was meant to do that.

Doesn't state whether it's relaying TO or FROM... or from whichever servers/channels.

 Respond  
wali   -  Feb 22, 2009

hellw

 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.