From 908792ad11eeba318f818c0de9bef9e5500562d9 Mon Sep 17 00:00:00 2001 From: tommy aka doge <59783653+dowoge@users.noreply.github.com> Date: Mon, 7 Nov 2022 12:18:23 -0500 Subject: [PATCH] calculate specific placement command --- src/modules/commands/skillCalc.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/modules/commands/skillCalc.lua b/src/modules/commands/skillCalc.lua index 2791240..d2c17e3 100644 --- a/src/modules/commands/skillCalc.lua +++ b/src/modules/commands/skillCalc.lua @@ -119,4 +119,14 @@ commands:Add('compare',{},'compare n1 n2', function(t) local compared = API.CalculateDifference(n1,n2) local compared_percent = API.CalculateDifferencePercent(n1,n2) message:reply(tostring(compared)..' ('..compared_percent..')') -end) \ No newline at end of file +end) + +commands:Add('calc',{},nil,function(t) + local args=t.args + local message=t.message + local rank = args[1] + local count = args[2] + local points=API.CalculatePoint(rank,count) + local skill=API.FormatSkill(rank == 1 and 1 or (count-rank)/(count-1)) + message:reply('```Points: '..points..'\nSkill: '..skill..'```') +end ) \ No newline at end of file