mIRC Homepage
Posted By: euro automated messaging over multi networks - 03/12/13 12:40 PM
Hello!

I'd like to catch a specific line from USER on Network A and message a part (%2) from it to USER2 on Network B.

It worked fine with my old BNC because it run with PsyBNC and its own network identifiers (all run through one connection).
Now my BNC runs on ZNC and I need to create one connection per network (like I don't use a BNC at all).

the script I used so far:

on USER:TEXT:*aaa*bbb*:#chan: {
if (ccc isin $1-) { return }
msg USER2 $2
}

USER is a defined value in Users tab like
USER:IRCNick

USER2 is the actual IRC nick

I guess it's not that difficult to manage this but I'm absolutely not into coding that's why I have no clue how to use those scid and scon identifiers!

please help!


thx


Posted By: Deega Re: automated messaging over multi networks - 03/12/13 02:15 PM
Code:
on USER:TEXT:*aaa*bbb*:#chan:{
  if ($network != FromNet) || (ccc isin $1-) { return }
  scid -a if ($network == ToNet) { msg USER2 $safe($2) }
}
alias safe { bset -ct &a 1 $1 | return $!regsubex(safe, $bvar(&a,1-) ,/(\d+)(?: |$)/g,$chr(\1)) }


Remember to change FromNet and ToNet to, obviously, the networks you relay FROM and TO smile
Posted By: euro Re: automated messaging over multi networks - 03/12/13 02:43 PM
thnx Deega but unfortunately it doesn't work.
actually it makes nothing at all
checked it several times.
if I try my old script with the same values I get at least No such nick as response

FromNet I've set EFNet
ToNet I've set LinkNet

any ideas what's wrong?
Posted By: Deega Re: automated messaging over multi networks - 04/12/13 02:52 PM
Do you have any other text events that may be catching this as well, like perhaps your old code?

Did you change the matchtext to reflect what is actually being sent?

This code is fine, it does work as expected.
Posted By: Wims Re: automated messaging over multi networks - 04/12/13 03:08 PM
The code is fine but there are ways to get it to fail.
For example, that version of the safe alias, while preventing him to get an error on $decode being locked, creates very long string which would return an error on too long string.
You're also missing $utfdecode, you need it around $regsubex because you might have utf character encoded with more than one byte here.
Your { } also invalid with /scid, mIRC strips them when parsing it
Posted By: Deega Re: automated messaging over multi networks - 04/12/13 03:34 PM
Fair enough. smile

Like to 'fix' it then? wink
Posted By: Wims Re: automated messaging over multi networks - 04/12/13 03:55 PM
I was just reporting the errors in case someone come accross this thread, but:

Code:
on USER:TEXT:*aaa*bbb*:#chan:{
  if ($network != FromNet) || (ccc isin $1-) { return }
  scid -a if ($network == ToNet) msg USER2 $safe($2)
}
alias safe if ($1 != $null) { bset -ct &a 1 $1 | return $!utfdecode($regsubex(safe, $bvar(&a,1-) ,/(\d+)(?: |$)/g,$chr(\1))) }

Posted By: euro Re: automated messaging over multi networks - 05/12/13 10:31 PM
IT WORKS!

thnx A LOT guys! it's really appreciated!

smile
© mIRC Discussion Forums