Online mods (need help)

By Ireliavent on Oct 01, 2015

I need help correcting this "Online mods" script. I've been searching around with no luck, and I haven't found one yet. Here's my script so far;

ON *:TEXT:*:#: {
  ;Online mods
  if (!mods == $1) {
    var %t = 1
    if (%t <= $nick($chan,0,o)) {
      var %tmod = $iif(%tmod,%tmod $nick($chan,%t,o),$nick($chan,%t,o))
      inc %t
    }
    msg $chan Online mods: $iif(%tmod,%tmod,None)
  }
}

Thanks in advance!

Comments

Sign in to comment.
Ireliavent   -  Oct 02, 2015

The "ismod" alias for deciding if a user is mod or not.

Ireliavent  -  Oct 02, 2015

I also noted by going to that tmi.twitch.tv site, you're presenter with a list of active chatters. That means you're also given a list of active moderators. Is that usable?

Sign in to comment

Vegito   -  Oct 02, 2015

Try this:

ON *:TEXT:!mods*:#: {
  var %i = $nick($chan,0,o)
  while (%i) {
    if ($nick($chan,%i,o)) var %tmod = $addtok(%tmod, $v1 $+ $chr(44), 32)
    dec %i
  }
  msg $chan Online mods: $iif(%tmod, $left($sorttok(%tmod, 32), -1), None)
}
Ireliavent  -  Oct 02, 2015

Thanks for the reply, but it didn't work for me, sadly. I'll give you two pictures that are relevant to this on a imgur thread below. Also note that I am using the ON :TEXT::#: {*, it's just not showing as I'm using a larger script.

Link to script & return: http://imgur.com/a/PCkCe

Vegito  -  Oct 02, 2015

Do you have multiple on text event scripts in one file?
If thats the case try loading the script I've posted above in a new file.

Also I've updated the script above.

You can also do it like the following:

ON *:TEXT:!mods*:#: {
  var %i = $nick($chan,0)
  while (%i) {
    if ($nick($chan,%i) isop $chan) var %tmod = $addtok(%tmod, $v1 $+ $chr(44), 32)
    dec %i
  }
  msg $chan Online mods:  $iif(%tmod, $left($sorttok(%tmod, 32), -1), None)
}

This will also mention the F, CF, SoP if the server you on supports them.

Ireliavent  -  Oct 02, 2015

I believe I found what's the cause of the problem. Twitch doesn't accept the normal term "isop", as in ($nick isop $chan), instead we have to use an alias. I called the alias "ismod". I'm going to print it in another thread.

Are you able to make this work using an alias to decide whether a user is mod or not? If so, are you able to display their names?
And I don't need the F, CF, SoP and AoP (if it takes up extra space).

EDIT: I do REALLY appreciate the work you are putting in to help me solve this.

Charus  -  Oct 03, 2015

isop is not a twitch term... Its an mIRC identifier... You use that for a twitch channel? Do you request membership so you can see the users list?

edit: Do not create a variable inside a loop, each time you pass the loop the variable will be created again and again...
If you need more help join #mirc channel at freenode

Vegito  -  Oct 04, 2015

@Ireliavent I've never used Twitch before no idea how it works.

Charus  -  Oct 04, 2015

First of all you need to send a CAP request to be able to see the userlist. Im like 99% sure he didnt send that command and he is not able to get the users of the channel. the command is:


on *:CONNECT:{
if (twitch.tv isin $server) {
CAP REQ :twitch.tv/commands
CAP REQ :twitch.tv/membership
echo -se Membership request send!
}
}

Sign in to comment

Charus   -  Oct 02, 2015


on *:TEXT:!mods:#:{
;Online mods
var %mods = $null
var %t = 1
while ($nick($chan, %t, o)) {
%mods = %mods $+ $chr(44) $+ $nick($chan, %t, o)
inc %t
}
msg $chan Online mods: $iif(%mods, $right(%mods, -1), None)
}

Ireliavent  -  Oct 02, 2015

Did you test this? It didn't work for me.

Charus  -  Oct 02, 2015

Yes i test it and its working

Ireliavent  -  Oct 02, 2015

The only output I get is "Online mods: None", even if there are multiple mods in the channel.

Vegito  -  Oct 02, 2015

That works for me.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.