mIRC Homepage

(Twitch) Hosting another partnered streamer

Posted By: Bestpeff

(Twitch) Hosting another partnered streamer - 07/11/16 01:37 PM

I ran into this problem with New subs/resub scripts that whenever the channel (that the script is made for) goes into Host mode to another partnered streamer, the script will still trigger in the channel that's in Host mode.

An example is here:

https://gyazo.com/4064a3bd7f05e564acb6b19273b3649b

That user wasn't suppose to receive those points because he's not subscribing to Garge

Here is my script:

Code:
on *:LOGON:*:{
  raw CAP REQ :twitch.tv/membership
  raw CAP REQ :twitch.tv/tags
  raw CAP REQ :twitch.tv/commands
  /debug @raw
}

on 1:TEXT:*just subscribed*:#garge1:{
  if ($chan == #garge1 && $nick == twitchnotify) { 
    msg $chan !bonus $1 1000 
  }
}


raw USERNOTICE:*:{
  if (($msgtags(msg-id).key == resub) && ($1 == #garge1)) {
    var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
    if ($0 == 1) {
      msg $1 !bonus %nick 1000
    }
    else {
      msg $1 !bonus %nick 1000
    }
  }
}


Help would be greatly appreciated <3
Posted By: TillableToast

Re: (Twitch) Hosting another partnered streamer - 07/11/16 10:37 PM

This is what i use for new subs

Code:
on *:TEXT:*subscribed*:#:{
  if ($nick == twitchnotify) {
    if ($5 == $null || $5- == Twitch Prime!) {
      msg # Thank you @ $+ $1 for subscribing!
    }
  }
}


This is for resubs

Code:
raw USERNOTICE:*:{
  if $msgtags(msg-id).key = resub {
    if $target = #yourchannel {
      var %months = $msgtags(msg-param-months).key
      var %user = $replace($iif($msgtags(displayname).key,$msgtags(displayname).key,$msgtags(login).key),\s,$chr(32))
      msg $target @ $+ %user with the resub! Thanks for %months months of support!
    }
  }
}


Cheers! smile
Posted By: Bestpeff

Re: (Twitch) Hosting another partnered streamer - 08/11/16 02:40 AM

@TillableToast,

So if I'm correct...

Code:
if ($5 == $null || $5- == Twitch Prime!) {


works for both new subs that are with Twitch Prime and without Twitch Prime? or just for Twitch Prime only?
Posted By: TillableToast

Re: (Twitch) Hosting another partnered streamer - 08/11/16 08:54 PM

Yes both with and without Twitch prime! laugh

I got this running on a partnered streamer, no issues at all.
Posted By: TillableToast

Re: (Twitch) Hosting another partnered streamer - 08/11/16 08:56 PM

The message is either:
user just subscribed!
or
user just subscribed with Twitch Prime!

$5 is the fifth token in the string, which is NULL(Nothing) in the first message, and "Twitch Prime!" in the second.
Posted By: Bestpeff

Re: (Twitch) Hosting another partnered streamer - 09/11/16 12:32 AM

Ok, thank you for summing this up! It's working perfectly. Appreciate it!
© 2021 mIRC Discussion Forums