ShowMessage("领取每日五行法帖 $Rev: 214 $")

--[[
[author]
descript="每天可领取1次"
]]--
perday_max=1
script_name="领取每日五行法帖"

function OnMission()
	while true do
		local nowScene = GetActiveDataSceneID()

		if nowScene == 1 then
	  	 	MoveToNPC(200, 334, 1, "独孤悔")
		elseif nowScene == 2 then
	   		MoveToNPC(206, 56, 2, "金忆风")
		else
	    		MoveToNPC(218, 243, 0, "黄云禅")
		end
	
		QuestFrameOptionClicked(script_name , CMP_PART_MATCH)
		System:Sleep(500)
		QuestFrameMissionClose()

		local isNext,szMsg = GetDebugMessage()
		while isNext == 1 do
			if string.find(szMsg, "已经领取过了") then
				ShowMessage("领取每日五行法帖：已经完成！")
				System:UpdateRecord( script_name )
				return
			end
			isNext,szMsg = GetDebugMessage()
		end
	end

end

function _SMain(...)
	OnMission()
end

_SMain()


