mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 26
D
Danko Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2004
Posts: 26
I need help with an echo script. I am echoing from one channel to another, but I would like to change the output..

What I echo from the channel looks like this:
4[7NEW4] - 7Topic:4(Need help on OC4) - 7Section:4(HARDWARE4)

But I would want it to echo into the new channel looking like this:
[12HARDWARE] 4Need help on OC

So basiclly I want to skip some of the text and change the output look.. wink I've tried playing around with my echoscript, but no luck sorting it out.. confused

Here the current echoscript i use:

Code:
on *:text:*:#OCForum:{
  if $network == OverNet && $nick == Klarg {
    set -u %relayto $1-
    scid -at1 checknets
  }
}
alias -l checknets {
  if $network == EfNet && $me ison #OCForum.dk {
    msg #OCForum.dk  %relayto
  }
}

Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
So you want to capture the parts in parentheses and display only those? Here's a way you can do this

Code:
on *:text:*:#OCForum:{
  if ($network $nick = OverNet Klarg) {
    var %x
    .echo -q $regsub($1-,/.*\((.*?)\).*\((.*?)\).*/S,[12\2] 04\1,%x)
    scid -at1 if ($network = Efnet) && ($me ison #OCforum.dk) msg $($v2 %x,)
  }
}

Joined: Aug 2004
Posts: 26
D
Danko Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2004
Posts: 26
Hey, that worked great! smile
Only had to add "msg #OCForum.dk $" in the "msg $" part.

However, the sourcebot also announces other information in parentheses, e.g. when ppl search for a thread, so is it possible to add that it ONLY echos the sentences that begins with the 4[7NEW4] part?

Thanx for helping out :-)

Joined: Aug 2003
Posts: 314
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2003
Posts: 314
Sure, just need to add to the if statement:

Code:
if ($network $nick $strip($1) = OverNet Klarg [NEW]) {

Joined: Aug 2004
Posts: 26
D
Danko Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2004
Posts: 26
That seemed to work! =)
Thanks for your awesome help, Sigh!

Joined: Aug 2004
Posts: 26
D
Danko Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Aug 2004
Posts: 26
Okey, need a tiny update for this little script..
What I'm using atm is:
Code:
on *:text:*:#OCForum:{
f ($network $nick $strip($1) = OverNet Klarg [NEW]) {
    var %x
    .echo -q $regsub($1-,/.*\((.*?)\).*\((.*?)\).*/S,[12\2] 04\1,%x)
    scid -at1 if ($network = Efnet) && ($me ison #OCforum.dk) msg #ocforum.dk $($v2 %x,)
  }
}


Se my first post how the source looks like. How can i add that it will only echo those sections that are names e.g. HARDWARE, OC, GAMING, OFFTOPIC, etc ?


Link Copied to Clipboard