kizn

poop

Aug 24th, 2023 (edited)
1,478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.18 KB | None | 0 0
  1. local caller = getScriptCaller()
  2.  
  3. function getDelta()
  4.   local t = {}
  5.   t.current = getLocalData(tostring(caller.id).."shit") or 0
  6.   t.delta = math.random(5, 25)
  7.   t.current = t.current + t.delta
  8.   setLocalData(tostring(caller.id).."shit", t.current)
  9.   return t
  10. end
  11.  
  12. function updateTime()
  13.   setLocalData(tostring(caller.id) .. 'timeshit', os.time())
  14. end
  15.  
  16. function checkTime()
  17.   local time = getLocalData(tostring(caller.id) .. 'timeshit')
  18.   if not time then
  19.     setLocalData(tostring(caller.id).."timeshit", 0)
  20.     updateTime()
  21.     return true
  22.   end
  23.   if time and os.time() - tonumber(time) > 24*60*60 then
  24.     updateTime()
  25.     return true
  26.   end
  27.   return false
  28. end
  29.  
  30. function enlarge()
  31.   if isChat() then
  32.     local user = (caller.username) and " @"..caller.username.." " or caller.first_name.." "
  33.     if checkTime() then
  34.       local t = getDelta()
  35.       return user..", ты высрал " .. t.delta .. " кг. говна. В твоей яме уже "..t.current.." кг. говна"
  36.     else
  37.       return os.date(user .. ', ты уже срал сегодня! Приходи через %H часов %M минут', 45*60*60 - os.time() + tonumber(getLocalData(tostring(caller.id .. 'timeshit'))))
  38.     end
  39.   else
  40.     return 'Юзай в чате, чтобы все видели, сколько ты насрал!'
  41.   end
  42. end
  43.  
  44. function printTop()
  45.   local t = getAllUserData()
  46.   local s = 'ДЛИНА ГОВНА В ЯМАХ ЧЛЕНОВ КОНФЫ\n'
  47.   --local r = {}
  48.   if not getUserCount() then
  49.     return 'Используй в конфе!'
  50.   end
  51.   for i = 1, getUserCount() do
  52.     if t[i] and t[i].id and getLocalData(tostring(t[i].id).."shit") then
  53.       t[i].score = tonumber(getLocalData(tostring(t[i].id).."shit"))
  54.     else
  55.       t[i] = nil
  56.     end
  57.   end
  58.   local c = {}
  59.   for i = 1, getUserCount() do
  60.     if t[i] then
  61.       table.insert(c, t[i])
  62.     end
  63.   end
  64.   table.sort(c, function(a,b) return a.score > b.score end)
  65.   for i = 1, #c do
  66.     if c[i].first_name then
  67.       s = s .. c[i].first_name .. ' - ' ..c[i].score .. ' кг.\n'
  68.     end
  69.   end
  70.   return s
  71. end
  72.  
  73. if _ARGS == 'top' or _ARGS == 'топ' then
  74.   return printTop()
  75. end
  76.  
  77. return enlarge()
Advertisement
Add Comment
Please, Sign In to add comment