<?xml version="1.0" encoding="utf-8"?>
<waypoints>
	<onLoad>
		player:update();
		numMax = 35;
		dest = 1;
		c = 0;
		datos_TW = load_TW("Indigo")
		cuenta = 0
		iBots = xBots("Indigo")
		for _i in pairs(iBots) do cuenta = cuenta + 1 end
		total = cuenta * 12
		function elDato(elBot,_dbr)
			local count = 0
			for _i in pairs(datos_TW) do count = count + 1 end
			
			if count > 0 then
				for i,t in ipairs(datos_TW) do 
					toon = myExplode(" | ",t)
						if _dbr then
							for z, p in ipairs(toon) do
								cprintf(cli.lightblue, "\r%d = %s ..\n",z,p);
							end
						end
					if toon[1] == iBots[elBot] then
						return toon;
					end
				end
				cprintf(cli.blue, "\rNo hay datos del Personaje : %s\t",iBots[elBot] );
				return false;
			else
				cprintf(cli.lightblue, "\rNo hay datos guardados..\n");
				return false;
			end
		end
		local bucle = true
		print(tostring(elDato(dest)[7]))
		while (bucle) do
			if (tostring(elDato(dest)[7]) == "1") then
				print(tostring(elDato(dest)[1]).." aun no toma su correo anterior")
				dest = dest + 1
			else
				bucle = false
			end
		end
		__WPL:setWaypointIndex(1)
		player:mount()
	</onLoad>
	<!-- #  2 --><waypoint x="2968" z="24605" y="211">	</waypoint>
	<!-- #  3 --><waypoint x="3062" z="24656" y="251">	</waypoint>
	<!-- #  4 --><waypoint x="3127" z="24692" y="254">
		inventory:update()
		e = inventory:itemTotalCount(0);
		player:openStore(123134) -- Bob Vacacielo
		yrest(5000);
		sendMacro('DEFAULT_CHAT_FRAME:AddMessage("|H|h|cffFF99FFCompraremos |r|cff5599BB'..tostring(e)..'|r |cffFF99FFcintos|r|h")');
		store:buyItem(228996,e);
		yrest(7000);
		sendMacro("CloseAllWindows()");
		player:mount();
	</waypoint>
	<!-- #  5 --><waypoint x="2767" z="24456" y="179" tag="buzon">
		
		inventory:update()
		ic = inventory:itemTotalCount(228996)
		if ic > 0 then 
			if elDato(dest) then
				if c > 0 then
					if ic > c or ic == c then
						envio = c
						c = 0
					end
				else
					elPJ = elDato(dest)
					if elPJ[1] ~= nil then
						if tonumber(elPJ[2]) > (numMax - 1) then
							mandar = numMax
						else 
							mandar = numMax - tonumber(elPJ[2]) 
						end
						if tonumber(elPJ[5]) > 0 then
							mandar = mandar + tonumber(elPJ[5])
						end
						if ic > mandar then
							c = 0
							envio = mandar
						else
							c = mandar - ic
							envio = ic
						end
					else
						envio = nil
					end
				end
				if envio then
					cprintf(cli.pink, "\r--> ");
					cprintf(cli.lightgreen, "Enviaremos %d cintos a %s..\n",envio,iBots[dest]);
					openMailbox()
					yrest(5300);
					UMM_SendByNameOrId(iBots[dest],228996,envio);
					yrest(2000);
					sendMacro("CloseAllWindows()");
					elEnvio(iBots[dest],0,envio,"Indigo")
				end
			else
				loadPaths("BuyBelts");
			end
		end
		inventory:update();
		if inventory:itemTotalCount(228996) > c then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("buzon"));
		end
		if dest == cuenta then
			loadPaths("BuyFStones");
		else
			if 1 > c then
				dest = dest + 1
			end
		end
	</waypoint>
</waypoints>