Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON *:CONNECT: {
- if (twitch isin $server) {
- .raw CAP REQ :twitch.tv/membership
- .raw CAP REQ :twitch.tv/commands
- .raw CAP REQ :twitch.tv/tags
- }
- }
- ON *:TEXT:*:#: {
- tokenize 32 $strip($1-)
- if ($1 == !hours) {
- if (%floodpoints) || (%floodpoints. [ $+ [ $nick ] ]) { return }
- set -eu10 %floodpoints 1
- set -eu30 %floodpoints. $+ $nick 1
- if ($2) { var %p = $points($chan,$2) }
- elseif (!$2) { var %p = $points($chan,$nick) }
- var %tot = $floor($calc(%p / 12))
- msg $chan ( $+ $nick $+ ): $iif($2,The $+ $nick $+ nickname has,You have) %tot total hour(s) on the channel.
- }
- if ($1 == !mypoints) {
- if (%floodpoints2) || (%floodpoints2. [ $+ [ $nick ] ]) { return }
- set -eu10 %floodpoints2 1
- set -eu30 %floodpoints2. $+ $nick 1
- var %p = $points($chan,$nick)
- if (!%p) { msg $chan ( $+ $nick $+ ): You have not any point earned yet! | return }
- msg $chan ( $+ $nick $+ ): You have $iif(%p == 1, $+ $+ %p $+ point, $+ $+ %p $+ points) $+ .
- }
- if ($1 == !viewpoints) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- if (!$2) { msg $chan $nick ( $+ $nick $+ ): Error, Please specify an nickname! | return }
- var %p = $points($chan,$2)
- if (!%p) { msg $chan ( $+ $nick $+ ): Error, The $+ $2 $+ nickname has NOT earned any point yet! | return }
- msg $chan ( $+ $nick $+ ): The $2 user $iif(%p == 1,has $+ %p $+ point,have $+ %p $+ points) $+ .
- }
- if ($1 == !points) {
- var %l = +,-,total
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- if (!$2) { msg $chan ( $+ $nick $+ ): Error, Please specify an option! - (Options: $+ %l $+ ) | return }
- if (!$istok(%l,$2,44)) { msg $chan ( $+ $nick $+ ): Error, Please specify an vaild option! - (Options: $+ %l $+ ) | return }
- if ($2 == +) {
- if (!$3) { msg $chan ( $+ $nick $+ ): Error, Please specify a nickname! | return }
- if (!$4) { msg $chan ( $+ $nick $+ ): Error, Please specify an number! | return }
- if (!$isdig($4)) { msg $chan ( $+ $nick $+ ): Error, Please specify an digital number! | return }
- points+ $chan $3 $4
- msg $chan ( $+ $nick $+ ): $+ $4 $+ points have been added to $+ $3 $+ nickname.
- }
- if ($2 == -) {
- if (!$3) { msg $chan ( $+ $nick $+ ): Error, Please specify a nickname! | return }
- if (!$4) { msg $chan ( $+ $nick $+ ): Error, Please specify an number! | return }
- if (!$isdig($4)) { msg $chan ( $+ $nick $+ ): Error, Please specify an digital number! | return }
- points- $chan $3 $4
- msg $chan ( $+ $nick $+ ): $+ $4 $+ points have been removed from $+ $3 $+ nickname.
- }
- if ($2 == total) {
- var %f = $mircdirpoints\ $+ $mkfn($chan) $+ .db
- var %t = $lines(%f)
- if (%t) { msg $chan ( $+ $nick $+ ): There are $+ %t $+ nicknames into the channel database. }
- elseif (!%t) { msg $chan ( $+ $nick $+ ): There is NOT any user into the channel database yet! }
- }
- }
- if ($1 == !top1) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- give_top 1 $chan $nick
- }
- if ($1 == !top3) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- give_top 3 $chan $nick
- }
- if ($1 == !top5) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- give_top 5 $chan $nick
- }
- if ($1 == !top10) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- give_top 10 $chan $nick
- }
- if ($1 == !top15) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- give_top 15 $chan $nick
- }
- if ($1 == !help) { msg $chan ( $+ $nick $+ ): Available Commands: !top1 - !top3 - !top5 - !top10 - !top15 - !points <+|-|total> <Nickname> <Points> - !viewpoints <Nickname> - !mypoints - !hours [Nickname] }
- }
- ON *:PART:#: {
- if ($nick !== $me) { .timer[points_ $+ $chan $+ _ $+ $nick $+ ] off }
- elseif ($nick == $me) { .timer[points_ $+ $chan $+ _*] off }
- }
- ON !*:JOIN:#:{
- .timer[points_ $+ $chan $+ _ $+ $nick $+ ] 0 300 points+ $chan $nick 1
- points+ $chan $nick 1
- }
- alias points+ {
- if ($0 !== 3) { return }
- var %dir = $mircdirpoints
- if (!$isdir(%dir)) { mkdir points }
- var %f = $mircdirpoints\ $+ $mkfn($1) $+ .db
- var %r = $read(%f,nw,* $+ $2 $+ *)
- var %rn = $readn
- var %p = $gettok(%r,2,32)
- var %add = $calc(%p + $3)
- if (%rn) { write -dl $+ %rn $qt(%f) | write $qt(%f) $2 %add }
- elseif (!%rn) { write $qt(%f) $2 %add }
- }
- alias points- {
- if ($0 !== 3) { return }
- var %f = $mircdirpoints\ $+ $mkfn($1) $+ .db
- if (!$isfile(%f)) { return }
- var %r = $read(%f,nw,* $+ $2 $+ *)
- var %rn = $readn
- var %p = $gettok(%r,2,32)
- var %rem = $calc(%p - $3)
- if (%rn) {
- if (%rem) { write -dl $+ %rn $qt(%f) | write $qt(%f) $2 %rem }
- elseif (!%rem) { write -dl $+ %rn $qt(%f) }
- }
- }
- alias points {
- if ($0 !== 2) { return }
- var %f = $mircdirpoints\ $+ $mkfn($1) $+ .db
- if (!$isfile(%f)) { return 0 }
- var %r = $read(%f,nw,* $+ $2 $+ *)
- var %rn = $readn
- var %p = $gettok(%r,2,32)
- return $iif(%p,$v1,0)
- }
- alias give_top {
- if (!$1-) { return }
- var %win = @top_ $+ $2
- var %db = $mircdirpoints\ $+ $mkfn($2) $+ .db
- if (!$isfile(%db)) { return }
- if ($window(%win)) { window -c %win }
- window -hj $+ $lines(%db) %win
- loadbuf %win $qt(%db)
- filter -ceutww 2 32 %win %win
- var %i = 1
- while (%i <= $1) { var %list = $addtok(%list,%i $+ . $line(%win,%i),44) $iif(%i !== $1,-) | inc %i }
- msg $2 ( $+ $3 $+ ): Top $1 point(s) are: $replace(%list,$chr(44),$+($chr(32)))
- if ($window(%win)) { window -c %win }
- }
- alias convert_points {
- var %f = points.ini
- var %dir = $mircdirpoints
- if (!$isdir(%dir)) { mkdir points }
- var %t = $lines(%f)
- var %i = 1
- while (%i <= %t) {
- var %l = $read(%f,n,%i)
- var %ii = $calc(%i +1)
- var %c = $remove($gettok(%l,1,46),[)
- var %n = $remove($gettok(%l,2,46),])
- var %p = $remove($read(%f,n,%ii),Points=)
- var %file = $mircdirpoints\ $+ $mkfn(%c) $+ .db
- if (%n) && (%c) && (%p) { write $qt(%file) %n %p }
- inc %i
- }
- echo 3 -a OK Finished!
- }
- alias -l isdig {
- if ($1 == $null) { return 0 }
- if ($regex($1,^\d+$)) { return 1 }
- else { return 0 }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement