Quick Question: Not sure how to integrate this code into WP

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
klassik1
Posts: 57
Joined: Wed Oct 19, 2011 12:38 pm

Quick Question: Not sure how to integrate this code into WP

#1 Post by klassik1 »

Okay, I have a great butterfly waypoint that i want to integrate using daily resets if i have them. Im just not sure what exactly to take out, to add in this new code.


Heres my waypoint:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
settings.profile.mobs = {"Inferno Butterfly"};
function checkCondition()
	queststate = getQuestStatus("Catch Butterflies");
	if queststate == "complete" then
		player:mount();
		__WPL:setWaypointIndex(__WPL:findWaypointTag("goBack"));
	end
end

function checkLoopCondition()
	queststate = getQuestStatus("Catch Butterflies");
	if queststate ~= "complete" then
		__WPL:setWaypointIndex(__WPL:findWaypointTag("startKilling"));
	end
end

</onLoad>
	<!-- #  1 --><waypoint x="6427" z="5435" y="154" type ="TRAVEL">
	local dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()"); 
     			if 10 == dailyQuestCount then
      				printf ("Done "..dailyQuestCount.." of " .. dailyQuestsPerDay ..    " Quests. STOP.");
      				--error("Bot ending.", 0); -- ends the script.
					player:logout()
      			else
      				printf("Done "..dailyQuestCount.." of " .. dailyQuestsPerDay ..    " Left " .. dailyQuestsPerDay - dailyQuestCount .. " Quests.");
      			end
			player:target_NPC("Robbie Butcher");
			sendMacro("OnClick_QuestListButton(1, 2)"); yrest(1111);
			sendMacro("AcceptQuest()"); yrest(1111);
			player:update()
                        if not player.Mounted then
				player:mount();
			end
	</waypoint>
	<!-- #  2 --><waypoint x="6298" z="5210" y="181" type ="TRAVEL">	</waypoint>
	<!-- #  3 --><waypoint x="6389" z="4638" y="180" type ="TRAVEL">	</waypoint>
	<!-- #  4 --><waypoint x="6537" z="4035" y="202" type ="TRAVEL">	</waypoint>
	<!-- #  5 --><waypoint x="6576" z="3875" y="202" type ="TRAVEL">	</waypoint>
	<!-- #  6 --><waypoint x="6854" z="3658" y="170" type ="TRAVEL">	</waypoint>
	<!-- #  7 --><waypoint x="6981" z="3680" y="158" type ="TRAVEL">	</waypoint>
	<!-- # 8 --><waypoint x="7019" z="3519" y="176" type ="TRAVEL">	</waypoint>
	<!-- # 9 --><waypoint x="7117" z="3181" y="188" type ="TRAVEL">	</waypoint>
	<!-- # 10 --><waypoint x="7371" z="3203" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 11 --><waypoint x="7335" z="3349" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 12 --><waypoint x="7466" z="3377" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 13 --><waypoint x="7517" z="3162" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 14 --><waypoint x="7636" z="3184" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 15 --><waypoint x="7666" z="3066" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 16 --><waypoint x="7537" z="3029" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 17 --><waypoint x="7573" z="2853" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 18 --><waypoint x="7356" z="2681" y="180" tag="startKilling">	</waypoint>
	<!-- # 19 --><waypoint x="7510" z="2638" y="181">checkCondition()	</waypoint>
	<!-- # 20 --><waypoint x="7623" z="2496" y="180">checkCondition()	</waypoint>
	<!-- # 21 --><waypoint x="7611" z="2298" y="168">checkCondition()	</waypoint>
	<!-- # 22 --><waypoint x="7666" z="2046" y="168">checkCondition()	</waypoint>
	<!-- # 23 --><waypoint x="7811" z="1651" y="168">checkCondition()	</waypoint>
	<!-- # 24 --><waypoint x="7863" z="1489" y="168">checkCondition()	</waypoint>
	<!-- # 25 --><waypoint x="7764" z="1373" y="168">checkCondition()	</waypoint>
	<!-- # 26 --><waypoint x="7768" z="1735" y="168">checkCondition()	</waypoint>
	<!-- # 27 --><waypoint x="7566" z="2618" y="181">checkCondition()	</waypoint>
	<!-- # 28 --><waypoint x="7589" z="2830" y="180" tag="goBack" type ="TRAVEL">
			checkLoopCondition()
			if not player.Mounted then
				player:mount();
			end
	</waypoint>
	<!-- # 29 --><waypoint x="7543" z="3051" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 30 --><waypoint x="7660" z="3077" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 31 --><waypoint x="7645" z="3186" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 32 --><waypoint x="7509" z="3169" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 33 --><waypoint x="7449" z="3377" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 34 --><waypoint x="7335" z="3337" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 35 --><waypoint x="7367" z="3203" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 36 --><waypoint x="7146" z="3163" y="190" type ="TRAVEL">	</waypoint>
	<!-- # 37 --><waypoint x="6982" z="3597" y="171" type ="TRAVEL">	</waypoint>
	<!-- # 38 --><waypoint x="6621" z="3740" y="171" type ="TRAVEL">	</waypoint>
	<!-- # 39 --><waypoint x="6568" z="3916" y="202" type ="TRAVEL">	</waypoint>
	<!-- # 40 --><waypoint x="6483" z="4259" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 41 --><waypoint x="6284" z="5115" y="180" type ="TRAVEL">	</waypoint>
	<!-- # 42 --><waypoint x="6425" z="5429" y="167" type ="TRAVEL">
	player:target_NPC("Robbie Butcher");
			sendMacro("OnClick_QuestListButton(3, 1)"); yrest(1111);
			sendMacro("CompleteQuest()"); yrest(1111);

	</waypoint>
</waypoints>



And this should be the code to use to check if there is daily resets, and to use them:

Code: Select all

local dailyQuestCount, dailyQuestsPerDay = RoMScript("Daily_count()")
if dailyQuestsPerDay - dailyQuestCount == 0 then -- out of dailies
   local reset = inventory:findItem(202434) -- "Daily Quest Ticket"
   if reset then
      reset:use()
   else
   error("Completed All Daily Resets.")
   end
end
end
error("Ran Out of Daily Items.")

I would appreciate the help.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Quick Question: Not sure how to integrate this code into

#2 Post by lisa »

I didn't have a look at your code but this is what I use.

Code: Select all

	local queststate = getQuestStatus("Catch Butterflies")
	if queststate == "complete" then
		player:target_NPC("Robbie Butcher");
		CompleteQuestByName("Catch")	
	end
	yrest(1000)
	local dqCount, dqPerDay = RoMScript("Daily_count()");
	if dqCount ~= 10 then
		player:target_NPC("Robbie Butcher");
		AcceptQuestByName("Catch")
	else
		inventory:update();
		player:update();
		if inventory:itemTotalCount(202434) > 0 then
			inventory:useItem(202434);
			yrest(2000)
			player:target_NPC("Robbie Butcher");
			AcceptQuestByName("Catch")			
		else
			player:sleep();
		end 
	end
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Post Reply