Advertisement
ZemaToxic

IRC Bs

Oct 31st, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. ON $*:TEXT:/^!uptime(\s\w+)?$/iS:#: {
  2. if ($nick !isop #) {
  3. if ((%flooduptime) || ($($+(%,flooduptime.,$nick),2)) || ($($+(%,floodUser.,$nick),2))) { return }
  4. set -u30 %flooduptime on
  5. set -u60 %flooduptime. $+ $nick On
  6. set -u60 %floodUser. $+ $nick On
  7. }
  8. VAR %chan $IIF($2,$2,$remove($chan,$chr(35)))
  9. JSONOpen -uw uptime https://api.twitch.tv/kraken/streams/ $+ %chan $+ ?nocache= $+ $ticks
  10. JSONUrlHeader uptime Client-ID
  11. JSONUrlGet uptime
  12. MSG $chan /me %chan $IIF($JSON(uptime, stream, created_at),has been live for $duration($calc($ctime - $TwitchTime($JSON(uptime, stream, created_at))),2) $+ .,is not live at the moment.)
  13. JSONClose uptime
  14. }
  15.  
  16. :// https://api.twitch.tv/kraken/users/ $+ $nick $+ /follows/channels/ $+ %chan $+ ?nocache= $+ $ticks
  17. :// JSONOpen -uw followCheck https://api.twitch.tv/kraken/users/ $+ $nick $+ /follows/channels/cyanideplaysgames ?nocache= $+ $ticks
  18.  
  19. on $*:text:/^!loyal(\s\w+)?$/iS:#: {
  20. if ($chan != #sovietwomble) {
  21. if ($nick !isop #) {
  22. if ((%floodloyal) || ($($+(%,floodloyal.,$nick),2)) || ($($+(%,floodUser.,$nick),2))) { return }
  23. set -u30 %floodloyal on
  24. set -u60 %floodloyal. $+ $nick On
  25. set -u60 %floodUser. $+ $nick On
  26. }
  27. VAR %chan $IIF($2,$2,$remove($chan,$chr(35)))
  28. JSONOpen -uw followCheck https://api.twitch.tv/kraken/users/ $+ $nick $+ /follows/channels/ $+ %chan $+ ?nocache= $+ $ticks
  29. JSONUrlHeader followCheck Client-ID
  30. JSONUrlGet followCheck
  31. MSG # /me $nick $IIF($JSON(followCheck, created_at), has been following %chan for $replace($duration($calc($ctime - $TwitchTime($JSON(followCheck, created_at))),2),wks,$chr(32) $+ weeks $+ $chr(44),wk,$chr(32) $+ week $+ $chr(44),days,$chr(32) $+ days $+ $chr(44),hrs,$chr(32) $+ hours and $+ $chr(44),mins,$chr(32) $+ minutes), is not following %chan)
  32. JSONClose followCheck
  33. }
  34. }
  35.  
  36. alias TwitchTime {
  37. if ($regex($1-, /^(\d\d(?:\d\d)?)-(\d\d)-(\d\d)T(\d\d)\:(\d\d)\:(\d\d)(?:(?:Z$)|(?:([+-])(\d\d)\:(\d+)))?$/i)) {
  38. var %m = $Gettok(January February March April May June July August September October November December, $regml(2), 32), %d = $ord($base($regml(3),10,10)), %o = +0, %t
  39. if ($regml(0) > 6) %o = $regml(7) $+ $calc($regml(8) * 3600 + $regml(9))
  40. %t = $calc($ctime(%m %d $regml(1) $regml(4) $+ : $+ $regml(5) $+ : $+ $regml(6)) - %o)
  41. if ($asctime(zz) !== 0 && $regex($v1, /^([+-])(\d\d)(\d+)$/)) {
  42. %o = $regml(1) $+ $calc($regml(2) * 3600 + $regml(3))
  43. %t = $calc(%t + %o )
  44. }
  45. return %t
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement