Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local caller = getScriptCaller()
- function getDelta()
- local t = {}
- t.current = getLocalData(tostring(caller.id).."shit") or 0
- t.delta = math.random(5, 25)
- t.current = t.current + t.delta
- setLocalData(tostring(caller.id).."shit", t.current)
- return t
- end
- function updateTime()
- setLocalData(tostring(caller.id) .. 'timeshit', os.time())
- end
- function checkTime()
- local time = getLocalData(tostring(caller.id) .. 'timeshit')
- if not time then
- setLocalData(tostring(caller.id).."timeshit", 0)
- updateTime()
- return true
- end
- if time and os.time() - tonumber(time) > 24*60*60 then
- updateTime()
- return true
- end
- return false
- end
- function enlarge()
- if isChat() then
- local user = (caller.username) and " @"..caller.username.." " or caller.first_name.." "
- if checkTime() then
- local t = getDelta()
- return user..", ты высрал " .. t.delta .. " кг. говна. В твоей яме уже "..t.current.." кг. говна"
- else
- return os.date(user .. ', ты уже срал сегодня! Приходи через %H часов %M минут', 45*60*60 - os.time() + tonumber(getLocalData(tostring(caller.id .. 'timeshit'))))
- end
- else
- return 'Юзай в чате, чтобы все видели, сколько ты насрал!'
- end
- end
- function printTop()
- local t = getAllUserData()
- local s = 'ДЛИНА ГОВНА В ЯМАХ ЧЛЕНОВ КОНФЫ\n'
- --local r = {}
- if not getUserCount() then
- return 'Используй в конфе!'
- end
- for i = 1, getUserCount() do
- if t[i] and t[i].id and getLocalData(tostring(t[i].id).."shit") then
- t[i].score = tonumber(getLocalData(tostring(t[i].id).."shit"))
- else
- t[i] = nil
- end
- end
- local c = {}
- for i = 1, getUserCount() do
- if t[i] then
- table.insert(c, t[i])
- end
- end
- table.sort(c, function(a,b) return a.score > b.score end)
- for i = 1, #c do
- if c[i].first_name then
- s = s .. c[i].first_name .. ' - ' ..c[i].score .. ' кг.\n'
- end
- end
- return s
- end
- if _ARGS == 'top' or _ARGS == 'топ' then
- return printTop()
- end
- return enlarge()
Advertisement
Add Comment
Please, Sign In to add comment