#I need help with some skript math

1 messages · Page 1 of 1 (latest)

bitter kiln
#

Sorry if I pronounce it wrong, Im not quite sure what it's called exactly in english..

But is it possible to make skript calculate a mathematic formula with "to the power of 2", "to the power of 3", etc...
Example:
set {_result} to ceiling(2 * 1.02)³

plucky totem
#

you mean the ²

#

or ³

#

?

fringe turret
#

Sadly no, Skript does not have exponents syntax

bitter kiln
#

Yea if its possible to make it calculate those, it doens't have to be ² or ³

#

Oh

#

Okaay

fringe turret
#

Wait let me check something..

bitter kiln
#

The only way would be to make skript loop 3 times and then multiply it by 1.02 each time... Was just wondering if there was an faster and "shorter" way to do it

plucky totem
#

do you have skript-reflect

bitter kiln
#

No

plucky totem
#

thats bad

bitter kiln
#

Is it possible with that?

fringe turret
#

Yes

plucky totem
#

yes

bitter kiln
#

oh

#

What is skript-reflect exactly? I've seen alot of people talk about

plucky totem
#

an addon to write java-code in skript

bitter kiln
#

ah

fringe turret
#

no reflect no life

bitter kiln
#

I don't know java code tho

fringe turret
#

He can spoon you :)

supple wave
bitter kiln
#

xD

plucky totem
#
import:
  java.lang.Math

command pow <number> <number>:
  trigger:
    Math.pow(arg-1,arg-2)
fringe turret
#

Or make a pow function :D

plucky totem
fringe turret
#

I know, event.getPlexy()

#
public static Object plexy = null;

public Object getPlexy() {
    return plexy;
}
bitter kiln
#

I don't get it...

Lets say I wanted something like this to be calculated:
set {_exp} to ceiling({_exp} * {@LifeSkill.Server_data.Mining.Break_exp_multiplier})¹³

#

but actually

#

wait

#

set {_exp} to ceiling({_exp} * {@LifeSkill.Server_data.Mining.Break_exp_multiplier})³

Instead of "³" it would be a variable that can change

fringe turret
#

Plexy, SPOON HIM PLEASE

bitter kiln
#

xD

fringe turret
#

He deserves a SPOON

#

For reflect newbies is fine for a spoon

modern yew
#
function pow(n: number, i: integer) :: number:
  loop {_i} times:
    set {_n} to {_n} * {_n}
  return {_n}

🙂

fringe turret
#

yes

#

No

#

What

plucky totem
modern yew
#

ehy

plucky totem
#

just use reflect

modern yew
#

why

#

i doubt he has it tbh

fringe turret
#

He can install

#

It wont hurt

modern yew
#

for pow?

fringe turret
#

For anything

plucky totem
#

for reflect

modern yew
#

why is ^ not vanilla

fringe turret
#

Would you rather install skQuery for a shitty syntax or use skript-reflect and may benefit from this addon in future?

modern yew
#

or do neither

fringe turret
#

Good point

modern yew
#

reflect is still cool but i wouldnt deal with math class

#

because math sucks

bitter kiln
#

Wait its just like this "Math.pow((ceiling({_exp} * {@LifeSkill.Server_data.Mining.Break_exp_multiplier})),3)"?

fringe turret
# modern yew why is ^ not vanilla

Well it was before, mistakenly
And it got unexpectedly removed after a regex change in the parser, but they arent aware exponents worked before the change

Read more: https://github.com/SkriptLang/Skript/issues/4553

GitHub

Suggestion Re-introduce scientific notation into Skript, which exists before 2.6 update. (i.e. set {_x} to 1234 * 1e+6) Why? As mentioned above, scientific notation exists until Skript 2.6 update. ...

modern yew
#

try !

bitter kiln
#

Thats not so bad honestly, thanks :D

fringe turret
#

Related issue, not exactly to exponent

#

I been using 1e+n kek

modern yew
#

for what

fringe turret
#

For math

modern yew
#

what kind of math are you doing with such a big number

fringe turret
#

For skripting

#

Goodbye

bitter kiln
#

Thanks for the help!

gusty blaze
gusty blaze
#

For your example, it'd be set {_result} to ceil(2 * 1.02)^3

fringe turret