mIRC Homepage
Posted By: bl968 Building Moderator Hash Table on Twitch - 16/04/14 07:51 AM
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.

Aren't all "mods" given +o?
Posted By: bl968 Re: Building Moderator Hash Table on Twitch - 16/04/14 11:28 PM
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.
© mIRC Discussion Forums