mIRC Homepage
Posted By: FluffehKitteh [Twitch] if (nick isop) not working - 20/07/15 07:06 PM
So i'm having trouble trying to figure out why my script isn't working for mods in twitch chat, this is how I have it setup right now:

Code:
on *:TEXT:!echo *:#: {

  if ($nick == fluffehkittehn) {

    .timer 1 .03 describe # $2-
    .timer 1 .06 describe # $2-
    .timer 1 .09 describe # $2-
    .timer 1 .12 describe # $2-
    .timer 1 .15 describe # $2-
    .timer 1 .18 describe # $2-
  }
} 

And it works like it should, but that makes it so only I can use it. is there anyway I can make it so I can add names? Or am I just not doing the if ($nick isop #) { correctly...?

This is how it is when I try the so ops can use it, but nothing happens when we try.

Code:
on *:TEXT:!echo *:#: {

  if ($nick isop #) {

    .timer 1 .03 describe # $2-
    .timer 1 .06 describe # $2-
    .timer 1 .09 describe # $2-
    .timer 1 .12 describe # $2-
    .timer 1 .15 describe # $2-
    .timer 1 .18 describe # $2-
  }
} 

Any ideas?
Posted By: Nillen Re: if (nick isop) not working - 20/07/15 07:14 PM
Did you manually check that the user himself is recognized as an op by mIRC?

Are you using the same event twice in the remote script file or are you replacing the first one with the second one?
Posted By: FluffehKitteh Re: if (nick isop) not working - 20/07/15 07:18 PM
Oh is there a way to check if i'm op by mIRC?

And i'm replacing the first one with the second one
Posted By: Nillen Re: if (nick isop) not working - 20/07/15 08:34 PM
First of all, do you receive a nicklist at all when entering twitch channels? If not then you're not requesting membership for it. Try adding this to your remote script file and restart mIRC.
Code:
on 1:connect: {
if ($server == tmi.twitch.tv) {
/raw CAP REQ :twitch.tv/membership
}
}
This will populate the nicklist when entering a channel. Op users will have a @ displayed in their nick.
Posted By: FluffehKitteh Re: if (nick isop) not working - 20/07/15 08:49 PM
Okay so I did that then I got my main account op which is awesome, and the command works for the op'd account but the "bot" account isn't op'd
Yay! I got it fixed, thank you for helping me Nillen!
Posted By: Karotte Re: [Twitch] if (nick isop) not working - 14/08/15 01:38 PM
hey guys, can you help me?

i got this script:

on *:text:!top10:#: {
if ($nick != isop) {
if ((%floodcommand) || ($($+(%,floodcommand.,$nick),2))) { return }
set -u120 %floodcommand On
set -u10 %floodcommand. $+ $nick
msg $chan !top 10
}
}

the part with "if nick is op" is not correct i guess...my problem is -> the bot should write !top 10 when USER write !top 10, but NOT when mods write !top 10, so is there a function called NOT OPERATOR? != isop?
Posted By: powerade661 Re: [Twitch] if (nick isop) not working - 14/08/15 03:17 PM
This should work for you. I haven't tested it. Basically != means is not equal to. Try it out and let me know how it works for you. By the way, you were missing # after isop and also { return } If you do { then that means that it will tell the script to say ok, if they are not an OP I will continue on with the code.

Code:
on *:text:!top10:#: {
if ($nick !=isop #) { return }
if ((%floodcommand) || ($($+(%,floodcommand.,$nick),2))) { return }
set -u120 %floodcommand On
set -u10 %floodcommand. $+ $nick
msg $chan !top 10
}

Posted By: FreeTrav Re: [Twitch] if (nick isop) not working - 15/08/15 07:15 PM
Originally Posted By: Karotte
hey guys, can you help me?

i got this script:

on *:text:!top10:#: {
if ($nick != isop) {
if ((%floodcommand) || ($($+(%,floodcommand.,$nick),2))) { return }
set -u120 %floodcommand On
set -u10 %floodcommand. $+ $nick
msg $chan !top 10
}
}

the part with "if nick is op" is not correct i guess...my problem is -> the bot should write !top 10 when USER write !top 10, but NOT when mods write !top 10, so is there a function called NOT OPERATOR? != isop?


The syntax of the test for whether a person is an operator in a channel should be written as follows, per the mIRC help file:
Code:
if ( $nick isop $chan ) { ... }

Since you want to test for the person not being an operator, use the ! prefix:
Code:
if ( $nick !isop $chan ) { ... }
© mIRC Discussion Forums