PDA

View Full Version : Uber Server Online/Offline check


Zeus
12-01-2007, 09:13 PM
Notifies the user when the server goes offline, and comes back online again.

I misplaced the $sockclose on the previous version.

Please load the file first to initialize commands: //load -rs SCRIPTNAME.mrc

ON *:LOAD: {
Â*Â*IF (!$Timer(CheckStatus1)) {
Â*Â*Â*Â*/timerCheckStatus1 0 10 start.check1
Â*Â*Â*Â*Echo $Colour(info) -ati2 Installed $script - mIRC version: $version
Â*Â*}
}

ON *:CONNECT: {
Â*Â*IF (!$window(@Dodian)) window -ae @Dodian 10 10 550 350
Â*Â*IF (!$Timer(CheckStatus1)) {
Â*Â*Â*Â*/timerCheckStatus1 0 10 start.check1
Â*Â*}
}

ON *:DISCONNECT: {
Â*Â*IF ($Timer(CheckStatus1)) {
Â*Â*Â*Â*timerCheckStatus1 off
Â*Â*}
Â*Â*hfree ServStatus1
}

alias start.check1 {
Â*Â*sockopen serverCheck1 web.aanet.com.au 80
}

on *:SOCKOPEN:serverCheck1: {
Â*Â*sockwrite -nt $sockname GET /justinclient/check.php HTTP/1.1
Â*Â*sockwrite -nt $sockname Host: web.aanet.com.au
Â*Â*sockwrite -nt $sockname $crlf
}

on *:SOCKREAD:serverCheck1: {
Â*Â*var %read
Â*Â*sockread %read
Â*Â*if ($regex(%read,/Server: (.+)
/Si)) {
Â*Â*Â*Â*if ($regml(1) == Online) {
Â*Â*Â*Â*Â*Â*if ($hget(ServStatus1,Offline) == 1) {
Â*Â*Â*Â*Â*Â*Â*Â*hfree ServStatus1
Â*Â*Â*Â*Â*Â*Â*Â*AutoUp $+($chr(3),3,ONLINE,$chr(15),!)
Â*Â*Â*Â*Â*Â*Â*Â*IF (!$window(@Dodian)) window -ae @Dodian 10 10 550 350
Â*Â*Â*Â*Â*Â*}
Â*Â*Â*Â*}
Â*Â*Â*Â*else {
Â*Â*Â*Â*Â*Â*if (!$hget(ServStatus1,Offline)) {
Â*Â*Â*Â*Â*Â*Â*Â*hadd -m ServStatus1 Offline 1
Â*Â*Â*Â*Â*Â*Â*Â*AutoUp $+($chr(3),4,OFFLINE,$chr(15),!)
Â*Â*Â*Â*Â*Â*}
Â*Â*Â*Â*}
Â*Â*Â*Â*sockclose $sockname
Â*Â*}
}

Alias AutoUp {
Â*Â*aline @Dodian $+([,$time(hh:nn:ss),]) Uber Server is now: $1-
Â*Â*Echo $Colour(info) -ati2 Uber Server is now: $1-
}

Justin
12-01-2007, 09:15 PM
Very nice :)
~Justin

Llamadudeee
12-01-2007, 09:18 PM
very ***y.

~llama

Zeus
12-01-2007, 09:24 PM
Edited for a new version.

ZoneWins
12-01-2007, 09:47 PM
Nice one, might use in future

Luke
12-04-2007, 01:13 PM
nice job keep it up