mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
Hey smile

I have a tv.com script which works fine, using sockets.

It echoes all the information i require, however, it doesn't read the information as id like.

EXAMPLE:

<h3>First Episode</h3>
<a class="btn_edit fr mr-5" style="margin-top:3px;" href="http://www.tv.com/usersubmission/episode_synopsis.html&show_id=2687&episode_id=85433"></a>
</div>
<div class="f-bold f-medium f-red mb-5">
Tuesday September 19, 2000
</div>
<div class="mb-5"><a href="http://www.tv.com/my-family/serpents-tooth/episode/85433/summary.html" class="f-12">Serpent's Tooth</a></div>
<p class="mt-0 mb-0">Ben is annoyed to learn that both Janey and Susan are patients of another dentist...especially since Janey hasd a crush on this dentist. Nick uses Ben's laptop to have an 'email romance' with Isabelle - a famous model...Who's lying to who...? <a href="http://www.tv.com/my-family/serpents-tooth/episode/85433/summary.html">Continue</a> <a href="http://www.tv.com/episode/85433/summary.html"><img src="http://image.com.com/tv/images/arrow.gif"></a></p>

Excuse the long example.

Now, it will read that line by line, but say i want to use an if statement to check if <h3>First Episode</h3> is a match to what it reads. Then I want to echo/display all the information below that line too.

At the moment, the most it will echo is one line, what I mean is that it will ignore the line breaks. Im using a %var, not a &binvar.

Is there any way to get round this?

Many thanks in advance.


i script, therefore i am smirk
theres logic in there somewhere...
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The sockread command reads all data up to the next linebreak. To continue reading the rest of the data, you will need to set a global variable as a switch, and then use that variable in the sockread event to indicate that you want to display the next line as well. Example:

Code:
on *:SOCKREAD:socket:{
  var %s
  sockread %s
  tokenize 32 %s
  if (&lt;h1&gt;*&lt;/h1&gt; iswm $1-) set %switch 1
  elseif (%switch) echo -a &gt; $1-
}


-genius_at_work


Link Copied to Clipboard