idk what i changed
This commit is contained in:
parent
faecf94589
commit
3f56293ccb
@ -281,8 +281,8 @@ client:on('messageCreate', function(message)
|
|||||||
else
|
else
|
||||||
message:reply('command does not exist 👎')
|
message:reply('command does not exist 👎')
|
||||||
end
|
end
|
||||||
else
|
else --_G.current = {name=user.name,game=API.GAMES[game],style=API.STYLES[style]:lower()}
|
||||||
message:reply('bot is locked, please wait until it is unlocked')
|
message:reply('Bot is currently in use, please try again later ('.._G.current.name..' for '.._G.current.game..' in '.._G.current.style..')')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
@ -33,6 +33,7 @@ commands:Add('skill',{},'skill <username|mention|"me"> <game> <style>', function
|
|||||||
if not sn_info.ID then return message:reply('```No data with StrafesNET is associated with that user.```') end
|
if not sn_info.ID then return message:reply('```No data with StrafesNET is associated with that user.```') end
|
||||||
print('user:',user.id)
|
print('user:',user.id)
|
||||||
_G.locked = true
|
_G.locked = true
|
||||||
|
_G.current = {name=user.name,game=API.GAMES[game],style=API.STYLES[style]:lower()}
|
||||||
local times = {}
|
local times = {}
|
||||||
local res,rheaders = API:GetUserTimes(user.id,nil,style,game)
|
local res,rheaders = API:GetUserTimes(user.id,nil,style,game)
|
||||||
if #res~=0 then
|
if #res~=0 then
|
||||||
@ -64,7 +65,13 @@ commands:Add('skill',{},'skill <username|mention|"me"> <game> <style>', function
|
|||||||
table.sort(times,function(t1,t2)
|
table.sort(times,function(t1,t2)
|
||||||
return t1.SkillRaw<t2.SkillRaw
|
return t1.SkillRaw<t2.SkillRaw
|
||||||
end)
|
end)
|
||||||
local msg = ''
|
local average = 0
|
||||||
|
for _,time in next,times do
|
||||||
|
local skill = time.SkillRaw
|
||||||
|
average = average+skill
|
||||||
|
end
|
||||||
|
average = average/#times
|
||||||
|
local msg = 'Average Skill: '..API:FormatSkill(average)..'\n'
|
||||||
for _,time in next,times do
|
for _,time in next,times do
|
||||||
-- msg = msg..'['..time.Rank..'/'..time.MapCompletionCount..'] '..time.Map..' ('..time.Skill..')\n'
|
-- msg = msg..'['..time.Rank..'/'..time.MapCompletionCount..'] '..time.Map..' ('..time.Skill..')\n'
|
||||||
msg = msg..API.MAPS[game][time.Map].DisplayName..' ('..time.Map..'): '..time.Skill..' for '..time.Rank..'/'..time.MapCompletionCount..' with '..API:FormatTime(time.Time)..'\n'
|
msg = msg..API.MAPS[game][time.Map].DisplayName..' ('..time.Map..'): '..time.Skill..' for '..time.Rank..'/'..time.MapCompletionCount..' with '..API:FormatTime(time.Time)..'\n'
|
||||||
|
Loading…
Reference in New Issue
Block a user