I reworked your script making it check for errors, seeing if the script is already open (to prevent spam), timers (to prevent flooding), HTML stripping, skip header display, added an input, on text and alias, and securly set and unset all variables and the socket, and if it says "channel not live" it will simply just say that and end the script.

I would recommend scanning through it to see what stuff does to get a better insight. You can change the bla's to whatever command you want, or the channel variable to a specific channel.

I mainly worked on this to increase my knowledge of mIRC scripting. The script could be written shorter and better, but it did increase my knowledge getting it done lol. Let me know if it works for you and if you have any questions.

Code:
alias bla {
  if (%nightdev) { halt }
  else {
    $iif($sock(uptime), sockclose uptime)
    sockopen uptime nightdev.com 80
    set %uptime-chan $active
  }
}

alias uptime-message {
  if (%notlive) { .timer 1 2 msg %uptime-chan %notlive | uptime-unset }
  elseif (!%notlive) {
    var %lineread = 7
    while (%lineread <= %readcount) {
      .timer 1 2 msg %uptime-chan %readline. [ $+ [ %lineread ] ]
      inc %lineread
    }
    uptime-unset
  }
}

alias uptime-unset {
  unset %readcount
  unset %readline*
  unset %readerror
  unset %nightdev
  unset %uptime-chan
  unset %notlive
  $iif($sock(uptime), sockclose uptime)
}

on *:input:#: {
  if ($$1 == !bla) {
    if (%nightdev) { halt }
    else {
      $iif($sock(uptime), sockclose uptime)
      sockopen uptime nightdev.com 80
      set %uptime-chan $active
    }
  }
}

on *:text:!bla:#: {
    if (%nightdev) { halt }
    else {
      $iif($sock(uptime), sockclose uptime)
      sockopen uptime nightdev.com 80
      set %uptime-chan $chan
  }
}

on *:sockopen:uptime: {
  if ($sockerr > 0) {
    .timer 1 2 msg %uptime-chan Error while opening the page.
    .timer 1 3 uptime-unset
  }
  elseif (!$sockerr) {
    sockwrite -n $sockname GET /hosted/uptime.php?channel=riotgames/ HTTP/1.1
    sockwrite -n $sockname Host: www.nightdev.com
    sockwrite -n $sockname User-Agent: Mozilla/30.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
    sockwrite -n $sockname Connection: close
    sockwrite -n $sockname $crlf
  }
}

on *:sockread:uptime: {
  :top
  sockread -f %read
  if ($sockbr == 0) { goto bottom } 
  $iif(%read == %null, %read = -)
  var %stripread = $regsubex(%read,/(<[^>]*>)/g,)
  inc %readcount 1
  set %readline. [ $+ [ %readcount ] ] %stripread
  if (not live. isin %readline. [ $+ [ %readcount ] ]) { set %notlive %stripread }
  goto top
  :bottom
  uptime-message
}

Last edited by Demon1LT; 14/06/14 11:11 PM.