Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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!
- }
- 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),2))) { return }
- set -u10 %floodpoints On
- set -u30 %floodpoints. $+ $nick On
- var %f = $mircdirpoints\ $+ $mkfn($chan) $+ .db
- var %r = $read(%f,* $+ $nick $+ *)
- var %p = $gettok(%r,2,32)
- msg $chan $nick has $floor($calc(%p / 12)) total hour(s) on the channel.
- }
- if ($1 == !points) {
- 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 n nickname! | return }
- var %f = $mircdirpoints\ $+ $mkfn($chan) $+ .db
- var %r = $read(%f,* $+ $nick $+ *)
- if (!%r) { msg $chan ( $+ $nick $+ ): Error, The $qt($2) nickname does NOT exists into the database! | return }
- var %p = $gettok(%r,2,32)
- msg $chan ( $+ $nick $+ ): The $qt($2) user $iif(%p == 1,has $+ %p $+ point,have $+ %p $+ points) $+ .
- }
- if ($1 == !top3) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- give_top 3 $chan
- }
- if ($1 == !top5) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- give_top 5 $chan
- }
- if ($1 == !top10) {
- if ($nick !isop $chan) { msg $chan ( $+ $nick $+ ): Error, This command is only available to moderators! | return }
- give_top 10 $chan
- }
- }
- ON !*:PART:#: { .timer[points_ $+ $chan $+ _ $+ $nick $+ ] } off
- ON !*:JOIN:#:{
- .timer[points_ $+ $chan $+ _ $+ $nick $+ ] 0 300 add.pts $chan $nick
- add.pts $chan $nick
- }
- alias add.pts {
- var %dir = $mircdirpoints
- if (!$isdir(%dir)) { mkdir points }
- var %f = $mircdirpoints\ $+ $mkfn($1) $+ .db
- var %r = $read(%f,* $+ $2 $+ *)
- var %rn = $readn
- if (%rn) { write -dl $+ %rn | write $qt(%f) $2 $calc(%r + 1) }
- elseif (!%rn) { write $qt(%f) $2 $calc(%r + 1) }
- }
- alias give_top {
- if (!$1-) { return }
- var %win = @top_ $+ $2
- var %db = $mircdirpoints\ $+ $mkfn($2) $+ .db
- 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
- }
- echo msg $2 Top $1 point(s) are: $replace(%list,$chr(44),$+($chr(32)))
- if ($window(%win)) { window -c %win }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement