Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;TPPCTools Level Scripts by Hobo, adapted by ruanmed
- ;Original: http://forums.tppc.info/showthread.php?t=345962
- ;==/Aliases/==
- ;----------------------------------------------------------------------
- alias comma { var %a, %b = $regsub($ticks,$$1,/\G([+-]?\d+?)(?=(?:\d{3})++(?=\.\d++$|$))/g,\1 $+ $chr(44),%a) | return %a }
- ;Difference Script
- ;----------------------------------------------------------------------
- on $*:TEXT:/^[!@]di(f|ff|ffer|fference)(\s|$)/Si:*: {
- if ($2 !isnum) { halt }
- if ($4) { if ($3 !isnum) { halt } }
- if ($4 == -) {
- if ($2 < $4) { halt }
- if ($len($2) > 7) { halt }
- if ($len($4) > 7) { halt }
- if ($2 == $4) { notice $nick Error: Specified levels are the same. | halt }
- inc %difference 1
- var %exp = $calc((($2 ^3) +1) - (($4 ^3) + 1))
- msg $chan Exp difference: $comma(%exp)
- msg $chan -a Level value: $comma($gettok($calc((%exp ^(1/3))),1,46))
- }
- else {
- if ($3 !isnum) { halt }
- if ($len($2) > 7) { halt }
- if ($len($3) > 7) { halt }
- inc %difference 1
- var %num1 = $2
- var %num2 = $3
- if (%num1 == %num2) { notice $nick Error: Specified levels are the same. | halt }
- if (%num1 > %num2) { var %bignum = %num1 | var %smallnum = %num2 }
- if (%num2 > %num1) { var %bignum = %num2 | var %smallnum = %num1 }
- var %exp = $calc(((%bignum ^3) +1) - ((%smallnum ^3) +1))
- msg $chan Exp difference: $comma(%exp)
- msg $chan Level value: $comma($gettok($calc((%exp ^(1/3))),1,46))
- }
- }
- ;Exp Script
- ;----------------------------------------------------------------------
- on $*:TEXT:/^[!@]ex(p|perience)(\s|$)/Si:*: {
- if ($2 !isnum) || ($2 <= 0) || ($len($2) > 15) { halt }
- var %d = $remove($2,$chr(44))
- var %exp = $calc($gettok(%d,1,46) -1)
- var %exp = $gettok($calc(%exp ^ (1/3)),1,$asc(.))
- msg $chan A pokemon with $comma(%d) exp is a level $comma(%exp) pokemon.
- }
- ;Level Script
- ;----------------------------------------------------------------------
- on $*:TEXT:/^[!@]l(vl|evel)(\s|$)/Si:*: {
- echo -at hi
- if ($2 !isnum) || ($2 <= 0) || ($len($2) > 10) { halt }
- var %lvl = $gettok($2,1,$asc(.))
- var %exp = $gettok($calc((%lvl ^3) +1),1,$asc(.))
- msg $chan A level $comma(%lvl) pokemon has $comma(%exp) experience.
- }
- ;Sum Script
- ;----------------------------------------------------------------------
- on *:TEXT:!sum *:*: {
- if (!$2) || ($2 !isnum) { notice $nick Parameters are !sum number number number number number number | halt }
- if ($2 <= 0) || ($3 <= 0) || ($4 <= 0) || ($5 <= 0) || ($6 <= 0) || ($7 <= 0) { notice $nick Please don't use negative numbers. | halt }
- var %1 = $gettok($remove($2,$chr(44)),1,46) | var %exp1 = $calc((%1 ^3) +1)
- var %2 = $gettok($remove($3,$chr(44)),1,46) | var %exp2 = $calc((%2 ^3) +1)
- var %3 = $gettok($remove($4,$chr(44)),1,46) | var %exp3 = $calc((%3 ^3) +1)
- var %4 = $gettok($remove($5,$chr(44)),1,46) | var %exp4 = $calc((%4 ^3) +1)
- var %5 = $gettok($remove($6,$chr(44)),1,46) | var %exp5 = $calc((%5 ^3) +1)
- var %6 = $gettok($remove($7,$chr(44)),1,46) | var %exp6 = $calc((%6 ^3) +1)
- var %exptot = $calc(%exp1 + %exp2 + %exp3 + %exp4 + %exp5 + %exp6)
- var %explevel = $gettok($calc((%exptot -1) ^ (1/3)),1,46)
- msg $chan Total experience: $comma(%exptot) Level: $comma(%explevel)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement