ACheats

diplomka

Nov 7th, 2020 (edited)
1,913
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.79 KB | None | 0 0
  1. local caller = getScriptCaller()
  2. local t = getAllUserData()
  3.  
  4. function signRoll(num)
  5.   local n = math.random(1,10)
  6.   if n <= 7 then
  7.     return num
  8.   end
  9.   return -num
  10. end
  11.  
  12. function getDelta()
  13.   local t = {}
  14.   t.current = getLocalData(tostring(caller.id))
  15.   t.delta = math.random(0, 10)
  16.   t.delta = signRoll(t.delta)
  17.   if t.current + t.delta < 0 then
  18.     t.delta = -t.current
  19.     t.current = 0
  20.   else
  21.     t.current = t.current + t.delta
  22.   end
  23.   setLocalData(tostring(caller.id), t.current)
  24.   return t
  25. end
  26.  
  27. function updateTime(timeType)
  28.   setLocalData('' .. tostring(caller.id) .. timeType, os.time())
  29. end
  30.  
  31.  
  32. function checkTime(timeType)
  33.   local time = getLocalData('' .. tostring(caller.id) .. timeType)
  34.   if not time then
  35.     setLocalData('' .. tostring(caller.id), 0)
  36.     updateTime(timeType)
  37.     return true
  38.   end
  39.   if time and os.time() - tonumber(time) > 24*60*60 then
  40.     updateTime(timeType)
  41.     return true
  42.   end
  43.   return false
  44. end
  45.  
  46. function enlarge()
  47.   if isChat() then
  48.     local tag = ''
  49.     if caller.username then
  50.       tag = ' @' .. caller.username .. ' '
  51.     elseif caller.first_name then
  52.       tag = caller.first_name .. ' '
  53.     end
  54.     local t = getDelta()
  55.     if t.current >= 100 then
  56.         return "https://sun9-13.userapi.com/PdWBngPhxLTfRE1PbFTpNDZeSklJUtnqluH_WQ/cFVLFBJtgAg.jpg"
  57.     elseif checkTime('time') then
  58.      
  59.       local str = '' .. tag
  60.       if t.delta < 0 then
  61.         str = str .. 'Ирина откатила твою дипломку. Ты должен переделать ' .. -t.delta .. '% дипломки. '
  62.       elseif t.delta == 0 then
  63.         str = str .. 'Сегодня выходной и ты ничего не сделал по дипломке. '
  64.       else
  65.         str = str .. 'Ты написал ' .. t.delta .. '% дипломной работы. '
  66.       end
  67.       str = str .. 'Всего готово: ' .. t.current .. '%.'
  68.       return str
  69.     else
  70.       return os.date(tag .. 'Ты уже писал дипломку сегодня! Приходи через %H часов %M минут', 45*60*60 - os.time() + tonumber(getLocalData(tostring(caller.id .. 'time'))))
  71.     end
  72.   else
  73.     return 'Юзай в чате чтобы все видели твою дипломку!!1'
  74.   end
  75. end
  76.  
  77. function printTop()
  78.   local t = getAllUserData()
  79.   local s = 'ДИПЛОМКИ ЧЛЕНОВ КОНФЫ\n'
  80.   --local r = {}
  81.   if not getUserCount() then
  82.     return 'Используй в конфе!'
  83.   end
  84.   for i = 1, getUserCount() do
  85.     if t[i] and t[i].id and getLocalData(tostring(t[i].id)) then
  86.       t[i].score = tonumber(getLocalData(tostring(t[i].id)))
  87.     else
  88.       t[i] = nil
  89.     end
  90.   end
  91.   local c = {}
  92.   for i = 1, getUserCount() do
  93.     if t[i] then
  94.       table.insert(c, t[i])
  95.     end
  96.   end
  97.   table.sort(c, function(a,b) return a.score > b.score end)
  98.   for i = 1, #c do
  99.     if c[i].first_name then
  100.       s = s .. c[i].first_name .. ' - ' ..c[i].score .. '%.\n'
  101.     end
  102.   end
  103.   return s
  104. end
  105.  
  106. function zaval(params)
  107. if checkTime('zaval') then
  108.       for i = 1, getUserCount() do
  109.         if t[i] and t[i].id and getLocalData('' .. tostring(t[i].id)) and t[i].username == params then
  110.           local rep = math.random(2, 50)
  111.           current = getLocalData('' .. tostring(t[i].id))
  112.           setLocalData('' .. tostring(t[i].id), current-rep)
  113.           return "Ты натравил Балабанова и Извора на @"..params .. "!\nОни забраковали его дипломку на " .. rep .. "%.\nТеперь она составляет " .. current-rep .. "%."
  114.         end
  115.       end
  116.       return "*Не нахожу чувака с ником " .. params
  117.        else
  118.         return os.date('Ты уже палил чувака.\n Приходи через %H часов %M минут', 45*60*60 - os.time() + tonumber(getLocalData('' .. tostring(caller.id .. 'zaval'))))
  119.     end
  120. end
  121.  
  122.  
  123.  
  124. function help(params)
  125.    if checkTime('help') then
  126.    
  127.  
  128.     for i = 1, getUserCount() do
  129.       if t[i] and t[i].id and getLocalData('' .. tostring(t[i].id)) and t[i].username == params then
  130.         local rep = math.random(2, 30)
  131.         current = getLocalData('' .. tostring(t[i].id))
  132.         setLocalData('' .. tostring(t[i].id), current+rep)
  133.         return "Ты помог @"..params .. " с дипломкой!\nВы написали " .. rep .. "%.\nВсего написано " .. current+rep .. "%."
  134.       end
  135.     end
  136.     return "*Не нахожу чувака с ником " .. params
  137.      else
  138.       return os.date('Ты уже помогал. \n Приходи через %H часов %M минут', 45*60*60 - os.time() + tonumber(getLocalData('' .. tostring(caller.id .. 'help'))))
  139.   end
  140. end
  141.  
  142. function zvonok(params)
  143.    if getScriptCaller().username == "mgmoldova" then
  144.    
  145.  
  146.     for i = 1, getUserCount() do
  147.       if t[i] and t[i].id and getLocalData('' .. tostring(t[i].id)) and t[i].username == params then
  148.         current = getLocalData('' .. tostring(t[i].id))
  149.         setLocalData('' .. tostring(t[i].id), current+20)
  150.          return "Потлог замолвил словечко. @" .. params .. " одобрили 20% дипломной. Итого: " .. current+20 .. "%."
  151.       end
  152.     end
  153.     return "*Не нахожу чувака с ником " .. params
  154.      else
  155.       return "*Потлог игнорит тебя."
  156.   end
  157. end
  158.  
  159.  
  160. function serve(action, params)
  161.   if action == "завалить" then return zaval(params) end
  162.   if action == "звонок" then return zvonok(params) end
  163.   if action == "помочь" then return help(params) end  
  164.   return "*Неверная команда -  " .. action
  165. end
  166.  
  167.  
  168. if _ARGS == 'top' or _ARGS == 'топ' then
  169.   return printTop()
  170. end
  171.  
  172. if _ARGS == 'reset' or _ARGS == 'сброс' then
  173.   if getScriptCaller().username == "mgmoldova"
  174.     then
  175.       setLocalData('' .. tostring(caller.id) .. "help", 0)
  176.       setLocalData('' .. tostring(caller.id) .. "zaval", 0)
  177.       setLocalData('' .. tostring(caller.id) .. "time", 0)
  178.     return "*Временные настройки сброшены."
  179.   else return "*Ты не админ."
  180.   end
  181. end
  182.  
  183. if _ARGS == 'deadline' or _ARGS == 'дедлайн' then
  184.   reference = os.time{day=10, year=2021, month=5}
  185.   daysfrom = os.difftime(reference, os.time()) / (24 * 60 * 60) -- seconds in a day
  186.   wholedays = math.floor(daysfrom)
  187.   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!!!"
  188.  
  189. end
  190.  
  191. if _ARGS then
  192.   local index = string.find(_ARGS, ' ')
  193.  
  194.   if index then
  195.     action = string.sub(_ARGS, 1, index - 1)
  196.     params = string.sub(_ARGS, index + 1)
  197.     return serve(action, params)
  198.   else
  199.     action = _ARGS
  200.   end
  201. end
  202.  
  203. return enlarge()
Add Comment
Please, Sign In to add comment