mIRC Homepage

(Twitch) Need working Twitch cheer script

Posted By: Bestpeff

(Twitch) Need working Twitch cheer script - 02/10/16 04:42 PM

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
Posted By: keyeslol

Re: (Twitch) Need working Twitch cheer script - 02/10/16 05:41 PM

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.
Posted By: Bestpeff

Re: (Twitch) Need working Twitch cheer script - 02/10/16 11:29 PM

@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
Posted By: keyeslol

Re: (Twitch) Need working Twitch cheer script - 03/10/16 03:38 PM

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.
Posted By: Bestpeff

Re: (Twitch) Need working Twitch cheer script - 04/10/16 02:16 AM

@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? (:
Posted By: keyeslol

Re: (Twitch) Need working Twitch cheer script - 10/10/16 08:40 PM

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**
Posted By: Bestpeff

Re: (Twitch) Need working Twitch cheer script - 11/10/16 03:29 AM

Unfortunately didn't get the right response

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

Re: (Twitch) Need working Twitch cheer script - 13/10/16 10:36 PM

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
  }
}
Posted By: Bestpeff

Re: (Twitch) Need working Twitch cheer script - 20/10/16 02:10 AM

@keyeslol, sorry it took me awhile to get back to this but it does work, thanks a bunch homie
Posted By: Bestpeff

Re: (Twitch) Need working Twitch cheer script - 21/10/16 12:58 PM

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?
Posted By: keyeslol

Re: (Twitch) Need working Twitch cheer script - 24/10/16 12:28 AM

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
  }
}
Posted By: Bestpeff

Re: (Twitch) Need working Twitch cheer script - 27/10/16 12:47 PM

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 
  }
}
Posted By: Bestpeff

Re: (Twitch) Need working Twitch cheer script - 09/11/16 12:33 AM

Anyone have a solution to this? smirk
© 2020 mIRC Discussion Forums