mIRC Homepage
Posted By: Jokke Socket script (works partly) - 21/03/15 06:08 PM
Hi!

I've got some trouble with the following code;
Code:
alias tilbud {
  sockclose gmr
  sockopen gmr www.playgames.dk 80
}

menu channel {
  DagsTilbud
  .Start: .timerAnnounce $+ #gamerhuset 0 1800 tilbud
  .Stop: .timerAnnounce $+ #gamerhuset off
}

on *:SockOpen:gmr: {  
  sockwrite -n $sockname GET /playtime.txt HTTP/1.1
  sockwrite -n $sockname Host: www.playgames.dk
  sockwrite -n $sockname
}

on *:sockread:gmr: {
  var %data 
  sockread -f %data
  if (html isin %data)   msg #gamerhuset Kig forbi vores sponsors dagstilbud! %data
}


the code works, sometimes. when I start the script, it's like 12 hours later the script actually runs for the first time. I've got help from this forum before to get this script to work, and I've done nothing towards this script on my own.
Posted By: Jokke Re: Socket script (works partly) - 30/03/15 10:05 AM
Bump,


anyone who is able to help me with this?
Posted By: Sakana Re: Socket script (works partly) - 30/03/15 08:29 PM
This is the page source of that link
Code:
http://www.playgames.dk/weekendtilbud.php


And this is the IF statement

Code:
if (html isin %data) { .... }


See the problem? wink
Posted By: Jokke Re: Socket script (works partly) - 31/03/15 04:41 PM
Yeah, I see what you mean, but the file it reads from is from the playtimes.txt wich is pure text.

The link in pure text shouldn't be the problem, or will it?
Posted By: Sakana Re: Socket script (works partly) - 31/03/15 04:47 PM
The problem is the link inside the link ended in .html before, but now it's .php

so just make this change, for example

if (playgames isin %data) { ... }
© mIRC Discussion Forums