<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
-- Buy Belts script - V1.0 - written by Jandrana
-- A small script to buy "Excellent belts" in Limo Desert and send it to
-- a group member, that will make G7 mana stones from them. 
-- The char will wait with buying until the the other char writes "ready"
-- in party chat. After sending the belts, the this char will write "sent"
-- in party chat to signal the other char, that he should check mail.
--
-- Setup: build a group with a second char, place the char for this script
-- near the merchant "Nebular Grey-Eye"

recipient = "charname";  -- the char that should receiver the belts.
itemName = "Excellent Belt"; 

eventparty("belts", "start");

function buyBelts()
	player:openStore("Nebular Grey-Eye")
	store:buyItem(itemName, 27);
end

function sendBelts()
	local armor=MGbuildItemTableOfType("Armor");
	armor=selectItemsByName(armor, itemName);
	UMM_SendAdvanced(recipient,getIdsFrom(armor), nil, nil, nil, nil, nil, nil, nil, nil, nil);
   eventparty("belts", "start");
end

	numberOfG7 = 0;
	numberSent = 0;
	repeat
		cprintf(cli.lightgreen,"\nHow many G7 stones do you want:\n")
		numberOfG7 = io.stdin:read()
		numberOfG7 = tonumber(numberOfG7)
	until numberOfG7 and numberOfG7 > 0
__WPL:setWaypointIndex(1)
   
</onLoad>
	<!-- #  1 --><waypoint x="2467" z="48296" y="136">	
		repeat
			yrest(1000)
		until checkeventparty("belts", "ready");
		buyBelts();
	</waypoint>
	<!-- #  2 --><waypoint x="2603" z="48202" y="136">	</waypoint>
	<!-- #  3 --><waypoint x="2812" z="48230" y="136">		
		sendBelts();
		sendpartychat("sent");
		numberSent = numberSent + 1;
		if numberSent >= numberOfG7 then
			error("Belt sending finished.", 0)
		end
	</waypoint>
	<!-- #  5 --><waypoint x="2576" z="48212" y="136">	</waypoint>
	<!-- #  6 --><waypoint x="2471" z="48302" y="136">	
	</waypoint>
</waypoints>