--================================ -- NoobBotter's DailyQuestCheck userfunction -- Version 1.1 -- -- Update: 1.1: -- Waypoint arguments can now accept a waypoint number, or a waypoint tag name. -- -- This userfunction will check to see if you've done all 10 daily quests. -- If you haven't it will continue doing your dailies at the Waypoint you specify with argument 1. -- If you have, it will then check for reset tickets in inventory (if told to in argument 3). -- If you have one, it will use it and then go to the starting waypoint that you specify with _startWP (argument 1). -- If you don't have any resets, it will go to the waypoint you specify with _endWP (argument 2). -- You can specify with true or false whether or not to use any reset tickets (argument 3). -- You can specify how many tickets to keep in inventory, or NOT use (argument 4). -- _startWP and _endWP (arguments 1 and 2) can be a nunmber for the waypoint to go to, or the tag name of the waypoint enclosed in quotes. -- --================================================================================================================= -- Arguments: -- _startWP - Name (or 'Tag'), or waypoint number, of waypoint to go to, to restart, or accept the daily quest. -- If using wayppoint tag name, it must be inside quotes. -- _endWP - Name (or 'Tag'), or waypoint number, of waypoint to go to, after completing all dailies and no more reset tickets remain. -- This is typically where you end the waypoint or go to load the next waypoint. -- If using wayppoint tag name, it must be inside quotes. -- _resetOrNot - Optional. Set to true to use Daily Reset Tickets, or false to not use any. -- Default (anything other than 'true') is to not use any. -- _howManyToKeep - Optional. Set to the number of Daily Reset Tickets you want to keep in inventory and NOT use. -- Default is 0 which will use all you have. -- -- -- In the below examples, "acceptQuest" is an example of the waypoint with the Tag of "acceptQuest": -- and the "myfinish" would be the name of the waypoint I go to when all quests are done. For example: --================================================================================================================= -- Example 1: To not use any daily resets and just do my 10 dailies, using waypoint tag names: -- DQC_DailyQuestCheck("acceptQuest","myfinish") -- -- Example 2: To keep doing this quest until all Daily Reset Tickets have been used, using waypoint tag names: -- DQC_DailyQuestCheck("acceptQuest","myfinish",true) -- -- Example 3: To use Daily Reset Tickets when needed but stop when I only have 5 reset tickets left, using waypoint numbers: -- DQC_DailyQuestCheck(5,24,true,5) --================================================================================================================= function DQC_DailyQuestCheck(_startWP,_endWP,_resetOrNot,_howManyToKeep) -- _startWP is the waypoint you go to to start the quest over again, _endWP is the waypoint you go to when you're done and out of reeset tickets. local DQC_NextWP = "None" -- ensure values will work and set defaults if (_resetOrNot ~= true and _resetOrNot ~= false) or _resetOrNot == nil then print("_resetOrNot needs to be set to true or false. Anything else will assume false so we are not using reset tickets.\n" ) _resetOrNot = false end if _howManyToKeep ~= nil and type(_howManyToKeep) ~= "number" then printf("Incorrect usage of '_howManyToKeep' argument.\n") _howManyToKeep = nil end if _howManyToKeep == nil then _howManyToKeep = 0 end player:update() yrest(500) local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()"); if (dailyQuestCount==dailyQuestsPerDay) then if _resetOrNot then local currentTickets = inventory:itemTotalCount(202434)--daily reset tickets if currentTickets > _howManyToKeep then inventory:useItem(202434); yrest(200) DQC_NextWP = _startWP else print("Not enough Daily Reset tickets remaining.") end end else DQC_NextWP = _startWP end if DQC_NextWP ~= _startWP then DQC_NextWP = _endWP end if type(DQC_NextWP) == "string" then __WPL:setWaypointIndex(__WPL:findWaypointTag(DQC_NextWP)) elseif type(DQC_NextWP) == "number" then __WPL:setWaypointIndex(DQC_NextWP) else error("Waypoint argument should be either a number, or a string enclosed in quotes.") end end