[pshaiCmd] Number Modulo Operation

stable
By pshai in Miscellaneous Published August 2020 👁 1,535 views 💬 3 comments

Description

Simple but effective custom command for modulo operation. Made for the great users of VE, with love. <3 ~pshai More on modulo operation: https://en.wikipedia.org/wiki/Modulo_operation
HaasScript
DefineCommand('NumMod', 'Number Modulo operation')

local num = DefineParameter(NumberType, 'number', 'Input number', true, 10, 'Number')
local mod = DefineParameter(NumberType, 'modulo', 'Modulo', true, 4, 'Number')

DefineOutput(NumberType, num % mod, 'Modulo of input number', 'Equals, NotEquals')

3 Comments

Sign in to leave a comment.

F
Firetron almost 6 years ago

This is in the latest standard lua math lib. Maybe someday our lua will be upgraded and we won't need a CC for it?

P
pshai almost 6 years ago

This isnt needed in SE, but for VE there is no command block for it, so thats why it exists :)

F
Firetron almost 6 years ago

Right, having it in the math lib for SE would be rather superfluous when you can just % in SE.