Top

Down for everyone or just me?


mIRC Code
+ 2 likes
Please Register to submit score.
Bookmark and Share
Average Score  9.2 (of 5 scores)
Date Added  Jul 24, 2009
Last Updated  Jul 24, 2009
Tags  check  checker  down  everyone  for  just  kirby  me  mirc  or  site  website 

Introduction

I haven't scripted anything in a while, so I decided to make something simple with some regex, also so that I don't lose my familiarity with mIRC scripting.

This snippet is a website checker. Simply put, it checks to see if the site is "up" or "down".

Syntax: /check <site name>

For example:
Code:
/check www.hawkee.com


Here's a picture:


Enjoy! :D

Grab the Code

alias check {
  if ($sock(sitecheck)) { sockclose sitecheck }
  sockopen sitecheck www.downforeveryoneorjustme.com 80
  sockmark sitecheck $$1
}
on *:sockopen:sitecheck: {
  sockwrite -n $sockname GET $+(/,$sock(sitecheck).mark) HTTP/1.1
  sockwrite -n $sockname Host: www.downforeveryoneorjustme.com
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname $crlf
}
on *:sockread:sitecheck: {
  var %x | sockread %x
  if ($regex(%x,(.+)<a href="(.+)"\sclass="domain">.+<\/a>(.+))) {
    echo -a $regsubex($+($regml(1),,$regml(2),,$regml(3)),/(<[^>]*>)/g,)
  }
}
 

Comments

  (14)  RSS
Cheiron
Comments: 627
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 24, 2009 5:30 pm
works nicely Kirby. good job. a few ideas for an update for you.. instead of the echo .. possibly get it to msg channel or notice the nick .. other than that .. turn it to a bot use. running off of a trigger for users :)

as it is .. i like it.. it gets a like and 6. will up that if any of the updates are done
Kirby
Comments: 475
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 24, 2009 6:13 pm
Something like this Cheiron?
Code:
on $*:text:/^[.!@]check*/Si:#: {
  if ($sock(check)) { sockclose check }
  sockopen check www.downforeveryoneorjustme.com 80
  sockmark check $$2 # $nick
}
on *:sockopen:check: {
  sockwrite -n $sockname GET $+(/,$gettok($sock(check).mark,1,32)) HTTP/1.1
  sockwrite -n $sockname Host: www.downforeveryoneorjustme.com
  sockwrite -n $sockname Connection: close
  sockwrite -n $sockname $crlf
}
on *:sockread:check: {
  var %x | sockread %x
  if ($regex(%x,(.+)<a href="(.+)"\sclass="domain">.+<\/a>(.+))) {
    tokenize 32 $sock(check).mark
    msg $2 $+($3,:) $regsubex($+($regml(1),,$regml(2),,$regml(3)),/(<[^>]*>)/g,)
  }
}

Syntax: .check <site name>

Intended for a bot...renamed the sock name...

..and thank you.

I wanted this to be simple, for personal use, rather than bot use. Otherwise, use the code above.
Grant-
Comments: 91
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 24, 2009 6:17 pm
Must correct (Grammar nazi mode on)
Code:
  if ($sock(sitecheck)) { sockclose sitecheck }

  if ($sock(sitecheck)) sockclose sitecheck
FordLawnmower
Comments: 411
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 24, 2009 6:28 pm
I've been looking at this screen for several moments trying to figure out what the hell you're talking about Grant-. So I'll just ask ;/
What??
Cheiron
Comments: 627
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 24, 2009 6:32 pm
awesome Kirby :)
that does me perfect for what i needed. got both personal and the bot one loaded and all looking sweet as .. bumping this to a 8
thankies

oh crap i know what i did forget to ask .. for the bot version .. how do i restrict it to ops only to use it and if a non op tried to use it.. it will message the user they need ops to use it
i tried editing the first line to on @*:text: and it wouldnt work heh
Kirby
Comments: 475
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 24, 2009 7:05 pm
@Grant-:
Quote:
Must correct (Grammar nazi mode on)
Code:
if ($sock(sitecheck)) { sockclose sitecheck }

if ($sock(sitecheck)) sockclose sitecheck

That actually slows the script down. ^_^

Quote:
Using brackets speeds up processing. If an alias uses too few brackets then the statement might be ambiguous and the alias will take longer to parse, might be parsed incorrectly, or might not be parsed at all.

In retrospect, what I'm saying is true.


@Cheiron:
Quote:
oh crap i know what i did forget to ask .. for the bot version .. how do i restrict it to ops only to use it and if a non op tried to use it.. it will message the user they need ops to use it

Just add:
Code:
if ($nick(#,$nick,o)) {
Grant-
Comments: 91
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 24, 2009 7:11 pm
less bytes is all i'm saying x.X
knoeki
Comments: 120
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 25, 2009 3:35 am
Quote:
less bytes is all i'm saying x.X


yes, because those aproxmiately 10 bytes really save your ass when you have several hundreds of megabytes of RAM/diskspace ;_)
Grant-
Comments: 91
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 25, 2009 11:33 am
actually, what I'm saying is there are tons of "challenges" people host, and you have to have the least amount of bytes to win. :p
FordLawnmower
Comments: 411
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 25, 2009 11:45 am
This isn't a challenge Grant- . Here we try to make scripts that will work 100% of the time. Everyone knows that short code breaks easily ;/
Spanky
Comments: 233
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 25, 2009 11:49 am
VinX
Comments: 56
 
mIRC Snippet:  Down for everyone or just me?
Posted on Jul 30, 2009 8:57 am
@cherion

awesome , thanks man

fire_wizard1
Comments: 81
 
mIRC Snippet:  Down for everyone or just me?
Posted on Aug 3, 2009 11:20 am
O_O wtfh its been almost half a year since i've seriously thought about script work. and im like 0_0 i need to get back into it
Weapon-X
Comments: 5
 
mIRC Snippet:  Down for everyone or just me?
Posted on Sep 12, 2009 12:09 am
Fantastic script, Kirby. Tested the trigger version on one of my bots, and now I've got the perfect answer for n00bs who constantly ask "Is the site down?"

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom