Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- flocal GC_Sniffer = CreateFrame("Frame")
- GC_Sniffer:RegisterEvent("CHAT_MSG_OFFICER")
- GC_Sniffer:SetScript("OnEvent", function (self, event, message, sender)
- --команды для управления квестами
- local nik=sender
- local endQuests="простые_квесты"
- local qAchiv="взят_ли_квест_простая_ачивка"
- local timeLimit="время_последнего_обращения"
- local str = string.gsub(message, "%s+", "")
- function all_trim(s)
- return s:match( "^%s*(.-)%s*$" )
- end
- function mysplit (inputstr, sep)
- if sep == nil then
- sep = "%s"
- end
- local t={}
- for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
- table.insert(t, str)
- end
- return t
- end
- function tablelength(T)
- local count = 0
- for _ in pairs(T) do count = count + 1 end
- return count
- end
- function hashStr (nome)
- hours, minutes = GetGameTime()
- count1=hours* 3.1415926535
- count2=minutes* 3.1415926535
- count3=count1*count2
- count3=string.sub(count3, 1, 3)
- count3=string.format("%03d",count3)
- hNik=string.byte(nome,1)
- hNik2=string.byte(nome,2)
- hNome=hNik*hNik2
- hNome=string.sub(hNome, 1, 3)
- hNome=string.format("%03d",hNome)
- r1=string.sub(count3, 1, 1)
- r2=string.sub(hNome, 1, 1)
- r3=string.sub(count3, 2, 2)
- r4=string.sub(hNome, 2, 2)
- r5=string.sub(count3, 3, 3)
- r6=string.sub(hNome, 3, 3)
- r=r1 .. r2 .. r3 .. r4 .. r5 .. r6
- return r
- end
- hsh=hashStr(sender)
- print (hsh)
- if TDG[sender]==nil then
- TDG[sender]={}
- end
- if TDG[nik][endQuests] == nil then
- TDG[nik][endQuests]={}
- end
- if pQuests == nil then
- pQuests={}
- end
- if pQuests[1] == nil then
- pQuests[1]={}
- end
- if pQuests[2] == nil then
- pQuests[2]={}
- end
- if pQuests[3] == nil then
- pQuests[3]={}
- end
- local nachalo = string.sub(message, 1, 1)
- print (str)
- print (message)
- if message == "ВОЖДЬ, простой!" and nachalo~="*" then
- if TDG[sender]==nil then
- TDG[sender]={}
- end
- if TDG[sender][endQuests]==nil then
- TDG[sender][endQuests]={}
- end
- local guokTimerStart=pQuests[1][1]
- if TDG[sender][endQuests][guokTimerStart]~=nil then
- if TDG[sender][qAchiv]==nil of TDG[sender][qAchiv]=="9999" then
- countQ=tablelength(pQuests[1])
- local chisloProstyhQComplit=0
- chisloProstyhQComplit=tonumber(chisloProstyhQComplit)
- for testQ=1, countQ do
- local x = math.random(1, countQ)
- ach=pQuests[1][x]
- if TDG[sender][endQuests][x]~="1" then
- SendChatMessage(hsh .. " 001 " .. sender .. ", покажи мне ачивку " .. ach .. " " .. GetAchievementLink(ach), "OFFICER", nil, 1)
- break
- else
- chisloProstyhQComplit=chisloProstyhQComplit + 1
- if chisloProstyhQComplit==countQ then
- SendChatMessage("*" .. sender .. ", все простые квесты уже выполнены. Добавить переход на следущий уровень квестов.", "OFFICER", nil, 1)
- end
- end
- end
- else
- ach=TDG[sender][qAchiv]
- SendChatMessage(hsh .. " 004 " .. sender .. ", у тебя уже взят квест: " .. ach .. GetAchievementLink(ach), "OFFICER", nil, 1)
- end
- else
- ach=pQuests[1][1]
- SendChatMessage(hsh .. " 001 " .. sender .. ", покажи мне ачивку " .. ach .. " " .. GetAchievementLink(ach), "OFFICER", nil, 1)
- end
- end
- if string.find (message, hsh) and string.find (message, "002") then
- msg1=mysplit(message)
- msg1=msg[6]
- TDG[sender][endQuests][msg1]="1"
- end
- end
- )
Add Comment
Please, Sign In to add comment