Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias points return 1
- alias points_per_secs return 60
- ON *:PART:#: {
- if ($nick == $me) { .timer[START_*] off | .timer[GIVE_POINTS_*] off }
- elseif ($nick !== $me) { .timer[GIVE_POINTS_ $+ $chan $+ _TO_ $+ $nick $+ ] off }
- }
- ON *:JOIN:#: {
- if ($nick == $me) { .timer[START_ $+ $chan $+ _GIVE_POINTS] 1 3 start_give_points $chan $points }
- elseif ($nick !== $me) { .timer[GIVE_POINTS_ $+ $chan $+ _TO_ $+ $nick $+ ] 1 $points_per_secs give_points $nick $chan $points }
- }
- ON *:TEXT:!*:#: {
- tokenize 32 $strip($1-,burci)
- if ($1 == !addpoints) {
- if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify a nickname! | return }
- if ($2 == $nick) { .msg $chan ( $+ $nick $+ ): Error, You cannot use this command to your self! | return }
- if ($2 == $me) { .msg $chan ( $+ $nick $+ ): Error, You cannot use this command to the bot! | return }
- if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Please specify points! | return }
- if ($3) && ($3 !isnum) { .msg $chan ( $+ $nick $+ ): Error, Please use only numbers on points! | return }
- give_points $2 $chan $3
- .msg $chan ( $+ $nick $+ ): You have just gave $qt($2) nickname $qt($3) points.
- }
- if ($1 == !delpoints) {
- if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify a nickname! | return }
- if ($2 == $nick) { .msg $chan ( $+ $nick $+ ): Error, You cannot use this command to your self! | return }
- if ($2 == $me) { .msg $chan ( $+ $nick $+ ): Error, You cannot use this command to the bot! | return }
- if (!$3) { .msg $chan ( $+ $nick $+ ): Error, Please specify points! | return }
- if ($3) && ($3 !isnum) { .msg $chan ( $+ $nick $+ ): Error, Please use only numbers on points! | return }
- take_points $2 $chan $3
- .msg $chan ( $+ $nick $+ ): You have just took from $qt($2) nickname $qt($3) points.
- }
- if ($1 == !points) {
- if (!$2) {
- var %f = $mircdirpoints\ $+ $mkfn($chan) $+ .db
- if (!$isfile(%f)) { .msg $chan ( $+ $nick $+ ): You have NOT any points yet! | return }
- if (!$lines(%f)) { .msg $chan ( $+ $nick $+ ): You have NOT any points on the database yet! | return }
- var %r = $gettok($read(%f,ntw,$nick *),2,32)
- if (!%r) { .msg $chan ( $+ $nick $+ ): You have NOT earn any points yet! }
- elseif (%r) { .msg $chan ( $+ $nick $+ ): You $iif(%r == 1,has,have) %r $iif(%r == 1,point,points) $+ . }
- }
- elseif ($2) {
- if ($2 == $nick) { .msg $chan ( $+ $nick $+ ): Error, You cannot use this command to your self! | return }
- if ($2 == $me) { .msg $chan ( $+ $nick $+ ): Error, You cannot use this command to the bot! | return }
- var %f = $mircdirpoints\ $+ $mkfn($chan) $+ .db
- if (!$isfile(%f)) { .msg $chan ( $+ $nick $+ ): The $qt($2) have NOT any points yet! | return }
- if (!$lines(%f)) { .msg $chan ( $+ $nick $+ ): The $qt($2) have NOT any points on the database yet! | return }
- var %r = $gettok($read(%f,ntw,$2 *),2,32)
- if (!%r) { .msg $chan ( $+ $nick $+ ): The $qt($2) did NOT earn any points yet! }
- elseif (%r) { .msg $chan ( $+ $nick $+ ): The $qt($2) $iif(%r == 1,has,have) %r $iif(%r == 1,point,points) $+ . }
- }
- }
- if ($1 == !totalpoints) {
- var %f = $mircdirpoints\ $+ $mkfn($chan) $+ .db
- if (!$isfile(%f)) { .msg $chan ( $+ $nick $+ ): You have NOT any points yet! | return }
- var %t = $lines(%f)
- if (!%t) { .msg $chan ( $+ $nick $+ ): There is NOT any nickname on the database yet! }
- elseif (%t) { .msg $chan ( $+ $nick $+ ): There are %t total nicknames on the points database. }
- }
- if (!top* iswm $1) {
- var %f = $mircdirpoints\ $+ $mkfn($chan) $+ .db
- var %com = $remove($1,!top)
- if (%com !isnum) { .msg $chan ( $+ $nick $+ ): Error, Please use the correct top stats! | return }
- if (!$isfile(%f)) { .msg $chan ( $+ $nick $+ ): There is NOT any points on my database yet! | return }
- if (!$lines(%f)) { .msg $chan ( $+ $nick $+ ): There are NOT any points on the database yet! | return }
- points_stats_top $chan $nick %com
- }
- }
- alias start_give_points {
- if (!$1) { return }
- if (!$isdir($mircdirpoints)) { mkdir points }
- var %t = $nick($1,0)
- var %i = 1
- while (%i <= %t) {
- var %n = $nick($1,%i)
- if (%n) && (%n !== $me) { .timer[GIVE_POINTS_ $+ $1 $+ _TO_ $+ %n $+ ] 0 $points_per_secs give_points %n $1 $points }
- inc %i
- }
- }
- alias take_points {
- if (!$1) { return }
- if (!$isdir($mircdirpoints)) { mkdir points }
- var %f = $mircdirpoints\ $+ $mkfn($2) $+ .db
- if (!$isfile(%f)) { return }
- if (!$lines(%f)) { return }
- var %r = $gettok($read(%f,ntw,$1 *),2,32)
- var %rn = $readn
- if (%r) { write -l $+ %rn $qt(%f) $1 $calc(%r - $3) }
- elseif (!%r) { write $qt(%f) $1 $3 }
- }
- alias give_points {
- if (!$1) { return }
- if (!$isdir($mircdirpoints)) { mkdir points }
- var %f = $mircdirpoints\ $+ $mkfn($2) $+ .db
- if (!$isfile(%f)) { write $qt(%f) $1 $3 | return }
- if (!$lines(%f)) { write $qt(%f) $1 $3 | return }
- var %r = $gettok($read(%f,ntw,$1 *),2,32)
- var %rn = $readn
- if (%r) { write -l $+ %rn $qt(%f) $1 $calc(%r + $3) }
- elseif (!%r) { write $qt(%f) $1 $3 }
- }
- alias points_stats_top {
- if (!$1-) { return }
- var %ch = $1
- var %nick_for = $2
- var %tt = $3
- var %win = @top_ $+ %ch
- var %db = $mircdirpoints\ $+ $mkfn(%ch) $+ .db
- var %db_lines = $lines(%db)
- if (!$isfile(%db)) { return }
- if ($window(%win)) { window -c %win }
- window -hj $+ %db_lines %win
- loadbuf %win $qt(%db)
- filter -ceutww 2 32 %win %win
- var %ii 1
- while (%ii <= %tt) {
- var %list = $addtok(%list,$line(%win,%ii),44)
- inc %ii
- }
- .msg $1 ( $+ %nick_for $+ ): TOP $+ %tt Stats (Points) are: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
- if ($window(%win)) { window -c %win }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement