mIRC Home    About    Download    Register    News    Help

Print Thread
Building Moderator Hash Table on Twitch #245316 16/04/14 07:51 AM
Joined: Apr 2014
Posts: 33
B
bl968 Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
I use a dynamic system that is refreshed in the perform settings on connection. twitchclient 2 has to be set.

/raw twitchclient 2

in the perform I have /msg [your channel name here] .mods

Then this remote captures it and sets the mod table.

on *:text:The moderators of this room are*:?:{
if ($nick != jtv) return
/hfree ops
/hmake ops
/hadd -m ops [put your Broadcaster name here] $ctime
/var %count = $numtok($remove( $7- , $chr(32) ) , 44)
var %i = 1
while (%i <= %count) {
hadd -m ops $gettok($remove( $7- , $chr(32) ) ,%i,44) $ctime
inc %i
}
echo -a The number of ops is %count
}

If a mod is added the bot can be refreshed at any time by restarting or typing .mod in the channel window on the bot.

Once you have the function running, you can stop any function if the user is not an op by using the following command.

if !$hget(ops,$nick) { /halt }

Tested and working in a channel with 87 mods.


Re: Building Moderator Hash Table on Twitch [Re: bl968] #245326 16/04/14 11:57 AM
Joined: Jan 2004
Posts: 1,286
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,286
Aren't all "mods" given +o?

Re: Building Moderator Hash Table on Twitch [Re: Loki12583] #245339 16/04/14 11:28 PM
Joined: Apr 2014
Posts: 33
B
bl968 Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Apr 2014
Posts: 33
Yes but there is no channel user list to check against, so anyone opped before the bot joins will not be able to run commands. Also not all clients may see the +o due to server load. The mods command lets you allow the user even if the bot doesn't see them as currently modded.