#264611 - 20/12/18 10:12 PM
Script Response Time
|
Babel fish
Registered: 04/12/18
Posts: 51
|
So to sum it up i have the following code in a channel on Twitch raw USERNOTICE:*:{
if (($msgtags(msg-id).key == sub) && ($msgtags(room-id).key == 30084163)) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
var %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99, Prime, Prime)
msg $1 /me agonySUB NEW SUB!! agonySUB Thank You %nick For Subscribing With A %sub-plan Sub! Welcome To The Legends! agonyHYPERS bingAw
}
if (($msgtags(msg-id).key == resub) && ($msgtags(room-id).key == 30084163)) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99, Prime, Prime)
msg $1 /me bingAw RESUB!! rooAww %nick Has Just Resubscribed For $msgtags(msg-param-months).key Months In A Row With A %sub-plan Sub! Welcome Back To The Legends! bingAw rooAww
}
if (($msgtags(msg-id).key == subgift) && ($msgtags(room-id).key == 30084163)) {
var %nick_from $iif($msgtags(display-name).key, $v1, $msgtags(login).key) , %nick_to $iif($msgtags(msg-param-recipient-display-name).key, $v1, $msgtags(msg-param-recipient-user-name).key)
VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99)
msg $1 /me rooGift GIFTED SUB!! rooGift Thank you %nick_from For Gifting A %sub-plan Sub To %nick_to $+ ! Welcome To The Legends! rooGift rooGift
}
And it works perfectly at announcing subs but the problem is it doesnt announce mass gifted sub. For example last night someone gifted 40 subs and my bot only announced 30. Any help?
|
Top
|
|
|
|
#264614 - 20/12/18 11:21 PM
Re: Script Response Time
[Re: TroyL]
|
Hoopy frood
Registered: 12/01/04
Posts: 1057
|
I altered your code slightly. 1. I added 1 check at the top which makes this handler ignore everything without the correct room key. This avoids the need to keep checking if the room key is correct. 2. I then added something that displays incoming messages to a @Subs window. If I didn't add everything, you can easily add additional debug display info. I don't know the format, but it would be nice to show the entire USERNOTICE as well, as a separate echo to @Subs. This should allow you to see whether there was a problem with the script, or in fact you did not receive a server message showing the other subs. 3. I changed the format of the event handler into having the later IF statements using the ELSE logic. It looks like your handler is looking for 3 specific values for the msg-id.key, so this way you can identify any usermessages that had a different string which should be handled but did not. 4. The code you pasted was missing the brace at the very end, so I added it. Hopefully it's already there in your code, which you can verify by either pressing Ctrl+H in the scripts editor, or clicking the checkmark icon in the upper right corner. 5. I vaguely recall forum posts mentioning certain situations where twitch blocks flooding messages, but I'm not sure whether that was messages received-by the channel owner or messages made-by the owner. Instead of using the -t switch where echo would use the 'timestamp' format, I used $time which shows the seconds. This lets you see if subs messages come in a burst or are spaced seconds apart.
raw USERNOTICE:*:{
if ($msgtags(room-id).key != 30084163) return
if (!$window(@Subs)) window @Subs
echo $+([,$time,]) @Subs msg-id.key $msgtags(msg-id).key display-name.key: $msgtags(display-name).key msg-param-sub-plan.key: $msgtags(msg-param-sub-plan).key
if ($msgtags(msg-id).key == sub) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
var %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99, Prime, Prime)
msg $1 /me agonySUB NEW SUB!! agonySUB Thank You %nick For Subscribing With A %sub-plan Sub! Welcome To The Legends! agonyHYPERS bingAw
}
elseif ($msgtags(msg-id).key == resub) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99, Prime, Prime)
msg $1 /me bingAw RESUB!! rooAww %nick Has Just Resubscribed For $msgtags(msg-param-months).key Months In A Row With A %sub-plan Sub! Welcome Back To The Legends! bingAw rooAww
}
elseif ($msgtags(msg-id).key == subgift) {
var %nick_from $iif($msgtags(display-name).key, $v1, $msgtags(login).key) , %nick_to $iif($msgtags(msg-param-recipient-display-name).key, $v1, $msgtags(msg-param-recipient-user-name).key)
VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99)
msg $1 /me rooGift GIFTED SUB!! rooGift Thank you %nick_from For Gifting A %sub-plan Sub To %nick_to $+ ! Welcome To The Legends! rooGift rooGift
}
else {
echo 4 @Subs Warning: The above message was not handled.
}
}
|
Top
|
|
|
|
#264615 - 20/12/18 11:34 PM
Re: Script Response Time
[Re: maroon]
|
Babel fish
Registered: 04/12/18
Posts: 51
|
Thank you! Do i need to add anything to this or is it fine the way it is? Another thing is what is the sub window for and i gifted a sub and it said "Warning: the above message was not handled." What does that mean? What does this script do? Does it speed up the announcement or does it make it be able to spam the gifted sub messages if someone gifts a mass amount of subs?
|
Top
|
|
|
|
#264617 - 21/12/18 02:08 AM
Re: Script Response Time
[Re: maroon]
|
Babel fish
Registered: 04/12/18
Posts: 51
|
So will this basically make my bot faster at responding at subs and other stuff?
|
Top
|
|
|
|
#264625 - 21/12/18 05:47 PM
Re: Script Response Time
[Re: maroon]
|
Babel fish
Registered: 04/12/18
Posts: 51
|
Makes sense thank you for all of the help. I turned off flood protection so would i select the "own messages" box?
|
Top
|
|
|
|
#264807 - 13/01/19 02:12 PM
Re: Script Response Time
[Re: maroon]
|
Bowl of petunias
Registered: 13/01/19
Posts: 2
|
Hey Maroon. First sorry for my bad english. But i need ur help with the Script. Sub and Resub works fine but i have a problem with "sub-gifts". On single gifts its work fine but on mass-gifts it's spam with every single gift. Is there a way to separate it? individual gifts and mass gifts?
on *:LOGON:*:{
raw CAP REQ :twitch.tv/membership
raw CAP REQ :twitch.tv/tags
raw CAP REQ :twitch.tv/commands
/debug @raw
}
raw USERNOTICE:*:{
if ($msgtags(room-id).key != 103495737) return
if (!$window(@Subs)) window @Subs
echo $+([,$time,]) @Subs msg-id.key $msgtags(msg-id).key display-name.key: $msgtags(display-name).key msg-param-sub-plan.key: $msgtags(msg-param-sub-plan).key
}
if ($msgtags(msg-id).key == sub) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
var %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99, Prime, Prime)
msg $1 shoxx91Herzz %nick shoxx91Herzz Danke für deine %sub-plan Sub! shoxx911hype Willkommen in der Shoxx-Community! shoxx91Herzz shoxx91Herzz
msg $1 shoxx91Herzz shoxx911hype shoxx91SHype shoxx91SHype shoxx91SHype shoxx91SHype shoxx91SHype shoxx911hype shoxx91Herzz
msg $1 shoxx91Herzz shoxx911hype shoxx91SHype shoxx91SHype shoxx91SHype shoxx91SHype shoxx91SHype shoxx911hype shoxx91Herzz
}
elsif ($msgtags(msg-id).key == resub) {
var %nick $iif($msgtags(display-name).key, $v1, $msgtags(login).key)
VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99, Prime, Prime)
msg $1 shoxx91Herzz %nick shoxx91Herzz Danke für deinen ReSub im $msgtags(msg-param-months).key Monat in folge mit einem %sub-plan Sub! shoxx91Herzz shoxx91Herzz
msg $1 shoxx91Herzz shoxx911hype shoxx91SHype shoxx91SHype shoxx91SHype shoxx91SHype shoxx91SHype shoxx911hype shoxx91Herzz
msg $1 shoxx91Herzz shoxx911hype shoxx91SHype shoxx91SHype shoxx91SHype shoxx91SHype shoxx91SHype shoxx911hype shoxx91Herzz
}
elseif ($msgtags(msg-id).key == subgift) {
var %nick_from $iif($msgtags(display-name).key, $v1, $msgtags(login).key) , %nick_to $iif($msgtags(msg-param-recipient-display-name).key, $v1, $msgtags(msg-param-recipient-user-name).key)
VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99)
msg $1 shoxx91Herzz shoxx911hype %nick_from shoxx911hype shoxx91Herzz Danke das du einen %sub-plan Sub an %nick_to $+ verschenkt hast! shoxx911hype shoxx91Herzz
}
elsif ($msgtags(msg-id).key == bits) {
?????? ?????? ?????
}
}
}
else {
echo 4 @Subs Warning: The above message was not handled.
}
}
That mean for Single Sub-gifts this
elseif ($msgtags(msg-id).key == subgift) {
var %nick_from $iif($msgtags(display-name).key, $v1, $msgtags(login).key) , %nick_to $iif($msgtags(msg-param-recipient-display-name).key, $v1, $msgtags(msg-param-recipient-user-name).key)
VAR %sub-plan $replace($msgtags(msg-param-sub-plan).key, 1000, $chr(36) $+ 4.99, 2000, $chr(36) $+ 9.99, 3000, $chr(36) $+ 24.99)
msg $1 shoxx91Herzz shoxx911hype %nick_from shoxx911hype shoxx91Herzz Danke das du einen %sub-plan Sub an %nick_to $+ verschenkt hast! shoxx911hype shoxx91Herzz
}
and when a user spend more then 1 Sub the Script only post 3 line of hype? and the Second question. Can u help me with a Bit thanks? Thanks for all.
|
Top
|
|
|
|
|
|