mIRC Home    About    Download    Register    News    Help

Print Thread
copying one server channel output to another #179384 22/06/07 08:23 AM
Joined: Dec 2006
Posts: 46
D
danzigrules Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2006
Posts: 46
In a game I play there is a news channel on one server that I copy the news from and post on a channel on my server. It works fine, but would like to know the best way to do a few things.

Code:
[/code]on *:text:*ss*(xyz):#news:{
  //scid 1 msg #allnews [ $+ $time(hh:nntt) $+ ] $1-
  ://scid 1 msg #grabnews [ $+ $time(hh:nntt) $+ ] $1-
} 
[code]


My question is would it be better to have a separate .mrc file for each *ss*(whatever) for each "clan" I would like to track, or put them all into one big .mrc and just add a new on text event?

Or am I going about this completely the wrong way? There can be upwards of 20 lines per second on the server I am getting the news from. That server knows that I am coping the news and does not have a problem with it.

We are working on our own news feed, but until that gets sorted out this is the only way that I know how to have the news.

Thank you.

Last edited by danzigrules; 22/06/07 08:24 AM.
Re: copying one server channel output to another [Re: danzigrules] #179385 22/06/07 08:37 AM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Code:
on *:text:*ss*(xyz):#news:{
  scid 1 msg #allnews [ $+ $time(hh:nntt) $+ ] $1- :
  scid 1 msg #grabnews [ $+ $time(hh:nntt) $+ ] $1- }
}


You can just do it like this (and this is assuming the (tag) is a separate "word" at the end of each line):

Code:
on *:text:*ss*:#news:{
  var %newstag = $right($left($gettok($1-,-1,32),-1),-1)
  if (%newstag == xyz || %newstag == abc) {
    scid 1 msg #allnews [ $+ $time(hh:nntt) $+ ] $1- :
    scid 1 msg #grabnews [ $+ $time(hh:nntt) $+ ] $1- }
  }
}


And if all tagged news items should be sent to those same two channels, just make an alias:

Code:
on *:text:*ss*:#news:{
  var %newstag = $right($left($gettok($1-,-1,32),-1),-1)
  if (%newstag == xyz || %newstag == abc) { newsecho }
}
alias -l newsecho {
  scid 1 msg #allnews [ $+ $time(hh:nntt) $+ ] $1- :
  scid 1 msg #grabnews [ $+ $time(hh:nntt) $+ ] $1- }
}

Last edited by 5618; 22/06/07 08:40 AM.
Re: copying one server channel output to another [Re: 5618] #179387 22/06/07 09:55 AM
Joined: Dec 2006
Posts: 46
D
danzigrules Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2006
Posts: 46
well thanks for replying, but as usual I always forget to put something in frown

The output of the news is:

BR - LCoHreturnsWithaClog (#1026) (TKOwning) -> Hells Haven (#1070) () 10 C 3 B

Where the BR can be 8 different things, the part before (#1026) can be one word or multiple words, same for the part right after ->

Re: copying one server channel output to another [Re: danzigrules] #179388 22/06/07 10:22 AM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Can you please explain which tags/words you want to base your echo to the other 2 chans on?

Re: copying one server channel output to another [Re: 5618] #179390 22/06/07 11:57 AM
Joined: Dec 2006
Posts: 46
D
danzigrules Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2006
Posts: 46
(tie) (sol)

Code:
[/code]on *:text:*ss*:#news:{
  var %newstag = $right($left($gettok($1-,-1,32),-1),-1)
  if (%newstag == xyz || %newstag == abc) {
    scid 1 msg #allnews [ $+ $time(hh:nntt) $+ ] $1- :
    scid 1 msg #grabnews [ $+ $time(hh:nntt) $+ ] $1- }
  }
}[code]


Would I also be able to just add another on text if I wanted to add more (tags)

Last edited by danzigrules; 22/06/07 12:01 PM.
Re: copying one server channel output to another [Re: danzigrules] #179392 22/06/07 01:10 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
The tags "tie" and "sol" would be found like this?

BR - LCoHreturnsWithaClog (#1026) (tie) -> Hells Haven (#1070) () 10 C 3 B

You can base getting reading the tag on it being after the second opening bracket, but that gives trouble when there are brackets in the title.
You can use two separate on TEXT events, but you cannot use two on TEXT events with the same matchtext (on *:TEXT:matchtext:#:)
May as well put it like this:

on *:TEXT:*(tie)*:#news:{ newsecho }
on *:TEXT:*(sol)*:#news:{ newsecho }
alias -l newsecho {
scid 1 msg #allnews [ $+ $time(hh:nntt) $+ ] $1-
scid 1 msg #grabnews [ $+ $time(hh:nntt) $+ ] $1-
}