mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2014
Posts: 77
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
}

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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) $+ ]
  }
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2015
Posts: 84
F
Babel fish
Offline
Babel fish
F
Joined: Jun 2015
Posts: 84
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) $+ ]
  }
}


Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2014
Posts: 77
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?

Joined: May 2015
Posts: 133
K
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
What doesn't work?


twitter @keyeslol
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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.

Last edited by westor; 22/05/16 05:19 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2014
Posts: 77
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?

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2014
Posts: 77
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?

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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.

Last edited by westor; 23/05/16 12:46 PM.

Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2014
Posts: 77
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 ..





Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
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.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2014
Posts: 77
@Westor if your code is working, previously I was using the code of @Fonic_Artes.

Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
My code is working and you used @Fonic_Artes code.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Jun 2014
Posts: 77
K
Khonor Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2014
Posts: 77
@Westor If I am now using your code, and is working perfect.


Link Copied to Clipboard