LINUX.ORG.RU

История изменений

Исправление LightDiver, (текущая версия) :

А вот нихрена…. Новый заново переписанный блок:

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), "guild", nil, 1)
						break
					else
						chisloProstyhQComplit=chisloProstyhQComplit + 1
						if chisloProstyhQComplit==countQ then
							SendChatMessage("*" .. sender .. ", все простые квесты уже выполнены. Добавить переход на следущий уровень квестов.", "guild", nil, 1)
						end
					end
				end
            else
                ach=TDG[sender][qAchiv]
                SendChatMessage(hsh .. " 004 " .. sender .. ", у тебя уже взят квест: " .. ach .. GetAchievementLink(ach), "guild", nil, 1)
            end
		else
			ach=pQuests[1][1]
			SendChatMessage(hsh .. " 001 " .. sender .. ", покажи мне ачивку " .. ach .. " " .. GetAchievementLink(ach), "guild", 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

Не работает с первого же притна. И сиди сумрачно наблюай, думай - а что же не так то? Явно где то не так переменная использоана или таблица. Или опечатка.

Самое надежное, что я нашел - нахер удалять все (ибо даже комментироание не помогает - эта падла считает ошибки в комментированном коде - ошибками). Удаляешь все и заново переписывешь с комментированием каждйо строки.

Исходная версия LightDiver, :

А вот нихрена…. Новый заново переписанный блок:

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), "guild", nil, 1)
						break
					else
						chisloProstyhQComplit=chisloProstyhQComplit + 1
						if chisloProstyhQComplit==countQ then
							SendChatMessage("*" .. sender .. ", все простые квесты уже выполнены. Добавить переход на следущий уровень квестов.", "guild", nil, 1)
						end
					end
				end
            else
                ach=TDG[sender][qAchiv]
                SendChatMessage(hsh .. " 004 " .. sender .. ", у тебя уже взят квест: " .. ach .. GetAchievementLink(ach), "guild", nil, 1)
            end
		else
			ach=pQuests[1][1]
			SendChatMessage(hsh .. " 001 " .. sender .. ", покажи мне ачивку " .. ach .. " " .. GetAchievementLink(ach), "guild", 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

Не работает с первого же притна. И сиди сумрачно наблюай, думай - а что же не так то? Явно где то не так переменная использоана или таблица. Или опечатка.