ShowMessage("一键祝福好友 $Rev: 100 $")


function _SMain(...)

	local nPrayCount = 0 

	--祝福自己
	local PlayerGUID = Player:GetGUID()
	DoPray(tostring(PlayerGUID) , 0)

	System:Sleep(500)

	--祝福朋友
	for iGroup = 1,4 do 
		local MaxFriendNum = DataPool:GetFriendOnlineNumber(iGroup)

		for index = 0 , MaxFriendNum - 1 do
			DbgPrintf("  %d/%d" , index,MaxFriendNum)
			--local sName = DataPool:GetFriend( iGroup , index , "NAME")
			--DbgPrintf("%d,%d = %s" , iGroup , index , tostring(sName))
			local nFlag = DataPool:GetFriend( iGroup , index , "SNS_Icon")
			--if nFlag == 1 then
				local FriendID = DataPool:GetFriend( iGroup , index , "ID")
				DoPray(tostring(FriendID) , 1)
				nPrayCount = nPrayCount + 1 
				System:Sleep(500)
			--end
		end
	end

	System:Sleep(2000)

	ShowMessage("尝试向总共 %d 个在线好友输出祝福" , tonumber(nPrayCount))

	if UI:IsWindowShow("Sns") then
		UI:WindowHide("Sns")
	end

	DoLuaString("SnsGame_Env" , "SnsGame_Bound_Button_Clicked()" )
end

_SMain()