mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2016
Posts: 86
B
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

Joined: May 2015
Posts: 133
K
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
Joined: Apr 2016
Posts: 86
B
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.
Joined: May 2015
Posts: 133
K
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
Joined: Apr 2016
Posts: 86
B
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? (:

Joined: May 2015
Posts: 133
K
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
Joined: Apr 2016
Posts: 86
B
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

Joined: May 2015
Posts: 133
K
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
Joined: Apr 2016
Posts: 86
B
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

Joined: Apr 2016
Posts: 86
B
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?

Joined: May 2015
Posts: 133
K
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
Joined: Apr 2016
Posts: 86
B
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.
Joined: Apr 2016
Posts: 86
B
Babel fish
OP Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
Anyone have a solution to this? smirk


Link Copied to Clipboard