ShowMessage("Ĥ $Rev: 215 $")

--[[
[author]
descript="ÿĤ1"
]]--
perday_max=1
script_name="Ĥ"


function _SMain()

	while true do

		System:Sleep(500)

		-- ƶ  ʵ۾ 158 41
		MoveTo(158, 41, DataBase:GetSceneID(""))

		-- ѡ Ĥ 
		local select_id = INVALID_ID

		local n = EnumObject(true)

		for i=0, n - 1 do
			local idObj, classObj, nameObj, xObj, yObj , sTitle = EnumObject(false, i)
			DbgPrintf("%s %s", tostring(sTitle) , tostring(nameObj))
			if idObj == INVALID_ID then
				continue
			end
		
			if classObj == "NPC" and  sTitle == "#{TWZW_150831_59}" then
				select_id = idObj
				break
			end
		end

		if select_id ~= INVALID_ID then

			QuestFrameSpeak( select_id , "")
			QuestFrameOptionClicked("Ĥ", CMP_PART_MATCH)
		
			System:Sleep(2000)
			local isNext,szMsg = GetDebugMessage()
			while isNext == 1 do				
				if string.find(szMsg, "Ĥݳɹ") or string.find(szMsg, "ѾĤݹ") then
--					ShowMessage("Ĥݳɹ")
					System:UpdateRecord( script_name )
					return
				end
			end
		end

	end
end


_SMain()

