mIRC Home    About    Download    Register    News    Help

Print Thread
(Twitch) Users add themselves to a command #257856 21/05/16 04:21 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
So earlier in this post ( http://forums.mirc.com/ubbthreads.php/topics/257699/Re:_(Twitch)_Subscriber_add_th#Post257699 ) I had help from great people letting me know how to get twitch subscribers to add themselves to a !line command and it worked perfect. Only thing about that script is that I needed moderators to be able to edit the line to remove certain people and so mods can !reset the entire line. But I also need it for a regular stream (not partnered) so they can use it. So whenever a follower wants to play they can do the whole !addme and !removeme type deal.....can I get some help? It would be greatly appreciated

Re: (Twitch) Users add themselves to a command [Re: Bestpeff] #257860 21/05/16 10:31 PM
Joined: Sep 2014
Posts: 259
S
Sakana Offline
Fjord artisan
Offline
Fjord artisan
S
Joined: Sep 2014
Posts: 259
If you keep the names in a global variable like this
%list = player1 player2 player3
then this should do it

Code:
on *:text:!removeme:#: { 
set %list $remtok(%list,$nick,32)
msg # $nick removed.
}

Last edited by Sakana; 21/05/16 10:31 PM.
Re: (Twitch) Users add themselves to a command [Re: Sakana] #257861 21/05/16 10:37 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
This was the original script, I already had a !removeme but I need it to have a moderators only command to remove certain people from the list and have moderators to be able to !reset the list, and I need just an orginal script for non partnered streams (the commands don't just work for subscribers but for viewers)

ON *:CONNECT: IF ($server == tmi.twitch.tv) CAP REQ :twitch.tv/commands twitch.tv/tags twitch.tv/membership

ON *:TEXT:!addme:#: {
IF (($msgtags(subscriber).key) && (!$istok(%sub_list,$nick $+ $chr(44),32))) {
SET %sub_list %sub_list $nick $+ $chr(44)
MSG $chan $nick $+ , you have been added to the !list.
}
}

ON *:TEXT:!removeme:#: {
IF ($istok(%sub_list,$nick $+ $chr(44),32)) {
SET %sub_list $remtok(%sub_list,$nick $+ $chr(44),0,32)
MSG $chan $nick $+ , you have been removed from the !list.
}
}

ON *:TEXT:!list:#: MSG $chan $left(%sub_list,-1)

Re: (Twitch) Users add themselves to a command [Re: Bestpeff] #257862 21/05/16 10:38 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Any help is greatly appreciated <3

Re: (Twitch) Users add themselves to a command [Re: Bestpeff] #257869 22/05/16 05:38 AM
Joined: Oct 2015
Posts: 112
B
Blas Offline
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
This should let mods do "!remove username" and "!rem username" to delete a name from the list, as well as "!reset" to reset the line. I don't have any time at the moment to edit the script so that only followers (instead of subscribers) can add themselves.

Code:
ON *:TEXT:!addme:#: {
  IF (($msgtags(subscriber).key) && (!$istok(%sub_list,$nick $+ $chr(44),32))) {
    SET %sub_list %sub_list $nick $+ $chr(44)
    MSG $chan $nick $+ , you have been added to the !list.
  }
}

ON *:TEXT:!removeme:#: {
  IF ($istok(%sub_list,$nick $+ $chr(44),32)) {
    SET %sub_list $remtok(%sub_list,$nick $+ $chr(44),0,32)
    MSG $chan $nick $+ , you have been removed from the !list.
  }
}

ON *:TEXT:!list:#: MSG $chan $left(%sub_list,-1)

ON $*:TEXT:/^!rem(ove)?/iS:#: {
  IF (($nick isop $chan) && ($istok(%sub_list,$2 $+ $chr(44),32))) {
    SET %sub_list $remtok(%sub_list,$2 $+ $chr(44),0,32)
    MSG $chan $nick $+ , $2 has been removed from the !list.
  }
}

ON *:TEXT:!reset:#: {
  IF ($nick isop $chan) {
    UNSET %sub_list
    MSG $chan $nick $+ , the !list has been reset.
  }
}

Re: (Twitch) Users add themselves to a command [Re: Blas] #257878 22/05/16 01:59 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
This works perfect!! One question tho is that I have my bot (main Twitch account) connected to multiple channels and most of them are partnered, is there anyway to have the script be made so it could be in multiple channels?? I tried putting the channel name after the # and that unfortunately did not work frown

Re: (Twitch) Users add themselves to a command [Re: Bestpeff] #257885 22/05/16 04:27 PM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
add this when you set your $var

Code:
[ $+ [ $chan ] ]


twitter @keyeslol
Re: (Twitch) Users add themselves to a command [Re: keyeslol] #257893 22/05/16 10:13 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Thanks so much!! Only thing I need to figure out is that entire script for followers of a channels. Is there a %setlist $followercheck or something like that? frown

Re: (Twitch) Users add themselves to a command [Re: Bestpeff] #257969 27/05/16 03:54 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
So the script is amazing, works amazing and no problems, only thing I ran into was subs that weren't suppose to be in the list so is there a !listban (user) or something like that just so subs won't be allowed to join the list, and obviously a !listunban for whenever they can join it again, help greatly appreciated, thanks smile

Re: (Twitch) Users add themselves to a command [Re: Bestpeff] #257971 27/05/16 11:12 PM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
Yes it is, take out the part where your code is checking if subscriber isin $msgtags. You may want to rename your variables a bit, because it does say %sub_list.

To make it dynamic, i would set a variable for !listban and then in your first line of code, check to see if %listban exists.

Something like:

Code:
if (%listban) { return }


twitter @keyeslol
Re: (Twitch) Users add themselves to a command [Re: keyeslol] #257990 31/05/16 11:52 AM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
So it's the script would look like:

ON *:TEXT:!listban:#: {
if (%listban) { return }
SET %sub_list $remtok(%sub_list,$nick $+ $chr(44),0,32)
MSG $chan $nick $+ , you have been removed from the !list.
}
}

Like this?? and if so what about a !listunban ??

Re: (Twitch) Users add themselves to a command [Re: Bestpeff] #257992 31/05/16 07:17 PM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
Like,

Code:
on *:TEXT:!listban:#: {
  set %listban on
}

then in your original add me code, add the following to the first line of !addme. Also, make sure you remove subscriber in msg tag.

Code:
if (%listban) { return }


twitter @keyeslol
Re: (Twitch) Users add themselves to a command [Re: keyeslol] #258024 04/06/16 09:27 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
What about an !listunban ??

on *:TEXT:!listunban:#: {
unset %listban off
}

????