Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local caller = getScriptCaller()
- local t = getAllUserData()
- function signRoll(num)
- local n = math.random(1,10)
- if n <= 7 then
- return num
- end
- return -num
- end
- function getDelta()
- local t = {}
- t.current = getLocalData(tostring(caller.id))
- t.delta = math.random(0, 10)
- t.delta = signRoll(t.delta)
- if t.current + t.delta < 0 then
- t.delta = -t.current
- t.current = 0
- else
- t.current = t.current + t.delta
- end
- setLocalData(tostring(caller.id), t.current)
- return t
- end
- function updateTime(timeType)
- setLocalData('' .. tostring(caller.id) .. timeType, os.time())
- end
- function checkTime(timeType)
- local time = getLocalData('' .. tostring(caller.id) .. timeType)
- if not time then
- setLocalData('' .. tostring(caller.id), 0)
- updateTime(timeType)
- return true
- end
- if time and os.time() - tonumber(time) > 24*60*60 then
- updateTime(timeType)
- return true
- end
- return false
- end
- function enlarge()
- if isChat() then
- local tag = ''
- if caller.username then
- tag = ' @' .. caller.username .. ' '
- elseif caller.first_name then
- tag = caller.first_name .. ' '
- end
- local t = getDelta()
- if t.current >= 100 then
- return "https://sun9-13.userapi.com/PdWBngPhxLTfRE1PbFTpNDZeSklJUtnqluH_WQ/cFVLFBJtgAg.jpg"
- elseif checkTime('time') then
- local str = '' .. tag
- if t.delta < 0 then
- str = str .. 'Ирина откатила твою дипломку. Ты должен переделать ' .. -t.delta .. '% дипломки. '
- elseif t.delta == 0 then
- str = str .. 'Сегодня выходной и ты ничего не сделал по дипломке. '
- else
- str = str .. 'Ты написал ' .. t.delta .. '% дипломной работы. '
- end
- str = str .. 'Всего готово: ' .. t.current .. '%.'
- return str
- else
- return os.date(tag .. 'Ты уже писал дипломку сегодня! Приходи через %H часов %M минут', 45*60*60 - os.time() + tonumber(getLocalData(tostring(caller.id .. 'time'))))
- end
- else
- return 'Юзай в чате чтобы все видели твою дипломку!!1'
- 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)) then
- t[i].score = tonumber(getLocalData(tostring(t[i].id)))
- 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
- function zaval(params)
- if checkTime('zaval') then
- for i = 1, getUserCount() do
- if t[i] and t[i].id and getLocalData('' .. tostring(t[i].id)) and t[i].username == params then
- local rep = math.random(2, 50)
- current = getLocalData('' .. tostring(t[i].id))
- setLocalData('' .. tostring(t[i].id), current-rep)
- return "Ты натравил Балабанова и Извора на @"..params .. "!\nОни забраковали его дипломку на " .. rep .. "%.\nТеперь она составляет " .. current-rep .. "%."
- end
- end
- return "*Не нахожу чувака с ником " .. params
- else
- return os.date('Ты уже палил чувака.\n Приходи через %H часов %M минут', 45*60*60 - os.time() + tonumber(getLocalData('' .. tostring(caller.id .. 'zaval'))))
- end
- end
- function help(params)
- if checkTime('help') then
- for i = 1, getUserCount() do
- if t[i] and t[i].id and getLocalData('' .. tostring(t[i].id)) and t[i].username == params then
- local rep = math.random(2, 30)
- current = getLocalData('' .. tostring(t[i].id))
- setLocalData('' .. tostring(t[i].id), current+rep)
- return "Ты помог @"..params .. " с дипломкой!\nВы написали " .. rep .. "%.\nВсего написано " .. current+rep .. "%."
- end
- end
- return "*Не нахожу чувака с ником " .. params
- else
- return os.date('Ты уже помогал. \n Приходи через %H часов %M минут', 45*60*60 - os.time() + tonumber(getLocalData('' .. tostring(caller.id .. 'help'))))
- end
- end
- function zvonok(params)
- if getScriptCaller().username == "mgmoldova" then
- for i = 1, getUserCount() do
- if t[i] and t[i].id and getLocalData('' .. tostring(t[i].id)) and t[i].username == params then
- current = getLocalData('' .. tostring(t[i].id))
- setLocalData('' .. tostring(t[i].id), current+20)
- return "Потлог замолвил словечко. @" .. params .. " одобрили 20% дипломной. Итого: " .. current+20 .. "%."
- end
- end
- return "*Не нахожу чувака с ником " .. params
- else
- return "*Потлог игнорит тебя."
- end
- end
- function serve(action, params)
- if action == "завалить" then return zaval(params) end
- if action == "звонок" then return zvonok(params) end
- if action == "помочь" then return help(params) end
- return "*Неверная команда - " .. action
- end
- if _ARGS == 'top' or _ARGS == 'топ' then
- return printTop()
- end
- if _ARGS == 'reset' or _ARGS == 'сброс' then
- if getScriptCaller().username == "mgmoldova"
- then
- setLocalData('' .. tostring(caller.id) .. "help", 0)
- setLocalData('' .. tostring(caller.id) .. "zaval", 0)
- setLocalData('' .. tostring(caller.id) .. "time", 0)
- return "*Временные настройки сброшены."
- else return "*Ты не админ."
- end
- end
- if _ARGS == 'deadline' or _ARGS == 'дедлайн' then
- reference = os.time{day=10, year=2021, month=5}
- daysfrom = os.difftime(reference, os.time()) / (24 * 60 * 60) -- seconds in a day
- wholedays = math.floor(daysfrom)
- return "Evaluarea III -100% a proiectului de licenta va avea loc pe data de:\n10.05.21, orele 10.00-13.00\n11.05.21, orele 13.30-17.00\nAu ramas " .. wholedays .. " zile!!!"
- end
- if _ARGS then
- local index = string.find(_ARGS, ' ')
- if index then
- action = string.sub(_ARGS, 1, index - 1)
- params = string.sub(_ARGS, index + 1)
- return serve(action, params)
- else
- action = _ARGS
- end
- end
- return enlarge()
Add Comment
Please, Sign In to add comment