Advertisement
ruanmed

TPPC

Jun 1st, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.25 KB | None | 0 0
  1. ;TPPCTools Level Scripts by Hobo, adapted by ruanmed
  2. ;Original: http://forums.tppc.info/showthread.php?t=345962
  3.  
  4. ;==/Aliases/==
  5. ;----------------------------------------------------------------------
  6. alias comma { var %a, %b = $regsub($ticks,$$1,/\G([+-]?\d+?)(?=(?:\d{3})++(?=\.\d++$|$))/g,\1 $+ $chr(44),%a) | return %a }
  7.  
  8. ;Difference Script
  9. ;----------------------------------------------------------------------
  10. on $*:TEXT:/^[!@]di(f|ff|ffer|fference)(\s|$)/Si:*: {
  11.   if ($2 !isnum) { halt }
  12.   if ($4) { if ($3 !isnum) { halt } }
  13.   if ($4 == -) {
  14.     if ($2 < $4) { halt }
  15.     if ($len($2) > 7) { halt }
  16.     if ($len($4) > 7) { halt }
  17.     if ($2 == $4) { notice $nick Error: Specified levels are the same. | halt }
  18.     inc %difference 1
  19.     var %exp = $calc((($2 ^3) +1) - (($4 ^3) + 1))
  20.     msg $chan Exp difference: $comma(%exp)
  21.     msg $chan -a Level value: $comma($gettok($calc((%exp ^(1/3))),1,46))
  22.   }
  23.   else {
  24.     if ($3 !isnum) { halt }
  25.     if ($len($2) > 7) { halt }
  26.     if ($len($3) > 7) { halt }
  27.     inc %difference 1
  28.     var %num1 = $2
  29.     var %num2 = $3
  30.     if (%num1 == %num2) { notice $nick Error: Specified levels are the same. | halt }
  31.     if (%num1 > %num2) { var %bignum = %num1 | var %smallnum = %num2 }
  32.     if (%num2 > %num1) { var %bignum = %num2 | var %smallnum = %num1 }
  33.     var %exp = $calc(((%bignum ^3) +1) - ((%smallnum ^3) +1))
  34.     msg $chan Exp difference: $comma(%exp)
  35.     msg $chan Level value: $comma($gettok($calc((%exp ^(1/3))),1,46))
  36.   }
  37. }
  38.  
  39. ;Exp Script
  40. ;----------------------------------------------------------------------
  41. on $*:TEXT:/^[!@]ex(p|perience)(\s|$)/Si:*: {
  42.   if ($2 !isnum) || ($2 <= 0) || ($len($2) > 15) { halt }
  43.   var %d = $remove($2,$chr(44))
  44.   var %exp = $calc($gettok(%d,1,46) -1)
  45.   var %exp = $gettok($calc(%exp ^ (1/3)),1,$asc(.))
  46.   msg $chan A pokemon with $comma(%d) exp is a level $comma(%exp) pokemon.
  47. }
  48.  
  49. ;Level Script
  50. ;----------------------------------------------------------------------
  51. on $*:TEXT:/^[!@]l(vl|evel)(\s|$)/Si:*: {
  52.   echo -at hi
  53.   if ($2 !isnum) || ($2 <= 0) || ($len($2) > 10) { halt }
  54.   var %lvl = $gettok($2,1,$asc(.))
  55.   var %exp = $gettok($calc((%lvl ^3) +1),1,$asc(.))
  56.   msg $chan A level $comma(%lvl) pokemon has $comma(%exp) experience.
  57. }
  58.  
  59. ;Sum Script
  60. ;----------------------------------------------------------------------
  61. on *:TEXT:!sum *:*: {
  62.   if (!$2) || ($2 !isnum) { notice $nick Parameters are !sum number number number number number number | halt }
  63.   if ($2 <= 0) || ($3 <= 0) || ($4 <= 0) || ($5 <= 0) || ($6 <= 0) || ($7 <= 0) { notice $nick Please don't use negative numbers. | halt }
  64.   var %1 = $gettok($remove($2,$chr(44)),1,46) | var %exp1 = $calc((%1 ^3) +1)
  65.   var %2 = $gettok($remove($3,$chr(44)),1,46) | var %exp2 = $calc((%2 ^3) +1)
  66.   var %3 = $gettok($remove($4,$chr(44)),1,46) | var %exp3 = $calc((%3 ^3) +1)
  67.   var %4 = $gettok($remove($5,$chr(44)),1,46) | var %exp4 = $calc((%4 ^3) +1)
  68.   var %5 = $gettok($remove($6,$chr(44)),1,46) | var %exp5 = $calc((%5 ^3) +1)
  69.   var %6 = $gettok($remove($7,$chr(44)),1,46) | var %exp6 = $calc((%6 ^3) +1)
  70.   var %exptot = $calc(%exp1 + %exp2 + %exp3 + %exp4 + %exp5 + %exp6)
  71.   var %explevel = $gettok($calc((%exptot -1) ^ (1/3)),1,46)
  72.   msg $chan Total experience: $comma(%exptot) Level: $comma(%explevel)
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement