mIRC Homepage

removing text from a line beyond certain points

Posted By: enotsoc

removing text from a line beyond certain points - 08/12/05 12:24 AM

how can i remove text that is posted beyond a certain point in a line
ex:
[CNN] - [ Newest headline here ] - [ http://cnn.com/rss.... ] - [ blah blah ] how i can remove anything that is posted beyond that last set of brackets? its forever changing so i cant narrow it down
i want to echo it to a window but dont want the rest of the line to go with it id rather see only
[CNN] - [ Newest headline here ] - [ http://cnn.com/rss.... ] be posted in my echo window
Posted By: FiberOPtics

Re: removing text from a line beyond certain points - 08/12/05 12:33 AM

//echo -a $gettok(a - b - c - d - e,1-3,45)
//echo -a $deltok(a - b - c - d - e,4-,45)
Posted By: enotsoc

Re: removing text from a line beyond certain points - 08/12/05 12:43 AM

how would i use that if i decide to echo it to my a 2nd channel ? since my pc is slow that i run the rss on , i cant handle running the bot 2 times uses too much cpu , so i may just echo it to the 2nd channel and server
Posted By: FiberOPtics

Re: removing text from a line beyond certain points - 08/12/05 12:53 AM

You make no sense.

Instead of asking for this specific thing (how to remove certain parts from a string), explain how all of this is set up. An RSS bot has come up in the discussion, and it sounds like you're running it, but that's all we really know. What RSS bot are we talking about here?

I will try to figure out what you are talking about:

You are running an RSS bot, which checks headlines from a news site's RSS feed, and when it runs, it messages to a certain channel the headlines, when a certain trigger is called on a channel. Now you want to edit the format in which it is messaged to the channel + you want it to send the headlines to another channel as well without retrieving the headlines again with a new trigger to the same news site, but with a different target channel. You want to avoid this, because the retrieving of the headlines is an intensive task and your slow computer has a hard time handling, and because it is simply stupid to check the headlines again if you already have them.

Does that sound somewhat like your situation? Well, I can't be sure of course, how could I with the information you've given...

All I can say is, this rss reader, if any good, should be storing the information somewhere (hashtable) when it checks for headlines, which means you don't have to retrieve them again, you can just grab them from the hashtable, and message them to your 2nd channel.

As far as changing the format, you'll need to edit the code so that it messages with that $gettok/$deltok applied on the lines to be sent.
Posted By: enotsoc

Re: removing text from a line beyond certain points - 08/12/05 12:59 AM

i run a rss bot, it posts a feed, but since my pc is slow and eggdrops cant run on multiple networks , i need a 2nd eggdrop, but my pc is too slow, so id rather echo the feed line from the first channel to the 2nd channel but without the addition stuff i mentioned, some sites dont have stuff i want removed but some do not, , and yes the bot stores in a hash file but that is beyond the point a 300mhz laptop can hardly handle a rss bot , they use too much cpu , so id rather echo to my 2nd channel and remove the text that appears beyond the specific area i mentioned which ill be using mirc to echo the text
Posted By: FiberOPtics

Re: removing text from a line beyond certain points - 08/12/05 01:07 AM

This is an mIRC scripting help forum, not an eggdrop help forum.

If your RSS bot is too much for your 300mhz laptop, then it must be some hell of a badly scripted RSS bot, as a task such as retrieving headlines from an RSS feed is hardly intensive. Neither is retrieving data from a hash table with the size of that required for an RSS bot.

You are better off getting an RSS bot in mIRC scripting which stores the data in an mIRC hash table. A hash table is global to your mIRC, it is not server specific. So it doesn't matter where the mIRC scripted RSS bot is running, once the hash table has its data, you can message it to whatever channel/server with your regular mIRC by using $hget to reference the data in the hash table.

An example of an mIRC scripted RSS retriever is this Universal RSS Headline Retriever, which is a simple snippet which fills the hash table that you specified with all the headlines from a certain RSS news feed.
Posted By: enotsoc

Re: removing text from a line beyond certain points - 08/12/05 01:14 AM

im asking for mirc help , not eggdrop
i said it clearly i want it for mirc help to remove text beyond a specific point, forget anything about eggdrop/rss , all i want is help with removing text beyond a certain point in a line and echo relay whatever term you wanna use to another channel .
Posted By: FiberOPtics

Re: removing text from a line beyond certain points - 08/12/05 01:16 AM


  • scid <cid of the server you want to message to>
    if ($me ison #channel) msg #channel $deltok(<the string>,4-,45)
© 2022 mIRC Discussion Forums