mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2013
Posts: 3
E
euro Offline OP
Self-satisified door
OP Offline
Self-satisified door
E
Joined: Dec 2013
Posts: 3
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



Last edited by euro; 03/12/13 12:49 PM. Reason: typo
Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
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

Joined: Dec 2013
Posts: 3
E
euro Offline OP
Self-satisified door
OP Offline
Self-satisified door
E
Joined: Dec 2013
Posts: 3
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?

Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
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.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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

Last edited by Wims; 04/12/13 03:10 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Fair enough. smile

Like to 'fix' it then? wink

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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))) }



#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2013
Posts: 3
E
euro Offline OP
Self-satisified door
OP Offline
Self-satisified door
E
Joined: Dec 2013
Posts: 3
IT WORKS!

thnx A LOT guys! it's really appreciated!

smile


Link Copied to Clipboard