<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
	-- NoobBotter's Server For A Day script
	--=============================================================================================--
	--===  						NoobBotter's Server For A Day script							===--
	--===  									Version 1.1											===--
	--===  															  							===--
	--===  	This script will Run the Server for a Day game in the Juice Festival.	 			===--
	--===   									  	  											===--
	--===  															  							===--
	--===   Revision 1.1: The bot will automatically stop after 180 seconds (3 minutes)			===--
	--===  		which just happens to be the length of time to complete the game.				===--
	--===   									  	  											===--
	--===  	Requirements: 											  							===--
	--===		TravelTo Userfunction is needed.												===--
	--===   									  	  											===--
	--===  	Instructions: 											  							===--
	--===   Bot will automatically travel to logar if needed.									===--
	--===  		If already in Logar town(near housemaid, pet hunter, AH, or snoop), it will 	===--
	---===		find it's way to the game NPC.													===--
	--=============================================================================================--
	
	for k,v in pairs(settings.profile.skills) do
		v.AutoUse = false
	end
	local function giveDrink(recipient,message)
		player:target_NPC(recipient)
		yrest(500)
		if string.find(message,"puke") then
			RoMScript("UseExtraAction(4)")
		elseif string.find(message,"Apple") then
			RoMScript("UseExtraAction(3)")
		elseif	string.find(message,"Bottoms") then
			RoMScript("UseExtraAction(1)")
		elseif string.find(message,"Golden") then
			RoMScript("UseExtraAction(2)")
		end
		repeat
			player:updateCasting()
			yrest(100)
		until not player.Casting
		player:target()
		
	end
	local endtime, endmoreToCome, endname, endmsg
	local endnow = false
		
	EventMonitorStart("Jevent1", "CHAT_MSG_SAY", ",,,Joyce Malun");
	EventMonitorStart("Jevent2", "CHAT_MSG_SAY", ",,,Louis Jefu");
	EventMonitorStart("Jevent3", "CHAT_MSG_SAY", ",,,Edethe Vade");
	
	local curZone = RoMScript("GetZoneID()")
	if curZone ~= 1 then
		travelTo("Logar")
	end
	local distAH, distPH, distHM
	local AH = player:findNearestNameOrId(110770) 
	local PH = player:findNearestNameOrId(114923) 
	local HM = player:findNearestNameOrId(110773)
		
	if AH ~= nil then
		distAH = distance(player, AH) 
	else
		distAH = 5000
	end
	if PH ~= nil then
		distPH = distance(player, PH) 
	else
		distPH = 5000
	end
	if HM ~= nil then
		distHM = distance(player, HM) 
	else
		distHM = 5000
	end
	if distPH > distAH and distHM > distAH then --closest to AH
		player:moveTo(CWaypoint( -1196, -5846 ), true)
	elseif distAH > distHM and distPH > distHM then -- closest to House Maid
		player:moveTo(CWaypoint( -611, -5958 ), true)
		player:moveTo(CWaypoint( -791, -5939 ), true)
	elseif distHM >= 5000 then -- closest to House Maid
		error("You're too far away. Move into Logar town and try again.")
	end
	
	player:moveTo(CWaypoint( -982, -6026 ), true)
		
	player:target_NPC(111688); -- Shela Berit
	yrest(100)
	sendMacro("ChoiceOption(2)");
	local startTime = os.time()
	player:target();
	player:moveTo(CWaypoint( -934, -6073 ), true)
	
	
	repeat 
		local time, moreToCome, name, msg, _go
		time, moreToCome, name, msg = EventMonitorCheck("Jevent1",1)
		yrest(10)
		if name ~= nil then
			giveDrink("Joyce Malun",name)
		end
		time, moreToCome, name, msg = EventMonitorCheck("Jevent2",1)
		yrest(10)
		if name ~= nil then
			giveDrink("Louis Jefu",name)
		end
		time, moreToCome, name, msg = EventMonitorCheck("Jevent3",1)
		yrest(10)
		if name ~= nil then
			giveDrink("Edethe Vade",name)
		end
		yrest(100)
		
	until os.time()-startTime > 180
	
	EventMonitorStop("JeventOver")
	EventMonitorStop("Jevent1")
	EventMonitorStop("Jevent2")
	EventMonitorStop("Jevent3")
	player:moveTo(CWaypoint( -982, -6026 ), true)
	error("Complete.")
</onLoad>
</waypoints>