ALIAS LevelXP { var %x = 1, %level = $calc($1 - 1), %xp = 0 while (%x <= %level) { var %TempXp = $calc($floor($calc(%x + 300 * 2 ^ (%x / 7))) / 4) inc %xp %TempXp inc %x } return $int(%xp) } ON $*:TEXT:/^[!@.](expto|expcalc) /Si:#:{ IF ($left($1,1) == !) { VAR %exp.output = notice $nick 1*** [4ExpTo1]: } ELSE { VAR %exp.output = msg $chan 1[4ExpTo 1/4 $nick $+ 1]: } IF (c isincs $chan($chan).mode) { VAR %exp.output = $strip(%exp.output) } IF (($2 !isnum) || (($3) && ($3 !isnum))) { %exp.output Letters are not allowed in calculations. | Halt } IF ($3) { IF (($3 < $2) && ($2 < 99) && ($3 < 99)) { %exp.output That would return a negative value. Use !expto help if you need assistance. | halt } ELSEIF ($3 > 99) { %exp.output Valid Levels are 1-99. $3 is not within that scope. | halt } IF ($2 <= 98) { VAR %expfrom = $LevelXP($2) } ELSE { VAR %expfrom = $2 } VAR %expto = $LevelXP($3) VAR %expdiff = $calc(%expto - %expfrom) IF (%expdiff < 1) { %exp.output You would already be Level $3 with $bytes($2,bd) Experience! | halt } IF (%expto) { IF ($2 <= 98) { %exp.output The Exp required from Level $2 to Level $3 is $bytes(%expdiff,bd) } ELSE { %exp.output From $bytes($2,bd) Experience, you would need $bytes(%expdiff,bd) more Experience to get to Level $3 $+ . } } ELSE { %exp.output There was an error. Please notify the bot owner. ] ) } } ELSEIF ($2 <= 99) { %exp.output From Level 1 to Level $2 requires $bytes($LevelXP($2),bd) Experience. } ELSE { %exp.output Usage: !expto **OR** !expto } }