Advertisement
westor

!uptime for Aotik v3

Jan 17th, 2015
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.58 KB | None | 0 0
  1. ON !*:TEXT:!uptime:#: {
  2.   var %s = upt_ $+ $ticks $+ $rand(1,1000000)
  3.   if ($sock(%s)) { sockclose %s }
  4.   sockopen %s nightdev.com 80
  5.   sockmark %s $nick $chan
  6. }
  7.  
  8. ON *:SOCKOPEN:upt_*: {
  9.   if ($sockerr) {
  10.     var %n = $gettok($sock($sockname).mark,1,32)
  11.     var %c = $gettok($sock($sockname).mark,2,32)
  12.     if ($me ison %c) && (%n ison %c) { .msg %c ( $+ %n $+ ): Error, There was an connection opening error to the nightdev.com website! }
  13.     sockclose $sockname
  14.     return
  15.   }
  16.   sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ $gettok($sock($sockname).mark,2,32) HTTP/1.1
  17.   sockwrite -n $sockname Host: $sock($sockname).addr
  18.   sockwrite -n $sockname User-Agent: */*
  19.   sockwrite -n $sockname Connection: close
  20.   sockwrite -n $sockname $crlf
  21. }
  22.  
  23. ON *:SOCKREAD:upt_*: {
  24.   if ($sockerr) {
  25.     var %n = $gettok($sock($sockname).mark,1,32)
  26.     var %c = $gettok($sock($sockname).mark,2,32)
  27.     if ($me ison %c) && (%n ison %c) { .msg %c ( $+ %n $+ ): Error, There was an connection reading error to the nightdev.com website! }
  28.     sockclose $sockname
  29.     return
  30.   }
  31.   var %r
  32.   sockread %r
  33.   var %n = $gettok($sock($sockname).mark,1,32)
  34.   var %c = $gettok($sock($sockname).mark,2,32)
  35.   if (*channel not live* iswm %r) { .msg %c ( $+ %n $+ ): %c Uptime: The channel is NOT live! | sockclose $sockname }
  36.   if (*minutes* iswm %r) || (*seconds* iswm %r) { .msg %c ( $+ %n $+ ): %c Uptime: %r | sockclose $sockname }
  37.   if (*date* !iswm %r) && ($chr(44) isin %r) {
  38.     if ($me ison %c) && (%n ison %c) { .msg %c ( $+ %n $+ ): %c Uptime: %r | sockclose $sockname }
  39.   }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement