mIRC Home    About    Download    Register    News    Help

Print Thread
(Twitch) Need working Twitch cheer script #259087 02/10/16 04:42 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Any script out there for Twitch cheer script? and if so....anyway to mess with it so if this were to happen:

User1: cheer1
Me/bot: !bonus User1 10

?? Possible?

Past cheer script would be rigged and give people points who haven't cheered smirk

Re: (Twitch) Need working Twitch cheer script [Re: Bestpeff] #259088 02/10/16 05:41 PM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
Try this

Code:
on $*:text:/(^|\s)cheer\d+(\s|$)/i:#: {
  if (($msgtags(room-id).key == ROOM ID) && ($msgtags(bits).key)) {
    msg # !bonus $msgtags(display-name).key $msgtags(bits).key
  }
}


Make sure you specify your room id. This code will give bonus in the amount they cheer.


twitter @keyeslol
Re: (Twitch) Need working Twitch cheer script [Re: keyeslol] #259091 02/10/16 11:29 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
@keyeslol, thank you for the help again sir, but for instance with this "math" script:

Code:
msg # $iif($regsubex($remove($2-,$chr(32),$chr(44)),/((^|[+-/^*%]+)(([0-9]|\56)+)(k|m|b)|(^|[+-/^*%]+)(([0-9]|\56)+)|(^|[+-/^*%]+)(\50(.+?)\51))/ig,),Invalid math,$iif(!$2,Invalid math, $2- = $regsubex($ticks,$calc($regsubex($ticks,$remove($2-,$chr(44),$chr(32)),/(^|[+-/*%]+|[+-/*%]+\50)(([0-9]|\56)+)(k|m|b)/ig,\1 $+ ( $+ \2 $+ $iif(\4 == b,*1000000000,$iif(\4 == m,*1000000,*1000)) $+ ))),/\G([+-]?\d+?)(?=(?:\d{3})++(?=\.\d++$|$))/g,\1 $+ $chr(44))))


Would there be anyway where you can "multiply the number of bits by 10" or something?

Thanks again bro

Last edited by Bestpeff; 02/10/16 11:29 PM.
Re: (Twitch) Need working Twitch cheer script [Re: Bestpeff] #259099 03/10/16 03:38 PM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
I'm trying to decipher this regex, which i am terrible with. What's the goal here? You could always just read in the bits, to a variable and multiply by 10. Then reference this new value in the msg # code.


twitter @keyeslol
Re: (Twitch) Need working Twitch cheer script [Re: keyeslol] #259102 04/10/16 02:16 AM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
@keyeslol, I'm guessing whatever is the best way to manage however many bits are cheered can be multiplied by 10 which if 1 bits were cheered it would come out to:

!bonus $nick 10

Think it is possible? (:

Re: (Twitch) Need working Twitch cheer script [Re: Bestpeff] #259156 10/10/16 08:40 PM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
Okay so read in your amount cheered. Then multiply by 10.

Code:
on $*:text:/(^|\s)cheer\d+(\s|$)/i:#: {
  %bit.bonus = $msgtags(bits.key) * 10
  if (($msgtags(room-id).key == ROOM ID) && ($msgtags(bits).key)) {
    msg # !bonus $msgtags(display-name).key %bit.bonus
  }
}


Try that.

**Warning untested**


twitter @keyeslol
Re: (Twitch) Need working Twitch cheer script [Re: keyeslol] #259163 11/10/16 03:29 AM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Unfortunately didn't get the right response

Here's what I got: https://gyazo.com/c449472f07e078d47a147d951e28028b

Re: (Twitch) Need working Twitch cheer script [Re: Bestpeff] #259188 13/10/16 10:36 PM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
Try this one.

Code:
on $*:text:/(^|\s)cheer\d+(\s|$)/i:#: {
  if (($msgtags(room-id).key == ROOM ID) && ($msgtags(bits).key)) {
    %bit.bonus = $msgtags(bits).key * 10
    msg # !bonus $msgtags(display-name).key %bit.bonus
  }
}


twitter @keyeslol
Re: (Twitch) Need working Twitch cheer script [Re: keyeslol] #259237 20/10/16 02:10 AM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
@keyeslol, sorry it took me awhile to get back to this but it does work, thanks a bunch homie

Re: (Twitch) Need working Twitch cheer script [Re: Bestpeff] #259244 21/10/16 12:58 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
I ran into a problem when people spam bits.....Is there a way so if the cheers are at least 100 bits or above that'll it'll be shown?

Re: (Twitch) Need working Twitch cheer script [Re: Bestpeff] #259256 24/10/16 12:28 AM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
Posts: 133
Yup.

Code:
on $*:text:/(^|\s)cheer\d+(\s|$)/i:#: {
  if ($msgtags(bits).key <= 100) { return }
  if (($msgtags(room-id).key == ROOM ID) && ($msgtags(bits).key)) {
    %bit.bonus = $msgtags(bits).key * 10
    msg # !bonus $msgtags(display-name).key %bit.bonus
  }
}


twitter @keyeslol
Re: (Twitch) Need working Twitch cheer script [Re: keyeslol] #259280 27/10/16 12:47 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
This doesn't seem to work when I try to change it to 10 for another streamers....

Code:
on $*:text:/(^|\s)cheer\d+(\s|$)/i:#CrashleeTwins: {
  if ($msgtags(bits).key <= 10) { return }
  if (($msgtags(room-id).key == 70771160) && ($msgtags(bits).key)) {
    %bit.bonus = $msgtags(bits).key * 2
    msg # !add %bit.bonus $msgtags(display-name).key 
  }
}

Last edited by Bestpeff; 27/10/16 12:49 PM.
Re: (Twitch) Need working Twitch cheer script [Re: Bestpeff] #259348 09/11/16 12:33 AM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Anyone have a solution to this? smirk