ShowMessage("ȡ $Rev: 214 $")

--[[
[author]
descript="ÿȡ1"
]]--
script_name="¯"


function _SMain(...)

	local g_ScriptID = 890174
	local nJJS = DataPool:UserBag_CountItemByName("ʯƬ")
	local nLH = DataPool:UserBag_CountItemByName("")

	local spaceNum = PlayerPackage:GetEmptySlot(1)
	if spaceNum < 2 then
   		ShowMessage("ȡ𣺱λ㣬ű")
  		return
	end

	if Player:GetData("LEVEL") < 80 then
 		ShowMessage("ȡ𣺽ɫȼ80ű")
   		return
	end

	while true do 

		if GetQuestTimesInfo("¯") == 0 then
			ShowMessage("Ѿȡ!")
			return
		end

		MoveToNPC(363, 243, 1, "Ľ")
		System:Sleep(1000)
		QuestFrameOptionClicked(script_name , CMP_PART_MATCH)
		System:Sleep(1000)

		local index = Get_XParam_INT(g_ScriptID, 1) 
		local yinhuo = Get_XParam_INT(g_ScriptID, 2) 
		local lianshi = Get_XParam_INT(g_ScriptID, 3)

		DbgPrintf("bag %d , param %d,%d,%d" , tonumber(spaceNum) ,tonumber(index) , tonumber(yinhuo) , tonumber(lianshi))
		
	
		while UI:IsWindowShow("TheFireStove") do 
		
			index = Get_XParam_INT(g_ScriptID, 1) 
			yinhuo = Get_XParam_INT(g_ScriptID, 2) 
			lianshi = Get_XParam_INT(g_ScriptID, 3)	  

			if lianshi <= 0 then
				UI:WindowHide("Quest")
				local New_nJJS = DataPool:UserBag_CountItemByName("ʯƬ")
				local New_nLH = DataPool:UserBag_CountItemByName("")
				ShowMessage("ɹȡ[%d]ʯƬ[%d]𣬽ű", (New_nJJS - nJJS), (New_nLH - nLH))
				return
			end
		
			if yinhuo > 0 and index == 1 then
				DoLuaString("" , "TheFireStove_FireButton_OnClick()")
				System:Sleep(500)
				continue
			end
		
			if UI:IsWindowShow("TheFireStove_MessageBox") then
				DoLuaString("" , "TheFireStove_MessageBox_OK_Clicked()")
				System:Sleep(1000)
	 		end	
			   
			DoLuaString("" , "TheFireStove_StoneButton_OnClick()")
			System:Sleep(500)  

			if FindDebugMessage("ıʣռ䲻") == true then
   				ShowMessage("ȡ𣺱λ㣬ű")
  				return
			end
		end
	end
end

_SMain()




