no more literal check, allows for "points" and "point"
This commit is contained in:
parent
d7c9e1c535
commit
5908799c44
@ -15,7 +15,7 @@ commands:Add('skill',{},'skill <username|mention|"me"> <game> <style> <sort?=ski
|
|||||||
if not game then return message:reply('invalid game') end
|
if not game then return message:reply('invalid game') end
|
||||||
if not style then return message:reply('invalid style') end
|
if not style then return message:reply('invalid style') end
|
||||||
local sort = args[4]
|
local sort = args[4]
|
||||||
if type(sort)=='string' and sort:lower()~='skill' and sort:lower()~='point' then
|
if type(sort)=='string' and not sort:lower():find('skill') and not sort:lower():find('point') then
|
||||||
return message:reply('invalid sort option, valid options are "skill" or "point"')
|
return message:reply('invalid sort option, valid options are "skill" or "point"')
|
||||||
elseif sort==nil then
|
elseif sort==nil then
|
||||||
sort = 'skill'
|
sort = 'skill'
|
||||||
@ -65,9 +65,9 @@ commands:Add('skill',{},'skill <username|mention|"me"> <game> <style> <sort?=ski
|
|||||||
test_a=test_a+(count-rank)
|
test_a=test_a+(count-rank)
|
||||||
test_b=test_b+(count-1)
|
test_b=test_b+(count-1)
|
||||||
end
|
end
|
||||||
table.sort(times,sort=='skill' and function(t1,t2)
|
table.sort(times,sort:find('skill') and function(t1,t2)
|
||||||
return t1.SkillRaw<t2.SkillRaw
|
return t1.SkillRaw<t2.SkillRaw
|
||||||
end or sort=='point' and function(t1,t2)
|
end or sort:find('point') and function(t1,t2)
|
||||||
return t1.Points<t2.Points
|
return t1.Points<t2.Points
|
||||||
end)
|
end)
|
||||||
local points = 0
|
local points = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user