mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2006
Posts: 23
L
l0GicAL Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2006
Posts: 23
here is my relay/echo script:

on *:TEXT:*:#test: { if ($nick == JohnDoe) && ($chan == #test) { scon -a if ($network == After-All) msg #test2 $1- } }


what it does is relay/echo RSS feeds from one channel to another (in a different network). an example relay/echo of the bot 'JohnDoe' is:

5:58p (JohnDoe) [BF2142] - http://www.totalbf2142.com/forums/showthread.php?t=17584&goto=newpost
5:58p (JohnDoe) [GameSpot] - http://www.gamespot.com/news/6165159.html?part=rss&tag=gs_pc&subj=6165159
5:59p (JohnDoe) [BF2] - http://www.totalbf2.com/forums/showthread.php?t=108473&goto=newpost
5:59p (JohnDoe) [GameSpy] - http://media.pc.gamespy.com/media/866/866306/vids_1.html


there are more than 20+ RSS feeds of various games sites and what i would like to happen is to relay/echo everything that the bot 'JohnDoe' will say EXCEPT those that are from:

* http://www.totalbf2142.com
* http://www.totalbf2.com/


hopefully, this can be done by modifying my relay/echo script above. thank you so much in advance!




smile

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Untested, but here you go.

Code:
on *:TEXT:*:#test: {
  if ($nick == JohnDoe && http://www.totalbf2142.com !isin $1- && http://www.totalbf2.com/ !isin $1-) {
    scon -a if ($network == After-All) { msg #test2 $1- }
  }
}


As a note, if those are the only 2 that include "totalbf2" in the URL, then you can simplify it to:

Code:
on *:TEXT:*:#test: {
  if ($nick == JohnDoe && totalbf2 !isin $1-) {
    scon -a if ($network == After-All) { msg #test2 $1- }
  }
}


I removed the $chan == #test check because you're already saying that in the event line (on *:text:*:#test: { ), so it wasn't needed.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2006
Posts: 23
L
l0GicAL Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2006
Posts: 23
thanks for your reply, Riamus2!

a little correction about your code - i do NOT want anything from 'totalbf2' (or totalbf2142 for that matter) to be relayed/echo. so instead of using:

&& totalbf2 !isin $1-


...i think i should use the variable for 'not' so it would look like:

(not) totalbf2 !isin $1-


what is the logical operator for 'not'?


EDIT: does ! == not ?

Last edited by l0GicAL; 02/02/07 12:13 AM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
!isin mean "not" isin. That's what the ! is for. smile


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2006
Posts: 23
L
l0GicAL Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2006
Posts: 23
Originally Posted By: Riamus2
!isin mean "not" isin. That's what the ! is for. smile


lol, ok... i get it. smile

i have another question - what if next time, for example, i do NOT want to relay/echo links that are coming from http://www.pcworld.com , should i simply edit your script like so:

Code:
on *:TEXT:*:#test: {
  if ($nick == JohnDoe && totalbf2 !isin $1- && http://www.pcworld.com !isin $1-) {
    scon -a if ($network == After-All) { msg #test2 $1- }
  }
}


...or is there another shorter (& "prettier") way of doing it? also, i haven't tested your script yet because i am currently at work but hopefully, it should do the trick! wink

thanks again!

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yes, you can do that. To make it shorter, you can just shorten the URL as much as possible without it matching some other RSS text.

For example, with your example sites:

[BF2142] - http://www.totalbf2142.com/forums/showthread.php?t=17584&goto=newpost
[GameSpot] - http://www.gamespot.com/news/6165159.html?part=rss&tag=gs_pc&subj=6165159
[BF2] - http://www.totalbf2.com/forums/showthread.php?t=108473&goto=newpost
[GameSpy] - http://media.pc.gamespy.com/media/866/866306/vids_1.html

You couldn't shorten the match to "game" in order to not get GameSpy because GameSpot would also match. One thing you could do is to use the []'d part:

Code:
on *:TEXT:*:#test: {
  if ($nick == JohnDoe && totalbf2 !isin $1- && [GameSpy] !isin $1-) {
    scon -a if ($network == After-All) { msg #test2 $1- }
  }
}


Then, just change [GameSpy] to whatever you want. You could shorten the BF2 one (assuming you still want to match both) to:

[BF2 !isin $1-

That would match both and no others. I'm not sure it is "prettier" than what I already gave you, but it is a shorter match that shouldn't match anything else. You can really use anything you want there as long as it only matches the ones that you want and doesn't match anything else. If you know all of the RSS feed links, then you shouldn't have a problem picking appropriate matches. And, like I said, you can use the []'d part even if it's a bit longer and that would at least make it easier to see what you are blocking.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard