mIRC Homepage
Posted By: Khonor [Twitch] Help with subscribed notification - 22/05/16 04:54 AM
Hi,

I wonder if there is any way to make count subscribed and re-subscribing, will automatically reset to 0 at a specific time? I appreciate any advice or help.






That is: Suppose I have [New Subs Today: 10] and [Resubs: 20] [Total: 30] And program it for example at "00:00hrs" and the count is reset automatically to 0, and starting again.












on *:text:*:#: {
if ($nick == twitchnotify) {

.timer_sub_reset 23:59 1 0 /set %sub 0
.timer_sub_reset 23:59 1 0 /set %resub 0


if (($3 == to) || ($4 == to)) { return }


if ($5 == months) {
inc %resub

msg # /me - $1 thank you for the $4 months of support. - [New Subs Today: %sub $+ ] and [Resubs: %resub $+ ] [Total: $sub_total(%sub,%resub) $+ ]
}
if ($2 == just) {
inc %sub

msg # /me - $1 thank you for subscribing, please enjoy your emotes to use all across Twitch. - [New Subs Today: %sub $+ ] and [Resubs: %resub $+ ] [Total: $sub_total(%sub,%resub) $+ ]
}
}
}

alias sub_total {

var %sub_total = $calc(%sub + %resub)
return %sub_total
}
Try use this code:

NOTE: Reconnect the bot to the server after you paste the new code.

Code:
alias sub_reset { set %sub 0 | set %resub 0 }

ON *:CONNECT: { .timer[RESET_SUBS] 23:59 1 0 sub_reset }
ON *:TEXT:*:#: {
  if ($nick !== twitchnotify) { return }
  if ($3 == to) || ($4 == to) { return }
  if ($5 == months) {
    inc %resub 1
    msg # /me - $1 thank you for the $4 months of support. - [New Subs Today: %sub $+ ] and [Resubs: %resub $+ ] [Total: $calc(%sub + %resub) $+ ]
  }
  if ($2 == just) {
    inc %sub 1
    msg # /me - $1 thank you for subscribing, please enjoy your emotes to use all across Twitch. - [New Subs Today: %sub $+ ] and [Resubs: %resub $+ ] [Total: $calc(%sub + %resub) $+ ]
  }
}
Hey, I know that code. That code is old and could probably be reworked as westor has done there.

Let's go with this, following westor there as well with the timer.
Code:
alias sub_reset { set %sub 0 | set %resub 0 }

ON *:CONNECT: { .timer_SUBRESET 00:00 1 61 sub_reset }

ON *:TEXT:#: {
  if ($nick != twitchnotify || ($istok($1-,subscribed to,32)) { halt }
  if ($istok($1-,months,32)) {
    inc %resub 1
    msg # /me - $1 $+ , thank you for the $4 months of support. [New Subs: %sub $+ ] [Resubs: %resub $+ ] [Total: $calc(%sub + %resub) $+ ]
  }
  if ($istok($1-,just subscribed,32)) {
    inc %sub 1
    msg # /me - $1 $+ , thank you for subscribing, please enjoy your emotes to use all across Twitch. - [New Subs: %sub $+ ] and [Resubs: %resub $+ ] [Total: $calc(%sub + %resub) $+ ]
  }
}

Thanks @Fonic_Artes,

Does not work, maybe it's because I'm using mTwitch - Twitch normalizer for mIRC, you might not be compatible with that?
What doesn't work?
Originally Posted By: Khonor
Thanks @Fonic_Artes,

Does not work, maybe it's because I'm using mTwitch - Twitch normalizer for mIRC, you might not be compatible with that?


Try put the code into a new file into the script editor in remotes tab and try again. as i note above reconnect the bot in the server in order to start the timer.

@Fonic_Artes you had change the timer trigger time and that will not be correct as the user want it to trigger in 23:59 and not 00:01:01 as you have in your code.
Hi @Westor,

I already did, I tested restarting several times but does not respond, someone subscribing to channel and the bot does nothing. It will be because I'm using mTwitch - Twitch normalizer for mIRC?
Can you give here the full server message that you receive when someone subscribing to the channel?

This code if you follow the steps above does not effected by other code because it working into an other script file.
Message that I receive when someone subscribing to the channel:


<twitchnotify> BattleExplosion subscribed for 2 months in a row! and

<twitchnotify> winston9816 just subscribed!


That's what you mean?
The code seems to work.

Try use the latest mIRC version then copy/paste the code from this post into a NEW file in the Script Editor in Remotes tab (Alt +r -> File -> New), make sure that the only code is that you have copy/paste and NOT ANY OTHER CODE INSIDE THE FILE.

If it still doesn't work then at 99% your steps are incorrect.
Hi @Westor,

I'm using: mIRC v7.45

Now what I have in my mIRC is only this command nothing more, but still does not answer which will not be the problem ..




You did not followed my steps correct because you have copy an other code that is not mine as i have post in the link that i gave you in my previous post.
@Westor if your code is working, previously I was using the code of @Fonic_Artes.
My code is working and you used @Fonic_Artes code.
@Westor If I am now using your code, and is working perfect.
© mIRC Discussion Forums