<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
        settings.profile.options.EGGPET_ENABLE_ASSIST = false
         for k,v in pairs(settings.profile.skills) do
            v.AutoUse = false
         end
	unregisterTimer("timedSetWindowName");
	setWindowName(getHwnd(),sprintf(string.sub(player.Name,1,7)..": "..inventory:itemTotalCount(202434)))

	print("starting")
	local bottle1 = player:findNearestNameOrId(123369)
	local bottle2 = player:findNearestNameOrId(123368)
	local bottle3 = player:findNearestNameOrId(123508)
	local NPC1 = player:findNearestNameOrId(123561)
	local mousePawn = CPawn(memoryReadRepeat("intptr", getProc(), addresses.staticbase_char, addresses.mousePtr_offset))

	showWindow(__WIN, sw.minimize) yrest(500) -- minimize first or else restore wonn't work bug.
	showWindow(__WIN, sw.restore) yrest(1000) -- Restore and activate console
	
	yrest(1000)
					
	local function click(pawn,double)
		detach()
		keyboardHold(key.VK_SHIFT)
		local ww = memoryReadIntPtr(getProc(),addresses.staticbase_char,addresses.windowSizeX_offset)
		local wh = memoryReadIntPtr(getProc(),addresses.staticbase_char,addresses.windowSizeY_offset)
		local clickX = math.ceil(ww/2)
		local clickY = math.ceil(wh/2)
		local wx,wy,wwide,whigh  = windowRect(getWin())
		mouseSet(wx + clickX, wy + clickY)
		yrest(100)
		local mousePawn = CPawn(memoryReadRepeat("intptr", getProc(), addresses.staticbase_char, addresses.mousePtr_offset))
		if( mousePawn.Address ~= 0 ) then
			local target = CPawn(mousePawn.Address);
			--print(target.Address.." arg:"..pawn.Address)
			if pawn and string.find(target.Address, pawn.Address ) then	
				yrest(100)
				mouseRClick()
				yrest(100)
				if double then mouseRClick() end
			end
		end
		keyboardRelease(key.VK_SHIFT)		
		attach(getWin())
		yrest(150)
	end
	
	local function doquest()
		player:aimAt(NPC1)
		click(NPC1)
		yrest(100)
		
		player:aimAt(bottle1)
		click(bottle1,true)
		yrest(200)
		player:aimAt(bottle2)
		yrest(200)
		click(bottle2,true)
		yrest(100)
		player:aimAt(bottle3)
		click(bottle3,true)
		yrest(550)
		
		player:aimAt(NPC1)
		click(NPC1)
		yrest(200)
	end

	mouseRClick() -- to make sure mouse it active on game before starting, seems to need 1 mouse click before it works
	while (true) do
		doquest()
		if memoryReadRepeat("int", getProc(), addresses.inventoryBagIds + 0x6B0) > 8 then
			yrest(800)
		end
		if memoryReadRepeat("int", getProc(), addresses.inventoryBagIds + 0x6B0) == 10 then
			if inventory:itemTotalCount(202434) >= 1 then
				inventory:useItem(202434);
				yrest(500)
				setWindowName(getHwnd(),sprintf(string.sub(player.Name,1,7)..": "..inventory:itemTotalCount(202434)))
			else
				printf("No Daily Reset Cards left!\n")
				player:sleep();      
			end	
		end
	end

</onLoad>
</waypoints>
