-
Notifications
You must be signed in to change notification settings - Fork 15
/
hosts.mrc
23 lines (21 loc) · 1.11 KB
/
hosts.mrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;; !HOSTS COMMAND ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; This script relies on sections of BlasBot.mrc, otherwise you will have to edit the script to work properly without it.
ON *:TEXT:!hosts:%mychan: {
IF (($ModCheck) && (!%CD_hosts)) {
SET -eu10 %CD_hosts On
JSONOpen -uw gethosts http://tmi.twitch.tv/hosts?include_logins=1&target= $+ %TwitchID $+ &nocache= $+ $ticks
JSONHttpHeader gethosts Client-ID avm4vi7zv0xpjkpi3d4x0qzk8xbrdw8
JSONHttpFetch gethosts
VAR %x = 0, %hosts
WHILE ($json(gethosts, hosts, %x, host_login).value) {
VAR %hosts %hosts $cached_name($v1) $+ $chr(44)
INC %x
}
IF (%hosts) MSG $chan bleedPurple Thank You to all the $numtok(%hosts, 32) awesome people who are currently hosting this stream: $left($sorttok(%hosts , 32, a), -1) bleedPurple
ELSE MSG $chan $nick $+ , no one is hosting the channel at the moment. FeelsBadMan
JSONClose gethosts
HSAVE -o displaynames displaynames.htb
}
}