is website up or down

By dronez4 on Sep 22, 2013

Well it's kinda easy to explain..
If a person is op in the channel they can block one or another by typing !webblock and !webunblock
If you want to see if a website is up or down then you type
!up
or
!down
or
!upordown

on *:text:*:#:{
  if ($nick isop $chan) {
    if ($1 == !webblock) {
    msg $chan Blocking $2 from using !up/!down/!upordown | writeini blockedweb.ini web $2 blocked }

    if ($1 == !webunblock) {
    msg $chan Unblocking $2 from using !up/!down/!upordown | remini blockedweb.ini web $2 }
  }
  if ($1 == !upordown) || ($1 == !down) || ($1 == !up) {
    if ($readini(blockedweb.ini, web, $nick)) { msg $chan Sorry u cant use this | halt }
    if (!%flood. [ $+ [ $nick ] ]) {
      set -u10 %flood. $+ $nick $true
      msg $chan 3[Search]:10 Searching to see if $2 is up or it's just u
      set %upordown $2
      set %chan123 $chan
      getdown
    }
    elseif (%flood. [ $+ [ $nick ] ]) {
      msg $chan 3[Search]:10 This command only works every 10 seconds!
    }
  }
}

alias getdown {
  sockclose upordown
  sockopen upordown www.downforeveryoneorjustme.com 80
}

on *:sockread:upordown:{
  if ($sockerr > 0) { return }
  else {
    var %read
    sockread %read 
    if (*is up* iswm %read) {
      msg %chan123 9[online]:7 %upordown is Online..
    }
    if (*looks down from* iswm %read) {
      msg %chan123 4[Offline]:7 %upordown is Offline..
    }
  }
}

On *:sockopen:upordown: {
  if (!$sockerr) {
    sockwrite -nt upordown GET / $+ %upordown HTTP/1.0
    sockwrite -n upordown Host: www.downforeveryoneorjustme.com
    sockwrite -n upordown $crlf
  }
  else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}

Comments

Sign in to comment.
dma   -  Feb 03, 2016

nice

 Respond  
Stewie1k94   -  Oct 05, 2013

This is actually pretty neat, and is helpful, because can make it easier when you are just too lazy to go to a site and find out yourself. I also like the idea of being able to restrict certain users from the command, for whatever reason. Nice work! :)

dronez4  -  Oct 07, 2013

Thanks very much :)

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.