Advertisement
ACheats

diplom2022

Feb 21st, 2022 (edited)
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.94 KB | None | 0 0
  1. local caller = getScriptCaller()
  2. local allData = getAllUserData()
  3.  
  4. -- getLocalData(string), setLocalData(string, value)
  5.  
  6. isUserReg = getLocalData('Diplom_Tema' .. caller.id)
  7. isUserHasMentor = getLocalData('Diplom_Mentor' .. caller.id)
  8.  
  9. diplomExample = "Вы не выбрали тему дипломки.\n Выберите тему !!diplom тема [название темы]\nПримеры тем: \n1) Виды крашеров и защита от них\n2) Актуальность Lua в 2022 \n3) Современные методы разработки плагинов для SAMPFUNCS\n4) Разработка автоматизированного бота для шахты Advance RP \n5) Разработка информационной системы для кладов Arizona RP"
  10. cmdsList = "Список команд:\n!!diplom тема [название]\n!!diplom руководитель [ник]\n!!diplom статус\n!!diplom [текст диплома]\n!!diplom читать"
  11.  
  12.  
  13.  
  14.  
  15. function checkTime()
  16. local time = getLocalData('Diplom_Delay' .. caller.id)
  17. if not time then
  18. setLocalData('Diplom_Delay' .. caller.id, os.time())
  19. return false
  20. end
  21. if os.time() - tonumber(time) > 24*60*60 then
  22. setLocalData('Diplom_Delay' .. caller.id, os.time())
  23. return false
  24. end
  25. return true
  26. end
  27.  
  28.  
  29.  
  30. function setTema(params)
  31. if not params then return "Введите действительную тему дипломки." end
  32. if getLocalData('Diplom_Tema' .. caller.id) then return "Тему изменить нельзя" end
  33. setLocalData('Diplom_Tema' .. caller.id, params)
  34. setLocalData('Diplom_Tema_date' .. caller.id, os.date("%d %B %Y %X"))
  35. setLocalData('Diplom_Status' .. caller.id, 0)
  36. cuprins = "Тема: " .. params .. "\nАвтор: " .. caller.username .. "\n"
  37. setLocalData('Diplom_Text' .. caller.id, cuprins)
  38. return "Тема: " .. params .. "\nДата: " .. os.date("%d %B %Y %X") .. "\nСтудент: " .. caller.username or "Ноунейм" .. "\nДанные были отправлены в деканат.\n*Выберите научного руководителя: !!diplom руководитель [ник руководителя]"
  39. end
  40.  
  41. function setMentor(params)
  42. if not isUserReg then return diplomExample end
  43. if not params then return "Введите ник руководителя." end
  44. if getLocalData('Diplom_Mentor' .. caller.id) then return "Нельзя менять руководителя" end
  45. setLocalData('Diplom_Mentor' .. caller.id, params)
  46. return "Тема: " .. getLocalData('Diplom_Tema' .. caller.id) .. "\nДата: " .. getLocalData('Diplom_Tema_date' .. caller.id) .. "\nСтудент: " .. caller.username .. "\nНаучный руководитель: " .. params
  47. end
  48.  
  49. function getStatus(params)
  50. if not isUserReg then return diplomExample end
  51. if not isUserHasMentor then return "Вы не выбрали научного руководителя.\n !!diplom руководитель [ник руководителя]" end
  52. return "В разработке."
  53. end
  54.  
  55. function writeDiplom(text)
  56. if not isUserReg then return diplomExample end
  57. if not isUserHasMentor then return "Вы не выбрали научного руководителя.\n !!diplom руководитель [ник руководителя]" end
  58. if not text then return "Харош лить воду в диплом." end
  59. if checkTime() then
  60. local time = 24*60*60 - os.time() + tonumber(getLocalData('Diplom_Delay' .. caller.id))
  61. local hours = math.floor((time % 86400)/3600)
  62. local minutes = math.floor((time%3600)/60)
  63. local seconds = math.floor((time%60))
  64. return string.format("Вы уже писали дипломку. Возвращайтесь через %02d:%02d:%02d",hours,minutes,seconds)
  65. end
  66. diplomText = getLocalData('Diplom_Text' .. caller.id)
  67. setLocalData('Diplom_Text' .. caller.id, diplomText .. "\n" .. text)
  68. return "Вы вписали в дипломную работу: " .. text
  69. end
  70.  
  71. function readDiplom()
  72. if not isUserReg then return diplomExample end
  73. if not isUserHasMentor then return "Вы не выбрали научного руководителя.\n !!diplom руководитель [ник руководителя]" end
  74. return getLocalData('Diplom_Text' .. caller.id)
  75. end
  76.  
  77. function helpDiplom()
  78. return cmdsList
  79. end
  80.  
  81.  
  82. function deleteDiplom()
  83. setLocalData('Diplom_Tema' .. caller.id, nil)
  84. setLocalData('Diplom_Tema_date' .. caller.id, nil)
  85. setLocalData('Diplom_Status' .. caller.id, nil)
  86. setLocalData('Diplom_Text' .. caller.id, nil)
  87. setLocalData('Diplom_Mentor' .. caller.id, nil)
  88. setLocalData('Diplom_Delay' .. caller.id, nil)
  89. return "Вся информация была удалена из деканата."
  90. end
  91.  
  92. function debuger(params)
  93. return getLocalData(params .. caller.id)
  94. end
  95.  
  96. function set(params)
  97. return setLocalData("Diplom_Delay" .. caller.id, params)
  98. end
  99.  
  100. function topDiplom()
  101. return "В разработке."
  102. end
  103.  
  104. function serve(action, params)
  105. if action == "тема" then return setTema(params) end
  106. if action == "руководитель" then return setMentor(params) end
  107. if action == "debug" then return debuger(params) end
  108. if action == "set" then return set(params) end
  109. return writeDiplom(action .. params)
  110. end
  111.  
  112. function call(action)
  113. if action == "статус" then return getStatus() end
  114. if action == "читать" then return readDiplom() end
  115. if action == "помощь" then return helpDiplom() end
  116. if action == "бросить" then return deleteDiplom() end
  117. if action == "топ" then return topDiplom() end
  118. return writeDiplom(action)
  119. end
  120.  
  121. if _ARGS then
  122. local index = string.find(_ARGS, ' ')
  123.  
  124. if index then
  125. action = string.sub(_ARGS, 1, index - 1)
  126. params = string.sub(_ARGS, index + 1)
  127. return serve(action, params)
  128. else
  129. action = _ARGS
  130. return call(action)
  131. end
  132. end
  133.  
  134. return cmdsList
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement