Majeye

mIRC - streamer uptime with search !uptime <streamname>

Feb 12th, 2015
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.89 KB | None | 0 0
  1. on *:text:!uptime*:#:{
  2.   if ((%flooduptime) || ($($+(%,flooduptime.,$nick),2))) { return }
  3.   set -u5 %flooduptime On
  4.   set -u10 %flooduptime. $+ $nick On
  5.   set %target $iif($2,$2,$mid(#,2-))
  6.   set %channel #
  7.   uptime
  8. }
  9.  
  10. alias uptime {
  11.   sockclose uptime
  12.   sockopen uptime nightdev.com 80
  13. }
  14.  
  15. on *:sockopen:uptime:{
  16.   if ($sockerr) { sockclose $sockname | halt }
  17.   sockwrite -n $sockname GET /hosted/uptime.php?channel= $+ %target HTTP/1.1
  18.   sockwrite -n $sockname Host: www.nightdev.com
  19.   sockwrite -n $sockname $crlf
  20. }
  21.  
  22. on *:sockread:uptime:{
  23.   if ($sockerr) { sockclose $sockname | halt }
  24.   var %data
  25.   sockread %data
  26.   tokenize 32 %data
  27.   if ($1 isnum) && ($2) { msg %channel %target has been online for $1- }
  28.   elseif (%data == The channel is not live.) msg %channel %target is currently not online/streaming.
  29.  
  30. }
  31.  
  32. on *:sockclose:uptime:{
  33.   unset %channel
  34.   unset %target
  35. }
Add Comment
Please, Sign In to add comment