ShowMessage("ȡս $Rev: 214 $")

--[[
[author]
class=3
descript="ÿܿȡһ"
]]--
perday_max=1
script_name="ȡս"


function OnMission()

	while true do
		-- ƶ 

		if CityToGuild() == false then
			ShowMessage("ûаɳУ")
			break 
		end

		MoveToNPC( 93, 54,-1, "ѫ" )
		--ѡ ȡս		
			
		QuestFrameOptionClicked("ȡÿܽ", CMP_PART_MATCH)
		
		System:Sleep( 1000 )

		if UI:IsWindowShow("Bhls_Prize") then
			DoLuaString("Bhls_Prize_Env" , "Bhls_Prize_Ok_Clicked()")
			System:UpdateRecord( script_name )
			return
		end

		System:Sleep( 1000 )	
					
		local isNext,szMsg = GetDebugMessage()

		while isNext == 1 do
			if string.find(szMsg, "ȡɹ") then
				ShowMessage("ȡսɣű")
				System:UpdateRecord( script_name )
				return
			elseif string.find(szMsg, "Ѿȡ") then
				ShowMessage("ȡսɣű")
				System:UpdateRecord( script_name )
				return
			end
			isNext,szMsg = GetDebugMessage()

		end
	end
end

function _SMain(...)

	OnMission()

	GuildToCity(0)
end

_SMain()