mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
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

Last edited by Bestpeff; 07/11/16 01:39 PM.
Joined: May 2016
Posts: 50
T
Babel fish
Offline
Babel fish
T
Joined: May 2016
Posts: 50
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


Life is potato.
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
@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?

Joined: May 2016
Posts: 50
T
Babel fish
Offline
Babel fish
T
Joined: May 2016
Posts: 50
Yes both with and without Twitch prime! laugh

I got this running on a partnered streamer, no issues at all.


Life is potato.
Joined: May 2016
Posts: 50
T
Babel fish
Offline
Babel fish
T
Joined: May 2016
Posts: 50
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.

Last edited by TillableToast; 08/11/16 08:56 PM.

Life is potato.
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Ok, thank you for summing this up! It's working perfectly. Appreciate it!


Link Copied to Clipboard