mIRC Homepage
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
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.
@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
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.
@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? (:
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**
Unfortunately didn't get the right response

Here's what I got: https://gyazo.com/c449472f07e078d47a147d951e28028b
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
  }
}
@keyeslol, sorry it took me awhile to get back to this but it does work, thanks a bunch homie
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?
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
  }
}
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 
  }
}
Anyone have a solution to this? smirk
© mIRC Discussion Forums