mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2013
Posts: 33
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Aug 2013
Posts: 33
Hello peeps!

Another question that I seek answers too. xD
So I've been going about for this all day long been searching Google and stuff, but I can't really find anything on it.

Now my questions is: Would it be possible or is there a code to send a message from one server to another without it writing and reading from a txt (Like I'm doing now.)?

So. If I post said message in server 1 in channel 200 I would like it to re-post the message in server 2 in channel 100. I have a feeling this is not possible seen as the commands go to the server you're connected on and not mIRC itself.

Thanks in advance for taking the time to read and (maybe) reply o this! <3
Farcrada

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Use the /scid command to switch the server connection the script is running on.

With scid you can either specify a connection id or use the -a switch to run the command on all connections. You can specify the command you want to run on the same line as /scid, or simply use it to switch servers and then program as usual afterward.

So you can either:

Code:
on *:connect:{
  if ($network == relay_to) { set %relay_to $cid }
}

on *:text:*:#:{
  if ($network == relay_from) {
    scid %relay_to msg #somechan $1-
    ;scid %relay_to
    ;msg #somechan $1-
  }
}

OR

on *:text:*:#:{
  if ($network == relay_from) {
    scid -a if ($network == relay_to) { msg #somechan $1- }
  }
}

Last edited by Loki12583; 23/11/13 07:08 PM.
Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Originally Posted By: Loki12583
You can specify the command you want to run on the same line as /scid
That is very unsafe, any $identifiers or %vars will be evaluated in the relayed msg.

Use the method that Loki commented out.
Code:
on *:text:*:#:{
  if ($network == relay_from) {
    scid %relay_to
    msg #somechan $1-
  }
}
Code:
on *:text:*:#:{
  if ($network == relay_from) { scid %relay_to | msg #somechan $1- }
}
OR
Use $safe($1-)
Code:
on *:text:*:#:{
  if ($network == relay_from) {
    scid -a if ($network == relay_to) { msg #somechan $safe($1-) }
  }
}
alias safe { bset -ct &a 1 $1 | return $!regsubex(safe, $bvar(&a,1-) ,/(\d+)(?: |$)/g,$chr(\1)) }


Joined: Aug 2013
Posts: 33
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Aug 2013
Posts: 33
Holy shit! Thanks people! <3 Definitely helped me out!


Link Copied to Clipboard