Advertisement
westor

!uptime command

Jun 20th, 2015
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 1.03 KB | None | 0 0
  1. alias uptime_chan return ENTER-HERE-THE-TWITCH-CHANNEL
  2. ; change this to your twitch channel (without # in front of the name)
  3. ; example: starladder5
  4.  
  5. ; --- end of settings ----
  6.  
  7. ON *:TEXT:!uptime:#: {
  8.   var %c = $chr(35) $+ $uptime_chan
  9.   if (%c == $chan) { uptime }
  10. }
  11.  
  12. alias uptime {
  13.   sockclose uptime
  14.   sockopen uptime nightdev.com 80
  15. }
  16.  
  17. ON *:SOCKOPEN:uptime: {
  18.   if ($sockerr) { sockclose $sockname | halt }
  19.   sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ $uptime_chan HTTP/1.1
  20.   sockwrite -n $sockname Host: $sock($sockname).addr
  21.   sockwrite -n $sockname $crlf
  22. }
  23.  
  24. ON *:SOCKREAD:uptime: {
  25.   if ($sockerr) { sockclose $sockname }
  26.   var %data
  27.   sockread %data
  28.   if ($gettok(%data,1,32) isnum) && ($gettok(%data,2,32)) {
  29.     var %c = $chr(35) $+ $uptime_chan
  30.     if ($me !ison %c) { return }
  31.     .msg %c The streaming is up for $qt(%data) $+ .
  32.   }
  33.   elseif (*not live.* iswm %data) {
  34.     var %c = $chr(35) $+ $uptime_chan
  35.     if ($me !ison %c) { return }
  36.     .msg %c The streaming is currently offline.
  37.   }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement